Mike's Home Page > Jukebox Home > Our Jukebox > The Two PCs of Our Jukebox

The Two PCs of Our Jukebox

Working with the two PCs of our jukebox is different from the single-PC situation of the minimal jukebox. This page describes the important differences.

Adding CDs

The first stage of adding CDs follows the procedure described for the minimal jukebox. The resulting music files are on the server PC but the resulting jukebox database is on the main PC. To transfer the database to the server PC, I use the AJC Directory Synchroniser. See further information about the process in the next section, "Making Improvements".

I added most of the CDs to our jukebox when the design of the jukebox was at a more elementary stage. The technique that I used at that time was undoubtedly better for hundreds of CDs than the technique that I use now for a few CDs. If you're going to be adding many CDs to your jukebox, the technique I'm about to describe might be worth considering. The idea is to minimise the amount of time you have to spend at the PC, and to maximise the time that the PC spends working unattended. Start by using EAC to get your CDs into the PC as quickly as possible. To speed things up use WAV format (not WMA) and write to a local disk (not over the network). If you've two CD drives, use both of them. Having got your WAV files, import them to Media Center and note that there's no artist or title information — that's because the WAV format doesn't support tags. Use Media Center's "Library Tools: File Properties From Filename" feature to extract the genre, artist, track number, and title information from the pathnames of the files (but watch out for punctuation characters that are prohibited in filenames, which get converted to underscores). Then use Media Center to convert all the files to WMA format and insert the tags — this is a time-consuming operation but can run unattended for hours or even days. Then copy the WMA files to the server PC — again, this can be an unattended operation.

Making Improvements

The jukebox user interface is constantly being improved, mainly by making changes to the Database Converter and the CGI programs. Those programs use a collection of "template files", which are separate HTML files that contain prototypes for pages to be displayed on the remote control. The Database Converter uses templates to create the HTML files in the jukebox database. The CGI programs use templates to format pages to be sent to the browser. The advantage of using template files rather than embedding the HTML in the programs is that the page format can readily be visualised and edited using an HTML editor.

Below are shown two template files as they would be displayed in a browser window:

Sample template for 'Details' database fileSample template for "Details" database file
Template for player.cgiTemplate for player.cgi

When editing the templates, CGI programs, etc, I use Dreamweaver (HTML) and UltraEdit-32 (text). Any similar programs would do. For simplicity I've left those programs out of the lists and diagrams of software elsewhere on this site.

The jukebox in FirefoxThe jukebox in Firefox

After editing comes testing. Testing the Database Converter is simply a matter of re-running it. Testing the results of that run, and the CGI programs, requires a browser. For initial testing I use an ordinary browser, Mozilla Firefox, rather than one of the remote controls. I find that a "real" browser is easier and quicker to use, and provides much better problem-solving facilities. Final testing is done with the remote controls.

AJC directory synchroniserAJC directory synchroniser

When I've finished making changes I need to transfer the database and the CGI programs (and possibly their templates) to the server PC. I transfer them using the Directory Synchroniser, configured to compare the actual contents of files rather than just their datestamps — the reason for this being that as the database has been totally re-created, there exist identical files with different datestamps. The Synchroniser preview helpfully reports exactly which files are different from their previous versions, and it offers a line-by-line summary of the differences it encounters in any file. I find this feature very useful as a means of detecting unintended changes.

Operating the Server PC

Occasionally there's a need to operate the server PC in the conventional way rather than using the remote controls. There's no monitor, keyboard, or mouse, so I use RealVNC to access the server PC using the monitor, keyboard, and mouse of my main PC. I double-click on an icon to open a window containing the other PC's desktop. It couldn't be simpler.

The server is designed so that, if it starts misbehaving, it can easily and reliably be reset to a known state by switching it off and on again. That facility has actually never been needed, but it's a useful feature, especially when I'm absent. For restart purposes the server PC is configured to run necessary programs automatically at start-up: the Apache and RealVNC servers (as Windows services), and Winamp (from the Startup folder).

Network Connection

The two PCs are connected by a conventional ethernet network. It's not actually necessary for the server PC to access any files on my main PC, so in the interests of security, the network settings prohibit any such access. Similarly it's not necessary for the server PC to access the Internet, so the firewall settings in the ADSL router block all traffic from the server PC to the Internet.