The Minimal Jukebox Server

The Server Hardware

You don't need a particularly powerful PC for selecting and playing music, but adding CDs and other maintenance tasks are a lot more pleasant with a fast PC. It doesn't have to be sited near the amplifier and speakers — anywhere within cable range will do, in a separate room if desired. In day-to-day operation there's no need to look at it or touch it.

The WiFi Access Point can be sited anywhere within cable range of the server PC. Signal quality is the important criterion when selecting a location.

The Apache HTTP Server Software

There's not much to say about the Apache HTTP server software. After installation it needs a small amount of work to configure it, then it just sits there in the background quietly handing out pages in response to requests from the browser in the remote control.

An important element of server configuration is the "Document Root", which is a folder on the server PC hard disk. When the server receives a request from a browser, the "Document Root" is the directory that the server goes to for the requested page. The principal contents of the Document Root folder for the jukebox server are:

  • The Start Page for the jukebox (see below)
  • The jukebox database, which was created by the Database Converter
  • HTML files containing fixed displays such as the tabs across the top of the screen
  • Image files containing button faces and other graphical elements
  • The CGI programs

The Start Page

The Start Page, named "index.html", is requested when the remote control browser is started, or when the user clicks on the browser's Home button. The Start Page is a frameset, with the screen divided into four frames:

The three frames of the Start Page
The three frames of the Start PageThe four frames of the Start Page

That frameset stays in place permanently. The sources of the frame contents are as follows:

  • Tabs frame: infotabs.html (fixed)
  • Player tab frame: playertab.html (fixed)
  • Player frame: player.cgi
  • Info frame: varies depending on which tab is selected:
    • Home tab: home.html, in the jukebox database
    • Index tab: azframeset.cgi, which is a further frameset dividing the Info frame into two sections:
      • On the left, an HTML file in the Index section of the jukebox database, displaying the letters A-Z
      • On the right, an HTML file in the Index section of the jukebox database, displaying a list of artists, albums, etc
    • Details tab: an HTML file in the Details section of the jukebox database, displaying details of an album or piece. If there are enough tracks that a scroll bar is necessary, the Info frame is divided with a further two-section frameset, to prevent the album information from scrolling out of view:
      • Above, the album information
      • Below, the track information, with scroll bar
    • Lyrics tab: lyrics.cgi
    • Queue tab: queue.cgi
    • Recent tab: recent.cgi
    • Lucky Dip tab: luckydip.cgi
    • Newcomers tab: newcomers.html or newcomers_covers.html, in the jukebox database
    • Search tab: search.cgi

CGI programs

The CGI programs create HTML pages and send commands to Winamp on request, using information that can vary from time to time. The major sources of such variable information are:

  • Which link or button the user pressed, and any information associated with that link or button. For instance, the type of button (e.g. "Play Now") and the pathname of the music file to be played.
  • The current state of Winamp. The information includes the status (Play, Pause, Stop), the pathname of the file currently being played, the duration of the track and how much has already been played, the pathnames of the files (if any) in the "playlist" waiting to be played, etc.
  • The state of "cookies" which are stored by the browser in the remote control indicating previous user actions. For instance, a cookie associated with the Search tab records the previous search, so that it can be redisplayed next time the tab is next selected .
  • The log of files recently played, which is updated by player.cgi whenever a file is played or queued, and is displayed on the Recent tab.

Winamp and httpQ

Winamp is the program that plays the music and maintains the queue of music waiting to be played (in Winamp this is called the "playlist").

A Winamp plug-in called httpQ provides an HTTP server that allows other programs to control and monitor Winamp functions. The CGI programs player.cgi and queue.cgi communicate with Winamp using httpQ.

Winamp uses Windows Media Encoder to decompress the music files.