OCD template: CMIPlay

 
1. Description

    CMI_PLAY.DAX is an OrangeCD 1) template. It is a modified version of the CMI template, and includes a PLAY BUTTON. In addition I have added a few other optional features, and made some minor changes.

I’ve simply added a hyperlinked image next to each track name ( Album Page). When you press the button, the track will be played in your default audio player. The feature assumes that your audio collection is ripped using iTunes (or any other ripping software that uses the same naming convention).

Warning:
The HTML files created with this template should only be used on a home computer or home network. Clicking the play button actually copies the track to the users local Temporary Internet Files folder. Publishing your CMI_PLAY files on the Internet would therefore allow anyone to grab a copy of your entire audio collection. So don’t do that. It’s illegal!!

This documentation is written for CMI_PLAY.DAX v.1.22 (2004-09-14).

Note: When editing the CMI_PLAY.DAX script in DAXEDIT.EXE, use Tab size=2
( DAXEDIT: View | Options | Editor | Tab Size
)

1) OrangeCD is a music collection manager created by Firetongue Software.
The CMI_PLAY template has only been tested with OrangeCD v.5.2.0.7523 thru v.5.2.1.8016.

2. How to install

    In order to use the template, follow these instructions:
  1. Unzip the CMI_PLAY-x.xx.ZIP file, which should contain the following files:


    • playbtn_beige.gif
    • playbtn_gray.gif
    • cmi_play.dax

  2. Place the modified template file – CMI_PLAY.DAX – in the Orange CD template folder (C:\Program Files\OrangeCD\templates).


  3. Use DAXEDIT.EXE to edit the following Start page variables so they match your configuration:

  4. (DAXEDIT.EXE should be located in your OCD program folder)

    var webServerName = "<name of web server that hosts your iTunes DB>";
    var webServerName = "capetown";

    var webSiteName = "<name of web folder where your iTunes DB is located>";
    Example: var webSiteName = "iTunesDB";
    Note: Do NOT include leading or trailing backslash.

    var trackExt = "<audio file extension>";
    Example: var trackExt =".mp3";
    Note: You MUST include the dot.

    var incTrackNum = "<true | false>";
    If the iTunes option "Create filenames with track number" is checked, set this variable to 'true'. Otherwise set it to 'false'.
    ( iTunes: Edit | Preferences | Importing)
    Example: var incTrackNum ="false";

    Note: You MUST include the dot.

    If you rename the play button images, you will also have to edit these variable values:

    var btnBeige = "<beige button image name>";
    var btnGray = "<gray button image name>";
    Example: var btnBeige ="playbutton_beige.gif";

  5. Run OCD, click the Tools menu, and then select Export To HTML…


  6. Select CMI_PLAY from the Web page template window.


  7. Click Next twice.


  8. Fill out the Output folder field (example: C:\Inetpub\wwwroot\OCD-CMIPlay), and add a Web site title (example:My CD Collection). If the specified Output folder doesn't exist, OCD will offer to create it for you.


  9. Click Next and then click Finish.


  10. Sit back, be patient, enjoy a cup of tea. Generating the result can take some time, but after a few minutes you should see the result appear in your browser.

  11. Create a subfolder in your Output folder, and call it images (example: C:\Inetpub\wwwroot\OCD-CMIPlay\images).

    ImageImage nameDescription
    playbtn_beige.gif unless the OCD track name contains a backslash (\) the track can hopefully be played
    playbtn_gray.gif not used by the script at the moment, but if used in the future it would be to identify tracks that can not be played.

  12. Go back to your browser, and navigate to the Album page of one of your CDs. You should see a play button next to each track number.

  13. Click to play - and enjoy!
Note: If you experience any problems, please read Section 5: Limitations. It may help you solve the problem, or at least explain why the play button won’t work with your audio collection.

Copyright © 2004 Juventas. All rights reserved.

3. Screen shot

   
 Figure 1: Track list with play button


Copyright © 2004 Juventas. All rights reserved.

4. Additional modifications

    Here is a complete list of modifications:

