mad2pl:  Convert Madman database to mp3 playlists.
Kevin Wallace -- kev@carlea.com

I use this to export playlists from Madman since I find Madman to be incredibly
useful, but it simply has no 'Export playlists' function... this executable
overcomes this shortcoming.

mad2pl will scan through the .mad file and write out a single file for each 
playlist in the file.  Empty playlists are ignored.  Thus, it would be handy to
delete the old playlists before running mad2pl, in case a playlist is empty
and was not before.

NOTE:  mad2pl ignores recursive playlists.

This package is released open-source, under the GNU GPL.

BUILD AND INSTALLATION:
-----------------------
Pretty simple and straightforward for a Linux geek:

make
su
make install

USAGE:
------

mad2pl [-v] [*.mad file] [playlists directory]

 *.mad file:  The file opened by madman at startup which holds the mp3
               playlists you would like to export.

 playlists directory:  The directory into which to write the playlist files.


OPTIONS:
--------

 -v:  Enables verbose output.


EXAMPLE:
--------
My usage example:
mad2pl -v /mnt/data/mp3/kev.mad /home/kev/.ipod/playlists

Inputs the kev.mad file, outputs a file for every playlist into the 
~/.ipod/playlists directory.


REVISION HISTORY:
-----------------
Version 0.1:  Initial version.


BUG REPORTING:
--------------
If you find bugs, please send a capture of your terminal output in verbose mode,
and a copy of your .mad file.  I'll do what I can :).

Please send all bugs, suggestions, etc... to kev@carlea.com.


iPOD USAGE:
-----------
I use this executable as a bridge between madman and the SyncPOD script,
which synchronizes local files onto an iPod, via playlist files.  Sync-mode
3 seems to work the best for me.

You can find the SyncPOD script at:
http://armin.emx.at/ipod/
or do a freshmeat.net search.

An excerpt from ~/.ipod/config (which SyncPOD uses to retrieve settings):
+-------------------------------------------------------------------------------
|# SYNCMODE: mode to sync ipod with
|#
|# 1: just use IPODs directory (untested)
|# 2: sync local drirectory with ipod
|# 3: just use playlists for syncing
|
|SYNCMODE = 3
|
|# SYNCDIR: directory to sync with ipod
|#
|# needed in SYNCMODE 2
|
|#SYNCDIR = "/mnt/data/mp3/ipod"
|
|# SYNCLIST: playlist with ALL songs to sync with ipod
|#
|# optional in SYNCMODE 2
|
|#SYNCLIST = "~/.ipod/ALLSONGS"
|
|# PLAYLISTDIR
|#
|# directory of further ipod playlists (all files will be treated
|# as playlists)
|
|PLAYLISTDIR = "~/.ipod/playlists"
+-------------------------------------------------------------------------------

Now that SyncPOD is set up, I sync my ipod with the following commands
(run as root):

# Load the firewire module.
modprobe sbp2
# Replace /mnt/ipod with your mount directory.
mount /mnt/ipod
# Clean out the old playlists.
rm -f ~/.ipod/playlists/*
# Make the new playlists.
mad2pl -v /mnt/data/mp3/mad.kev ~/.ipod/playlists
# Sync.
SyncPOD
# Unmount the ipod.
umount /mnt/ipod
# Remove the firewire module (then the iPod will say 'Ok to disconnect').
modprobe -r sbp2


