NAME

riofill - make a random playlist from a directory of MP3 files that will fit into a Rio's memory. Optionally upload it to a Rio using SBA's rio utility.


SYNOPSIS

riofill-o -v ] [ -f filename  ] [ -d MP3dir  ] [ -r riopath  ] [ -x [ MB ] ] 


DESCRIPTION

The riofill utility randomly selects a list of MP3 files from a given directory. The utility ensures that the files selected will all fit into the memory of a Diamond Rio portable MP3 player. Switches allow different sized Rio memory to be filled. By default, riofill uploads the playlist produced to a Rio player connected to the computer's parallel port using the Snowblind Alliance (SBA) rio utility. Optionally, the generated playlist may be printed to stdout or saved in a file instead of being uploaded to the Rio.


Switches

This script uses Getopt::Long for argument parsing. This means that switches that take an option must have a space or an equals sign between the switch and its value. For example, -F=bar or -F bar would work while -Fbar would not.

The following switches are supported:

-b MB

indicates that riofill should attempt to load MB megabytes worth of MP3 files into the RIO's base memory If this switch is given it must be followed by an integer number which riofill will use as the number of megabytes (MB) of base memory. If this switch is not given, riofill will assume the Rio has 32MB of base memory. The actual value used by riofill is the given or default value minus 0.5. This is because exactly 32MB will not fit in a PMP300's 32MB base memory.

See -o switch below for how the -b and -x switches are treated when you are not uploading to a Rio.

-d MP3dir

specifies the directory in which to look for MP3 files. If -d is not given riofill looks for MP3 files in the current directory. riofill searches this directory and any subdirectories.

-f filename

specifies a file to which the playlist should be saved. This switch is ignored if -o is not given. If -o is given and -f is either not given or equal to ``-'' riofill prints the playlist to the standard output.

-o

specifies that riofill should output the playlist rather than uploading it to the Rio. if no -f switch is given, the playlist is printed to the standard output. If -o is not given, riofill attempts to upload the generated playlist to a Diamond Rio connected to the computer's parallel port. If the -b and/or -x switches are given in combination with the -o switch, riofill adds their given or default values together to come up with the total size of the playlist. See the EXAMPLES section for a case in point.

-r riopath

specifies where the Snowblind Alliance's rio utility is located. If -r is not given, riofill looks for this utility in /usr/local/bin. If riofill is asked to upload a playlist to the Rio, this path is checked to ensure the rio utility is present and executable. If it isn't, riofill exits with an error message.

-v

tells riofill to be verbose in its actions. If this switch is given, riofill will say what it is doing and print the output of the rio utility to standard output.

-x [ MB ]

indicates that riofill should attempt to load MP3 files into extended memory in the Rio. Rio memory in add-on flash RAM cards is considered extended memory. If this switch is given with no argument, riofill will assume the Rio has 32MB of extended memory. If an argument is given, riofill will use it as the number of megabytes (MB) of extended memory. The actual value used by riofill is the given value minus 0.5. This is because exactly 32MB will not fit in a PMP300's 32MB base memory. The author assumes this restriction applies to extended memory as well.


EXAMPLES

Search the current directory for MP3 files. Randomly select 32MB worth of these files. Upload them to the Rio:

riofill

Search /usr/home/hbo/lo-fi for MP3 files. Randomly select 64MB worth of these files. Upload 32MB to the Rio's base memory and 32MB to the Rio's extended memory using the rio utility in /bin:

riofill -d /usr/home/hbo/lo-fi -r /bin/rio -x

Search /usr/home/hbo/lo-fi for MP3 files. Randomly select 32MB worth of these files. Print the names of these files on the screen:

riofill -o -d /usr/home/hbo/lo-fi

Same as above:

riofill -o -f - -d /usr/home/hbo/lo-fi

Search /usr/home/hbo/lo-fi for MP3 files. Randomly select 32MB worth of these files. Print the names of these files to the file /usr/home/hbo/playlists/mylist:

riofill -o -d /usr/home/hbo/lo-fi -f /home/mp3/playlists/mylist

Same as above:

riofill -o -d /usr/home/hbo/lo-fi >/home/mp3/playlists/mylist

Generate a playlist of MP3s whose total size does not exceed 88MB:

riofill  -o -b 24 -x 64


LICENSE

riolist is GPL. riofill is either GPL or Artistic.


AUTHOR

Based on Ron Forrester's <rjf@zero-ping.com> riolist. His code was hacked upon mercilessly by Howard (that's what I do for fun) Owen <hbo@egbok.com> to produce riofill


SEE ALSO

riolist source, rio(1)


PREREQUISITES

This script uses the rio utility to upload data to the Rio. You can get this utility from the Snowblind Alliance at http://www.world.co.uk/sba/ This script also makes use of the Getopt::Long module which is included in the Perl distribution.


SCRIPT CATEGORIES

Audio/MP3


README

Randomly selects a playlist of MP3 files from a given directory and either uploads them to a connected Rio MP3 player or prints the playlist.