Start page:
  •  date, time and script name added to header (optional) [1]
  •  album, disk, set, track, and artist count, plus total play time added to header (optional) [2]
  •  extended browse options, including album title (optional) [3]
  •  extended album info in the New items section (optional) [4]
  •  optional database stats section added at the bottom of the page:
     it includes DB file name, DB size, DB last backup, DB owner,
     average album length, average track length and average tracks per album
     (not shown in figure 2)

 Figure 2: Modified start page

    Album page:
  •  extended album info added (optional) [1]

 Figure 3: Modified album page

    Track listing page:
  •  play button added (optional) [1]
  •  track list neatly organized in a table [2]

     Figure 4: Modified track listing page


Copyright © 2004 Juventas. All rights reserved.

5. Limitations

    Please note the following limitations:

  • Neither album title, album artist, track title nor track artist may contain the backslash (\) character:

     \   backslash, reverse solidus   ASCII 092   &bsol;

    If any of them do, the play button for that specific track will not work, and your browser will most likely return an error message stating: "The page cannot be found ..... HTTP 404 - File not found.".

  • If you use a default character set other than Western European, you may encounter problems with some special characters. The script has not been tested extensively with other character sets.
    ( OCD: View | Preferences | Database | Languages)

  • The script will not work properly if your audio file collection is scattered all over your hard drive. Your audio file collection must reside in one main folder.

    In iTunes you should activate the 'Keep iTunes Music folder organized' option. (This option 'Places song files into album and artist folders, and names the files based on the disc number, and the song title.')
    ( iTunes: Edit | Preferences | Advanced).
    And then consolidate your collection by running Advanced | Consolidate Library….

  • The script is based on a single audio format collection. If your audio file collection contains a mix of formats (mp3, acc, wma, wav, ogg etc.) the script will only work for the one, single format you’ve specified in the template script variable trackExt.

  • A workaround would be to register the audio file format in an album or track related OCD field. At the album level it would probably be natural to choose the Format field (<--[Format]-->), or possibly one of the Custom fields <--[CustomX]-->. At the Track level however, there really is no relevant field available, so you would have to select one of the fields that you presently don’t use, like for instance the Soloist field. Then the correct extension for each track could be identified by using the <--[TrackSoloist]--> variable.

  • The script also relies on a consistent naming policy. It will not work properly if you’ve included track numbers in some file names but not in others.

  • In iTunes you should either activate or deactivate the 'Create filenames with track number' option for your entire collection.
    ( iTunes: Edit | Preferences | Importing).

  • And finally, the script will only work properly with an audio file collection that follows the iTunes naming convention:

    fqn = <DBdrive>:\<DBfolder>\<ArtistName>\<AlbumTitle> \ [[<VolNum>-] <TrackNum> ]<TrackTitle>.<TrackExt>

    See detailed documentation of the iTunes file naming convention.

Copyright © 2004 Juventas. All rights reserved.

6. Possible enhancements

    Here are some enhancements I may add in the future:

  • Support for other audio file naming conventions (MusicMatch etc.)


  • Enhanced browser and character set support


Copyright © 2004 Juventas. All rights reserved.

7. Disclaimer

    This modified template is free and comes with no warranties. Use it at your own risk!

CMI_PLAY.DAX has primarily been tested with Internet Explorer 6.x and IIS5.1 running on a Windows XP system. But it also seems to work fine with Netscape 7.x, Opera 7.x and Firefox 0.9.x.

If you are using IIS in combination with Firefox, Netscape or Opera, remember to enable Basic Authentication:

  • right-click My Computer    Manage | Services and Applications | Internet Information Services | Default Web Site

  • right-click your virtual directory (iTunesDB)    Properties | Directory Security | Edit

For more detailed information about IIS authentication methods:
Authentication and Security for Internet Developers
Authentication Methods in IIS, Part 2

Copyright © 2004 Juventas. All rights reserved.

 
 Script version 1.22 (2004-09-14)   Email: mail@juventas.net URL: http://ocd.juventas.net