Deutsch Deutscher Text befindet sich hier

Download Homepage (German text only)

MP3-Jukebox

Jukebox is a little jukebox for mp3-files. You need ncurses, the player mpg321 (mpg123 works also) and mp3info 0.2.4 by Thorvald Natvig (newer versions may not work, i don't know why) to create index-files from the tags of the mp3-files - of course you can write these index-files also with an editor.

To compile jukebox you have to type:

make

To install the files you have to type:

make install

This installs jukebox in /usr/local/bin (by default) and creates the folder /var/lib/jukebox for the index- and scale-file. This folder has rwx-permission for root (owner) and users (group) and rx-permission for others. You have to be root to do 'make install'. Of course its easy to edit the Makefile and change the locations and permissions of the files.

If you do not want to have global data-files you should type

make bininstall

Then you can start the jukebox. If you have your mp3-Files in /usr/mp3 you can do this by typing:

jukebox -i /usr/mp3

jukebox will invoke mp3info for each MP3-file in the given directoryto get the lenght, artist and title. If this fails the filename is used as title. If you use a sub-index file (specified by -x) lenght, artist and title-information are taken from it (for every mp3-filename that is found in it). But it is a better (faster) way to use an index-file. You can create it by typing

jukebox -i /usr/mp3 -o /var/lib/jukebox/index

If you specify a file by the i-option (instead of a directory) it is inter- preted as index-file. This index-file is only used if the first mp3-file exits (it is not used if e.g. the CD-Rom that containes the files that are stated in it is not mounted). To read the index-file every time you start the jukebox you have to put

i /var/lib/jukebox/index

into your /var/lib/jukebox/jukeboxrc (for all users) or ~/.jukebox/jukeboxrc. If you want to create a new index-file that does not use old data that is specified in a jukeboxrc-file you should type:

jukebox -I /usr/mp3 -o /var/lib/jukebox/index

If your mp3 files appear in different directories/mount points you can give them artists/titles via a sub-index-file:

jukebox -I /mnt/cd1 -i /mnt/cd2 -i /mnt/cd3 -x /var/lib/jukebox/sub.index

(Sorry, you can not create sub.index files automatically yet. You can find a format discription at the end of this page)

If some of your mp3-files are very loud and some are slight then you may want to use a scalefile (e.g. /var/lib/jukebox/scale).

You can set all parameters in the global (/var/lib/jukebox/jukeboxrc) or the local (~/.jukebox/jukeboxrc) configuration-file. Parameters are first taken from the global- then from the local-configuration-file and then from the command-line. If parameters are contradictory the last given one is valid.

Options: a param. optional parameter for player. The parameter is forwarded to your MP3-player. Useful parameters for mpg321 are:
-q suppresses nasty messages from the player
-b256    sets buffer size to 256 kB
see the documentation of your player for more information.
A param. same as -a, but do not use previosly given parameters. Useful if you want to disable/substitude parameters, that were given in the global or local configuration file. You can see what parameters are given when invoking jukebox with -v.
c on/off copy/do not copy files before playing (see -t also). Copies MP3-files to your temp-directory before playing if set (on). This could be useful with some CD-Rom-drives. This option is buggy, you have been warned.
If you think that this could be useful for you, then start the jukebox with this option, select some titles and start playing (and then do not touch anything until you want to quit). If this causes stalls at the beginning of titles try 'c wait' (first make sure that your temp-directory is on the fastest disk you have, see 't'-option too and you may want to increase the buffersize for your player).
If 'c on' or 'c wait' are working for you, please inform me and i will take hand on the code to make this option more flawless.
h displays help text and exits.
i file path and name of an index-file or a directory containing mp3-files. See the text above in this README-file. You can specify one index-file or directory by each i-option.
I file same as -i, but ignore paths and directories previously given -i and -I.
k keybar. Shows the function of the function keys in the bottom line.
o file create index-file and exit. See the text above in this README-file.
p player your favourite mp3-player. Mpg321 is recommended.
s file path and name of the scale-file. You can affect the sound intensity by specifiing values for MP3-files. These values are forwarded to the MP3-player by the -f option.
t path path for tempfiles.
T off/remain/elapsed do not/display remaining/display elapsed time of a running title
v print version and settings.
x file path and name of sub-index-file. See the text above in this README-file.
You can get help in the interactive part of jukebox by typing 'h' or <F1> (type it again for more information).
<F2> shows/hides keybar ( >= 67 columns required). You can see the function of the F-keys in the last line of the screen.
'J', <UP> moves cursor upwards. If you want to select or deselect a title (or whatever) you have to move the cursor on it. Does nothing if you are already at the first title.
'K', <DOWN> moves cursor downwards. If you want to select or deselect a title (or whatever) you have to move the cursor on it. Does nothing if you are already at the last title.
<SPACE> adds title to the end of the playlist.
'I', <INS> insert title in playlist. Inserts the title before the last selected one. The title becomes the first one if no other title is in the playlist. The title becomes the second one if the last selected is already playing.
'D', <DEL> delete title from playlist. Does nothing if the title is already playing or not in the playlist.
'A', <F3> adds all titles to playlist.
'Z', <F4> moves all titles from playlist.
'#', <F5> sets position for the title. You can enter a position for the title. The title becomes the last one if the entered number is bigger than the last one. The title becomes the second one if the entered title number is already playing.
'W', <F6> writes playlist to file. You can enter a filename to save the current playlist. If you just type enter the playlist is written to =list. '=' is a shortcut for your local jukebox- directory (usually ~/.jukebox). '~' is a shortcut for your home-directory. You can read saved playlists by typing 'E' or <F7>. =.auto will be read, started and deleted automagi- cally when you start jukebox for the next time.
'E', <F7> reads playlist from file. You can enter a filename to read a playlist. If you just type enter the playlist is taken from =list. '=' is a shortcut for your local jukebox-direc- tory (usually ~/.jukebox). '~' is a shortcut for your home- directory. If some titles are selected the playlist is added to the end. Titles that are already selected or in the current selection not available are ignored silently. You can save playlists by typing 'W' or <F6>.
'S', <F8> starts playing of the current playlist or stops it. If you stop a playlist the player receives a SIGTERM signal and terminates. If you start the list again the last title is played from the beginning.
'P', <F9> plays current playlist or pauses it. If you pause a playlist the player receives a SIGTSTP signal and stops execution. If you type 'P' or <F9> again the player receives a SIGCONT signal and continiues playing.
'R', <LEFT> rewinds the currently playing title to the beginning.
'F', <RIGHT> forewinds (skips) the currently playing title and starts the next one.
<TAB>, <F11> shows info for mp3-file under the cursor.
'T' toggels display of remaining, elapsed, no time
'/' searches forwards for a string that has to be entered in the last line. Does nothing if the string is not found. Type 'n' to find the next matching line.
'?' searches backwards for a string that has to be entered in the last line. Does nothing if the string is not found. Type 'n' to find the next matching line.
'N' searches forwards/backwards for next match. See '/' and '?'.
'Q', 'X', <F10> Quits jukebox.
Have a lot of fun!


index-file format description

There are 5 fields seperated by 'ˇ' (ASCII 183). Alternately TAB (ASCII 9) and LF (ASCII 10) are accepted as seperators. The fields are used for artist, title, lenght in minutes and seconds and the filename. All characters (except 'ˇ', TAB, LF and EOF) are accepted for the first, second and fith field. The other fields have to be numbers. MP3-files with '~' as artist are ignored.

artistˇtitleˇminutesˇsecondsˇ/path/filename

Example:
Hereos Del SilencioˇEntre Dos Tierrasˇ3ˇ33ˇ/cdrom/mp3/selencio.mp3


sub-index-file format description

The sub-index-file has the same format as the index-file except that you must not specify the path of the MP3-files.

artistˇtitleˇminutesˇsecondsˇfilename

Example:
Hereos Del SilencioˇEntre Dos Tierrasˇ3ˇ33ˇselencio.mp3


scale-file format description

There are 2 fields seperated by 'ˇ' (ASCII 183). Alternately TAB (ASCII 9) and LF (ASCII 10) are accepted as seperators. The first field is for the filename (with or without path) and the second for the scale-factor. This scale-factor is given to mpg321 with the '-f'-parameter.

filenameˇscale-factor

Example:
selencio.mp3ˇ32768