Commit d35747a4 authored by Warren Dukes's avatar Warren Dukes

import from SF CVS

git-svn-id: https://svn.musicpd.org/mpd/trunk@1 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parents
Developer -> Warren Dukes <shank@mercury.chem.pitt.edu>
Developer -> tw-nym
wave File Support -> normalperson
setuid patch -> Nagilum
'next' and 'previous' patch -> Niklas Hofer
This diff is collapsed. Click to expand it.
ver 0.9.4 (2004/1/21)
1) Fix a bug where updated tag info wasn't being detected
2) Set the default audio write size to 1024 bytes (should decrease cpu load a bit on some machines).
3) Make audio write size configurable via "audio_write_size" config option
4) Tweak output buffer size for connections by detecting the kernel output buffer size.
ver 0.9.3 (2003/10/31)
1) Store total time/length of songs in db and display in *info commands
2) Display instantaneous bitrate in status command
3) Add Wave Support using libaudiofile (Patch from normalperson)
4) Command code cleanup (Patch from tw-nym)
5) Optimize listing of playlists (10-100x faster)
6) Optimize interface output (write in 4kB chunks instead of on every '\n')
7) Fix bug that prevented rm command from working
8) Fix bug where deleting current song skips the next song
9) Use iconv to convert vorbis comments from UTF-8 to Latin1
ver 0.9.2 (2003/10/6)
1) Fix FreeBSD Compilation Problems
2) Fix bug in move command
3) Add mixer_control options to configure which mixer control/device mpd controls
4) Randomize on play -1
5) Fix a bug in toggling repeat off and at the end of the playlist
ver 0.9.1 (2003/9/30)
1) Fix a statement in the middle of declarations in listen.c, causes error for
gcc 2.7
ver 0.9.0 (2003/9/30)
1) Random play mode
2) Alsa Mixer Support
3) Save and Restore "state"
4) Default config file locations (.mpdconf and /etc/mpd.conf)
5) Make db file locations configurable
6) Move songs around in the playlist
7) Gapless playback
8) Use Xing tags for mp3's
9) Remove stop_on_error
10) Seeking support
11) Playlists can be loaded and deleted from subdirectories
12) Complete rewrite of player layer (fork()'s only once, opens and closes
audio device as needed).
13) Eliminate use and dependence of SIGIO
14) IPv6 support
15) Solaris compilations fixes
16) Support for different log levels
17) Timestamps for log entries
18) "user" config parameter for setuid (patch from Nagilum)
19) Other misc features and bug fixes
ver 0.8.7 (2003/9/3)
1) Fix a memory leak. When closing a interface, was called close() on the fd
instead of calling fclose() on the fp that was opened with fdopen().
ver 0.8.6 (2003/8/25)
1) Fix a memory leak when a buffered existed, and a connection was unexpectedly closed, and i wasn't free'ing the buffer apropriatly.
ver 0.8.5 (2003/8/17)
1) Fix a bug where an extra end of line is returned when attempting to play a
non existing file. This causes parsing errors for clients.
ver 0.8.4 (2003/8/13)
1) Fix a bug where garbage is returned with errors in "list" command
ver 0.8.3 (2003/8/12)
1) Fix a compilation error on older linux systems
2) Fix a bug in searching by title
3) Add "list" command
4) Add config options for specifying libao driver/plugin and options
5) Add config option to specify which address to bind to
6) Add support for loading and saving absolute pathnames in saved playlists
7) Playlist no longer creates duplicate entries for song data (more me
efficient)
8) Songs deleted from the db are now removed for the playlist as well
ver 0.8.2 (2003/7/22)
1) Increased the connection que for listen() from 0 to 5
2) Cleanup configure makefiles so that mpd uses MPD_LIBS and MPD_CFLAGS
rather than LIBS and CFLAGS
3) Put a cap on the number of commands per command list
4) Put a cap on the maximum number of buffered output lines
5) Get rid of TIME_WAIT/EADDRINUSE socket problem
6) Use asynchronious IO (i.e. trigger SIGIO instead so we can sleep in
select() calls longer)
ver 0.8.1 (2003/7/11)
1) FreeBSD fixes
2) Fix for rare segfault when updating
3) Fix bug where client was being hungup on when done playing current song
4) Fix bug when playing flac's where it incorrectly reports an error
5) Make stop playlist on error configurable
6) Configure checks for installed libmad and libid3tag and uses those if found
7) Use buffer->finished in *_decode's instead of depending on catching signals
ver 0.8.0 (2003/7/6)
1) Flac support
2) Make playlist max length configurable
3) New backward compatible status (backward compatible for 0.8.0 on)
4) listall command now can take a directory as an argument
5) Buffer rewritten to use shared memory instead of sockets
6) Playlist adding done using db
7) Add sort to list, and use binary search for finding
8) New "stats" command
9) Command list (for faster adding of large batches of files)
10) Add buffered chunks before play
11) Useful error reporting to clients (part of status command)
12) Use libid3tag for reading id3 tags (more stable)
13) Non-blocking output to clients
14) Fix bug when removing items from directory
15) Fix bug when playing mono mp3's
16) Fix bug when attempting to delete files when using samba
17) Lots of other bug fixes I can't remember
ver 0.7.0 (2003/6/20)
1) use mad instead of mpg123 for mp3 decoding
2) volume support
3) repeate playlist support
4) use autoconf/automake (i.e. "configure")
5) configurable max connections
ver 0.6.2 (2003/6/11)
1) Buffer support for ogg
2) new config file options: "connection_timeout" and "mpg123_ignore_junk"
3) new commands: "next", "previous", and "listall"
Thanks to Niklas Hofer for "next" and "previous" patches!
4) Search by filename
5) bug fix for pause when playing mp3's
ver 0.6.1 (2003/5/29)
1) Add conf file support
2) Fix a bug when doing mp3stop (do wait3(NULL,WNOHANG|WUNTRACED,NULL))
3) Fix a bug when fork'ing, fflush file buffers before forking so the
child doesn't print the same stuff in the buffer.
ver 0.6.0 (2003/5/25)
1) Add ogg vorbis support
2) Fix two bugs relating to tables, one for search by title, and one where we
freed the tables before directories, causing a segfault
3) The info command has been removed.
ver 0.5.0-0.5.2
Initial release(s). Support for MP3 via mpg123
Music Player Daemon (MPD) - INSTALL
Requirements
------------
libao - http://www.vorbis.com/download_unix.psp
(This comes with most/all distributions. Make sure you have both
the ao libs and development packages for your distribution installed.
For Red Hat 8.0, the necessary packages are: libao and libao-devel)
zlib - http://www.gzip.org/zlib
(This comes with all distributions. Make sure you have bot the zlib libs
and development packages for your distribution installed. For Red hat,
the necessary packages are: zlib and zlib-devel)
Optional
--------
Ogg Vorbis - http://www.xiph.org/ogg/vorbis/
(This comes with most/all distributions. Make sure you have both the
ogg and vorbis libs as well as the development packages for your
distribution installed. For Red Hat 8.0, the necessary packages are:
libogg, libogg-devel, libvorbis, and libvorbis-devel).
Flac - http://flac.sf.net
For Flac support, you need Flac 1.1.0 or greater.
Download
--------
Get the latest release from of MPD from http://www.musicpd.org
Compile
-------
1) unzip and untar the archive
$ tar zxvf mpd-x.x.x.tar.gz
2) change to directory created
$ cd mpd-x.x.x
3) Run configure script (this will determine what dependencies you have)
$ ./configure
4) Compile
$ make
Install (Optional)
-------
(as root)
$ make install
Run
---
1) run mpd:
<port>: port number daemon listens on (if running as a user, this should be
greater than 1024)
<mp3 directory>: directory containing mp3's
<playlist directory>: directory where playlists will be stored (and .mpddb will
be placed)
<mpd log>: log file for mpd
<mpd err>: error log file for mpd
$ mpd <port> <mp3 directory> <playlist directory> <mpd log> <mpd err>
example where mpd executable is in mpd-x.x.x directory:
$ mpd-x.x.x/mpd 2100 mp3 playlists mpd.log mpd.err
Note: The first time you run mpd, it will "explore" your mp3 directory for
mp3's.
Also, mpd can alternatively use config file. In this case,
run mpd like this:
$ mpd <config file>
(if no config file is specified, mpd's looks for ~/.mpdconf then /etc/mpd.conf)
an example would be:
$ mpd playlists/.mpdconf
A sample config file is included with the source of MPD, mpdconf.example .
Using MPD
---------
You can download a web interface (phpMp) to MPD at
http://www.musicpd.org .
Also, several other clients can be found for MPD at http://www.musicpd.org .
MPD can be interfaced directly using telnet (see COMMANDS, if you are brave).
SUBDIRS = src doc
docdir = $(prefix)/share/doc/$(PACKAGE)
doc_DATA = README UPGRADING
EXTRA_DIST = COPYING $(doc_DATA)
Music Player Daemon (MPD)
http://www.musicpd.org
A daemon for playing music (mp3, ogg vorbis, and flac). Music is played
through the server's audio device. The daemon stores info about all available
music, and this info can be easily searched and retrieved. Player control, info
retrieval, and playlist management can all be managed remotely.
To install MPD, see INSTALL.
MPD includes 2 libraries in the source. libid3tag and libmad are released under
the GPL and copyrighted by Robert Leslie (http://www.underbit.com/products/mad).
MPD is released under the GNU Public License.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For the full license, see COPYING.
1) 24-bit pcm-tools (this may just wait since almost no one uses it)
2) put software mixer settings in state file
3) finish modifying man page, commands, and example config file
Music Player Daemon (MPD) - UPGRADING
Upgrading to 0.9.3
------------------
Wave support was added, so to have your wave files added, update the db (mpc
update).
Also, song lengths are now stored in the db. To get this stuff
added to the db, you will need to recreate the db from scratch. To do this,
run mpd with the "--create-db" commandline option.
Upgrading to 0.9.0
------------------
The "stop_on_error" config parameter was removed, so be sure to remove this
parameter from your config file.
Upgrading to 0.8.x
------------------
If you have FLACs, then to have them added to your list of available music,
just use "update".
Upgrading from 0.5.x to 0.6.x
-----------------------------
If you have not compiled MPD with "make ogg", then nothing is needed.
If you compiled with "make ogg", just use "update" (available via the phpMp
interface) to add your OGGs to MPD's list of available music.
#!/bin/sh
#
echo "Generating build information using aclocal, automake and autoconf"
echo "This may take a while ..."
# Touch the timestamps on all the files since CVS messes them up
#touch Makefile.am configure.in
#touch libid3tag/Makefile.am libid3tag/configure.ac
#touch libmad/Makefile.am libmad/configure.ac
#rm -f configure
#rm -f libid3tag/configure
#rm -f libmad/configure
#rm -f config.cache
#rm -f config.status
#rm -f libid3tag/config.status
#rm -f libmad/config.status
#rm -rf autom4te*.cache
#rm -rf libid3tag/autom4te*.cache
#rm -rf libmad/autom4te*.cache
#rm -f aclocal.m4
#rm -f libid3tag/aclocal.m4
#rm -f libmad/aclocal.m4
# Regenerate configuration files
libtoolize -f -c
for i in -1.8 -1.7 -1.6 ''; do
if [ -z $ACLOCAL ]; then
which aclocal$i
if [ "$?" = "0" ]; then
ACLOCAL=aclocal$i
fi
fi
if [ -z $AUTOMAKE ]; then
which automake$i
if [ "$?" = "0" ]; then
AUTOMAKE=automake$i
fi
fi
done
if [ -d /usr/local/share/aclocal ]; then
$ACLOCAL -I /usr/local/share/aclocal
else
$ACLOCAL
fi
$AUTOMAKE --foreign --add-missing -c
autoconf
cd src/libid3tag
$ACLOCAL
$AUTOMAKE --foreign --add-missing -c
autoconf
cd ../..
cd src/libmad
$ACLOCAL
$AUTOMAKE --foreign --add-missing -c
autoconf
cd ../..
# Run configure for this platform
./configure $*
AC_INIT(src/main.c)
AM_INIT_AUTOMAKE(mpd, 0.10.0)
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LIBTOOL
dnl MAD wants this stuff
AC_SUBST(CCAS)
AC_SUBST(CCASFLAGS)
AC_SUBST(MAD_SUBDIR)
AC_SUBST(MAD_LIB)
AC_SUBST(ID3_SUBDIR)
AC_SUBST(ID3_LIB)
AC_SUBST(MPD_LIBS)
AC_SUBST(MPD_CFLAGS)
MPD_CFLAGS="-Wall"
MPD_LIBS=""
AC_ARG_ENABLE(iconv,[ --disable-iconv disable iconv support],,enable_iconv=yes)
AC_ARG_ENABLE(ipv6,[ --disable-ipv6 disable IPv6 support],,enable_ipv6=yes)
AC_ARG_ENABLE(ogg,[ --disable-ogg disable ogg support],,enable_ogg=yes)
AC_ARG_ENABLE(flac,[ --disable-flac disable flac support],,enable_flac=yes)
AC_ARG_ENABLE(mp3,[ --disable-mp3 disable mp3 support],,enable_mp3=yes)
AC_ARG_ENABLE(audiofile,[ --disable-audiofile disable audiofile support, disables wave support],,enable_audiofile=yes)
AC_ARG_ENABLE(mpd_mad,[ --enable-mpd-mad use mpd libmad],use_mpd_mad=yes,)
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support],,enable_id3=yes)
AC_ARG_ENABLE(mpd_id3tag,[ --enable-mpd-id3tag use mpd libid3tag],use_mpd_id3tag=yes,)
AC_ARG_WITH(id3tag,[ --with-id3tag=PFX Prefix where libid3tag is installed (optional)], id3tag_prefix="$withval", id3tag_prefix="")
AC_ARG_WITH(id3tag-libraries,[ --with-id3tag-libraries=DIR Directory where libid3tag library is installed (optional)], id3tag_libraries="$withval", id3tag_libraries="")
AC_ARG_WITH(id3tag-includes,[ --with-id3tag-includes=DIR Directory where libid3tag header files are installed (optional)], id3tag_includes="$withval", id3tag_includes="")
AC_ARG_WITH(mad,[ --with-mad=PFX Prefix where libmad is installed (optional)], mad_prefix="$withval", mad_prefix="")
AC_ARG_WITH(mad-libraries,[ --with-mad-libraries=DIR Directory where libmad library is installed (optional)], mad_libraries="$withval", mad_libraries="")
AC_ARG_WITH(mad-includes,[ --with-mad-includes=DIR Directory where mad header files are installed (optional)], mad_includes="$withval", mad_includes="")
AC_C_BIGENDIAN
AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)
AC_CHECK_LIB(socket,socket,MPD_LIBS="$MPD_LIBS -lsocket",)
AC_CHECK_LIB(nsl,gethostbyname,MPD_LIBS="$MPD_LIBS -lnsl",)
AC_CHECK_HEADER(langinfo.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LANGINFO",)
AC_CHECK_HEADER(locale.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_LOCALE",)
if test x$enable_iconv = xyes; then
AC_CHECK_HEADER(iconv.h,MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ICONV",enable_iconv=no)
if test x$enable_iconv = xyes; then
AC_CHECK_LIB(iconv,iconv,MPD_LIBS="$MPD_LIBS -liconv",)
fi
fi
if test x$enable_ipv6 = xyes; then
AC_MSG_CHECKING(for ipv6)
AC_EGREP_CPP([AP_maGiC_VALUE],
[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#ifdef PF_INET6
#ifdef AF_INET6
AP_maGiC_VALUE
#endif
#endif
],
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_IPV6"
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
fi
XIPH_PATH_AO(MPD_LIBS="$MPD_LIBS $AO_LIBS" MPD_CFLAGS="$MPD_CFLAGS $AO_CFLAGS",AC_MSG_ERROR(Must have libao installed!!!))
AC_CHECK_HEADER(sys/soundcard.h,,[MPD_CFLAGS="$MPD_CFLAGS -DNO_OSS_MIXER";AC_MSG_WARN(Soundcard headers not found -- disabling mixer)])
AC_MSG_CHECKING(for alsa)
AC_EGREP_CPP([AP_maGiC_VALUE],
[
#include <alsa/asoundlib.h>
#if defined(SND_LIB_MAJOR) && defined(SND_LIB_MINOR)
#if SND_LIB_MAJOR>0 || (SND_LIB_MAJOR==0 && SND_LIB_MINOR>=6)
AP_maGiC_VALUE
#endif
#endif
],
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ALSA"
MPD_LIBS="$MPD_LIBS -lasound"
AC_MSG_RESULT([yes]),
AC_MSG_RESULT([no])
)
ID3_SUBDIR=""
if test x$enable_id3 = xyes; then
if test x$use_mpd_id3tag = xyes; then
ID3_SUBDIR="libid3tag"
else
if test "x$id3tag_libraries" != "x" ; then
ID3TAG_LIBS="-L$id3tag_libraries"
elif test "x$id3tag_prefix" != "x" ; then
ID3TAG_LIBS="-L$id3tag_prefix/lib"
elif test "x$prefix" != "xNONE"; then
ID3TAG_LIBS="-L$libdir"
fi
ID3TAG_LIBS="$ID3TAG_LIBS -lid3tag -lz"
if test "x$id3tag_includes" != "x" ; then
ID3TAG_CFLAGS="-I$id3tag_includes"
elif test "x$id3tag_prefix" != "x" ; then
ID3TAG_CFLAGS="-I$id3tag_prefix/lib"
elif test "x$prefix" != "xNONE"; then
ID3TAG_CFLAGS="-I$libdir"
fi
ID3TAG_CFLAGS="$ID3TAG_CFLAGS"
oldcflags=$CFLAGS
CFLAGS="$CFLAGS $ID3TAG_CFLAGS $ID3TAG_LIBS"
AC_CHECK_LIB(id3tag,id3_file_open,[ID3_LIB="$ID3TAG_LIBS";
MPD_CFLAGS="$MPD_CFLAGS $ID3TAG_CFLAGS";
use_libid3tag=yes],
[use_libid3tag=no;use_mpd_id3tag=yes])
CFLAGS=$oldcflags
fi
if test x$use_mpd_id3tag = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_ID3TAG"
ID3_LIB="libid3tag/libid3tag.la"
ID3_SUBDIR="libid3tag"
AC_CONFIG_SUBDIRS(src/libid3tag)
fi
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_ID3TAG"
fi
MAD_SUBDIR=""
if test x$enable_mp3 = xyes; then
if test x$use_mpd_mad = xyes; then
MAD_SUBDIR="libmad"
else
if test "x$mad_libraries" != "x" ; then
MAD_LIBS="-L$mad_libraries"
elif test "x$mad_prefix" != "x" ; then
MAD_LIBS="-L$mad_prefix/lib"
elif test "x$prefix" != "xNONE"; then
MAD_LIBS="-L$libdir"
fi
MAD_LIBS="$MAD_LIBS -lmad"
if test "x$mad_includes" != "x" ; then
MAD_CFLAGS="-I$mad_includes"
elif test "x$mad_prefix" != "x" ; then
MAD_CFLAGS="-I$mad_prefix/lib"
elif test "x$prefix" != "xNONE"; then
MAD_CFLAGS="-I$libdir"
fi
AC_CHECK_LIB(mad,mad_stream_init,[MAD_LIB="$MAD_LIBS";
MPD_CFLAGS="$MPD_CFLAGS $MAD_CFLAGS";use_libmad=yes],
[use_libmad=no;use_mpd_mad=yes])
fi
if test x$use_mpd_mad = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DUSE_MPD_MAD"
MAD_LIB="libmad/libmad.la"
MAD_SUBDIR="libmad"
AC_CONFIG_SUBDIRS(src/libmad)
fi
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_MAD"
fi
if test x$enable_ogg = xyes; then
XIPH_PATH_OGG(MPD_LIBS="$MPD_LIBS $OGG_LIBS" MPD_CFLAGS="$MPD_CFLAGS $OGG_CFLAGS",enable_ogg=no)
fi
if test x$enable_ogg = xyes; then
enable_vorbistest=no
XIPH_PATH_VORBIS(,enable_ogg=no)
if test x$enable_ogg = xyes; then
dnl
dnl Vorbis Test
dnl vorbistest in XIPH_PATH_OGG is broken on my debian system
dnl so here i used my own hacked up version till i get vorbis-dev gets
dnl upgraded in debian (hopefully when 1.0.1 comes out)
dnl
AC_MSG_CHECKING(that Vorbis is usable)
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
int main ()
{
vorbis_block vb;
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_info_init (&vi);
vorbis_encode_init (&vi, 2, 44100, -1, 128, -1);
/*vorbis_analysis_init (&vd, &vi);
vorbis_block_init (&vd, &vb);*/
/* this function was added in 1.0rc3, so this is what we're testing for */
/*vorbis_bitrate_addblock (&vb);*/
return 0;
}
], AC_MSG_RESULT(yes), AC_MSG_RESULT(no) enable_ogg=no,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
dnl
dnl End of Vorbis Test
dnl
if test x$enable_ogg = xyes; then
MPD_LIBS="$MPD_LIBS $VORBIS_LIBS $VORBISFILE_LIBS"
MPD_CFLAGS="$MPD_CFLAGS $VORBIS_CFLAGS $VORBISFILE_CFLAGS"
fi
fi
if test x$enable_ogg = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_OGG"
fi
if test x$enable_flac = xyes; then
oldmpdcflags="$MPD_CFLAGS"
oldmpdlibs="$MPD_LIBS"
AM_PATH_LIBFLAC(MPD_LIBS="$MPD_LIBS $LIBFLAC_LIBS" MPD_CFLAGS="$MPD_CFLAGS $LIBFLAC_CFLAGS",enable_flac=no)
fi
if test x$enable_flac = xyes; then
oldcflags="$CFLAGS"
oldlibs="$LIBS"
CFLAGS="$CFLAGS $MPD_CFLAGS"
LIBS="$LIBS $MPD_LIBS"
AC_CHECK_LIB(FLAC, FLAC__metadata_object_vorbiscomment_find_entry_from,
,[enable_flac=no;AC_MSG_WARN(You need FLAC 1.1 -- disabling flac support)])
if test x$enable_flac = xno; then
MPD_CFLAGS="$oldmpdcflags"
MPD_LIBS="$oldmpdlibs"
fi
CFLAGS="$oldcflags"
LIBS="$oldlibs"
fi
if test x$enable_flac = xyes; then
MPD_CFLAGS="$MPD_CFLAGS -DHAVE_FLAC"
fi
if test x$enable_audiofile = xyes; then
AM_PATH_AUDIOFILE(0.1.7, MPD_LIBS="$MPD_LIBS -laudiofile" MPD_CFLAGS="$MPD_CFLAGS -DHAVE_AUDIOFILE",
[enable_audiofile=no;AC_MSG_WARN(You need audiofile -- disabling audiofile support)])
fi
AC_OUTPUT(doc/Makefile src/Makefile Makefile )
Music Player Daemon - Commands
This document is intended for client developers, not end users.
Format:
-------
If arguments contain spaces, they should be surrounded by double quotation
marks, ".
command <type arg1> <type arg2> ...
explanation: w/ arg1 and arg2
Command Completion:
-------------------
A command returns "OK\n" on completion or "ACK some error\n" on failure.
These denote the end of command execution.
Commands:
---------
add <string file>
add the file _file_ to the playlist
clear
clears the current playlist
clearerror
clear the current error message in status
(this is also accomplished by any command that starts playback)
close
close the connection with the MPD
delete <int song>
delete _song_ from playlist
find <string type> <string what>
finds songs in the db that are exactly _what_
_type_ should be "album", "artist", or "title"
_what_ is what to find
kill
kill MPD
list <string type> <string arg1>
list all tags of _type_
_type_ should be "album" or "artist"
_arg1_ is an optional parameter when type is album, this specifies
to list albums by a artist, where artist is specified with
arg1
listall <string directory>
lists all songs and directories in _directory_ (recursively)
_directory_ is optional
load <string name>
loads the playlist _name_.m3u from the playlist directory
ls <string directory>
list files in _directory_. _directory_ is optional.
NOTE: us this only for debugging, not meant to be used by a client.
instead use 'lsinfo'
lsinfo <string directory>
list contents of _directory_, from the db. _directory_ is optional
move <int from> <int to>
move song at _from_ to _to_ in the playlist
next
plays next song in playlist
pause
pause/resume playing
play <int song>
begin playing playlist at song number _song_, _song_ is optional
playlist
displays the current playlist
NOTE: do not use this, instead use 'playlistinfo'
playlistinfo
displays information about the current playlist
previous
plays previous song in playlist
random <int state>
set random state to _state_, _state_ should be 0 or 1
repeat <int state>
set repeat state to _state_, _state_ should be 0 or 1
rm <string name>
removes the playlist <name>.m3u from the playlist directory
save <string name>
saves the current playlist to _name_.m3u in the playlist directory
search <string type> <string what>
same as "find" but searches for any song that contain _what_
search is not case sensitive
seek <int song> <int time>
seeks to the position _time_ (in seconds) of entry _song_ in the
playlist
shuffle
shuffles the current playlist
stats
display stats
artists: number of artists
albums: number of albums
songs: number of songs
uptime: daemon uptime in seconds
db_update: last db update in UNIX time
playtime: time length of music played
songs_played: total number of songs played
status
reports current status of player, and volume level.
volume: (0-100).
repeat: (0 or 1)
playlist: (31-bit unsigned integer, the playlist version number)
playlistlength: (integer, the length of the playlist)
state: ("play", "stop", or "pause")
song: (current song playing/paused, playlist song number)
time: <int elapsed>:<time total> (of current playing/paused song)
bitrate: <int bitrate> (instantaneous bitrate in kbps)
error: if there is an error, returns message here
stop
stop playing
swap <int song1> <int song2>
swap positions of _song1_ and _song2_
update
searches mp3 directory for new music and removes old music from the db
volume <int change>
change volume by amount _change_
COMMAND LIST
------------
To facilitate faster adding of files, etc, you can pass a list of commands all
at once using a command list. The command list beings with:
command_list_begin
And ends with:
command_list_end
It does not execute any commands until the list has ended. The return
value is whatever the return for a list of commands is. On success
for all commands, OK is returned. If a command fails, no more commands
are executed and the appropriate ACK error is returned.
man_MANS = mpd.1
docdir = $(prefix)/share/doc/$(PACKAGE)
doc_DATA = COMMANDS
EXTRA_DIST = mpdconf.example $(man_MANS) $(doc_DATA)
.TH "Music Player Daemon" 1
.SH NAME
MPD \- A daemon for playing music (mp3, ogg vorbis, and flac)
.SH SYNOPSIS
.B mpd
.RI [ options ]
.RI [ CONF_FILE ]
.br
.B mpd
.RI [ options ]
.I PORT MUSIC_DIR PLAYLIST_DIR LOG_FILE ERROR_FILE
.br
.SH DESCRIPTION
MPD is a daemon for playing music (mp3, ogg vorbis, and flac). Music is played
through the server's audio device. The daemon stores info about all available
music, and this info can be easily searched and retrieved. Player control, info
retrieval, and playlist management can all be managed remotely.
MPD searches for a config file in ~/.mpdconf then /etc/mpd.conf or uses
CONF_FILE. Instead of using a config file, the minimal configuration paramters
can be specified on the command line: PORT, MUSIC_DIR, PLAYLIST_DIR, LOG_FILE,
and ERROR_FILE.
Read more about MPD on http://www.musicpd.org
.SH OPTIONS
.TP
.B --create-db
(Re)Crete the db file for mpd.
.TP
.BI --help
Output a brief help message.
.br
.TP
.BI --no-daemon
Don't detach from console or redirect output to log files.
.TP
.BI --verbose
Output verbose amounts of information to the logs
.TP
.BI --version
Print version information.
.SH PARAMETERS
Below are a list of parameters that can be specified in the config file. Each line in the config file should be of the form:
.br
parameter "value"
.TP
.B port <port>
This specifies the port that MPD listens on. This parameter is required. This is typically 2100.
.TP
.B music_directory <directory>
This specifies the directory where music is located. This parameter is required. The directory path should be an absolute path.
.TP
.B playlist_directory <directory>
This specifies the directory where saved playlists are stored. This parameter is required. The directory path should be an absolute path.
.TP
.B log_file <file>
This specifies where the log file should be located. This parameter is required. The file path should be an absolute path.
.TP
.B error_file <file>
This specifies where the error file should be located. This parameter is required. The file path should be an absolute path.
.TP
.B log_level <default, secure, or verbose>
This specifies how verbose logs are. "default" is minimal logging, "secure" reports from what address a connection is opened, and when it is closed, and "verbose" records excessive amounts of information for debugging purposes. The default is "default".
.TP
.B db_file <file>
This specifies where the db file will be stored. The file path should be an
absolute path. The default is ".mpddb" in the playlist directory.
.TP
.B filesystem_charset <charset>
This specifies the character set used for the filesystem. A list of supported
character sets can be obtained by running "iconv -l". The default is
determined from the locale when the db was originally created.
.TP
.B bind_to_address <ip address or hostname or any>
This specifies which address MPD binds to and listens on. The default is "any",
which binds to all available addresses.
.TP
.B user <user>
This specifies the user that mpd will run as, if set.
.TP
.B password <password@permissions>
This specifies a password for access to mpd. The format is
"password@permissions" where permissions is a comma delimmitted list composed
of "read","add","control", and/or "admin". "read" allows for reading of
the database, displaying the current playlist, and current status of mpd.
"add" allows for adding songs and loading playlists. "control" allows
for all other player and playlist manipulations. "admin" allows the db
to be updated and for the client to kill mpd. More than one password can
be specified. An example of a password is "somePassword@read,add".
.TP
.B default_permissions <permissions>
This specifies the permissions of a client that has not been authenticated using
a password. The format of permissions is specified n the description of the
"password" config paramter. If not passwords are specified, the default is
"read,add,control,admin", otherwise it is "" (no permissions).
.TP
.B state_file <file>
This specifies if a state file is used and where it is located. The file path should be an absolute path. The state of mpd will be saved to this file when mpd is terminated by a TERM signal or by the "kill" command.
.TP
.B connection_timeout <seconds>
If a client does not send any new data in this time period, the connection is closed. The default is 60 seconds.
.TP
.B max_connections <int>
This specifies the maximum number of clients that can be connected to MPD. The default is 5 connections.
.TP
.B mixer_type <oss or alsa>
This specifies which mixer to use. The default is oss.
.TP
.B mixer_device <mixer dev>
This specifies which mixer to use. The default for oss is /dev/mixer;
the default for alsa is "hw:0".
.TP
.B mixer_control <string>
This specifies which mixer control to use (sometimes referred to as the "device"). Examples of mixer controls are PCM, Line1, Master, etc. An example for OSS is "Pcm", and an example for alsa is "PCM".
.TP
.B max_playlist_length <int>
This specifies the maximum number of songs that can be in the playlist. The default is 4096 songs.
.TP
.B buffer_size <size in KB>
This specifies the size of the buffer that mpd uses. The default is 2048 kilobytes.
.B buffer_before play <0-100%>
This specifies the amount of buffer that will be filled before a song begins playing. The default is 25%.
.TP
.B max_command_list_size <size in KB>
This specifies the maximum size a command list can be (in kilobytes). The default is 2048 kilobytes.
.TP
.B max_output_buffer_size <size in KB>
This specifies the maximum size of the output buffer to a client (in kilobytes).
The default is 2048 kilobytes.
.TP
.B ao_driver <ao plug-in>
This specifies the ao plug-in to use for audio output. Typical values for
Linux include "oss" and "alsa09". The default value is "default".
.TP
.B ao_driver_options <ao plug-in options>
This specifies the options to use for the selected ao_driver. For oss, the
only option available is "dsp". For alsa09, the available options are:
"dev", "buf_size", and "periods". Options are assigned using "=" and ";" is
used to separate options. An example for oss: "dsp=/dev/dsp". An example for
alsa09: "dev=hw:0,0;buf_size=4096". The default value is "".
.TP
.B audio_write_size <size in bytes>
This specifies how many bytes mpd writes to the audio device at once. The
default is 1024. This options is to work around a bug in older versions
of libao on sound cards with very small buffers.
.TP
.B save_absolute_paths_in_playlists <yes or no>
This specifies whether relative or absolute paths for song filenames are
used when saving playlists. The default value is "no".
.SH EXAMPLES
.TP
Below is an example config file. (Note: '#' at the beginning of a line denotes
a comment. The '#' must be the first character/symbol on that line.)
.br
.br
# required
.br
port "2100"
.br
music_directory "/home/shank/mp3"
.br
playlist_directory "/home/shank/playlists"
.br
log_file "/home/shank/mpd.log"
.br
error_file "/home/shank/mpd.error"
.br
.br
# optional
.br
mixer_type "oss"
.br
mixer_device "/dev/mixer"
.br
#mixer_type "alsa"
.br
#mixer_device "default"
.br
#ao_driver "oss"
.br
#ao_driver_options "dsp=/dev/dsp"
.br
max_playlist_length "4096"
.br
buffer_before_play "25%"
.br
#db_file "/home/shank/playlists/.mpddb"
.br
#state_file "/home/shank/playlists/.mpdstate"
.br
#user "shank"
.br
connection_timeout "60"
.br
max_connections "5"
.br
max_command_list_size "2048"
.br
max_output_buffer_size "2048"
.br
save_absolute_paths_in_playlists "no"
.br
# log_level can be "default", "secure", "verbose"
.br
log_level "default"
.br
# if bind_to_address is "any", MPD binds all addresses
.br
bind_to_address "any"
.SH SEE ALSO
mpc(1)
# required
port "2100"
music_directory "/home/shank/mp3"
playlist_directory "/home/shank/playlists"
log_file "/home/shank/mpd.log"
error_file "/home/shank/mpd.error"
# optional
mixer_type "oss"
mixer_device "/dev/mixer"
#mixer_control "Pcm"
#mixer_type "alsa"
#mixer_device "default"
#mixer_control "PCM"
#ao_driver "oss"
#ao_driver_options "dsp=/dev/dsp"
max_playlist_length "4096"
buffer_before_play "25%"
#db_file "/home/shank/playlists/.mpddb"
#state_file "/home/shank/playlists/.mpdstate"
#user "shank"
connection_timeout "60"
max_connections "5"
max_command_list_size "2048"
max_output_buffer_size "2048"
save_absolute_paths_in_playlists "no"
# log_level can be "default", "secure", "verbose"
log_level "default"
# when bind_to_address is set to "any", MPD binds all available addresses
bind_to_address "any"
make distclean
./autogen.sh
./configure --enable-mpd-mad --enable-mpd-id3tag
make
make dist
bin_PROGRAMS = mpd
SUBDIRS = $(ID3_SUBDIR) $(MAD_SUBDIR)
mpd_headers = buffer2array.h interface.h command.h playlist.h ls.h \
song.h list.h directory.h tables.h utils.h path.h mp3_decode.h \
tag.h player.h listen.h conf.h ogg_decode.h volume.h flac_decode.h \
audio.h playerData.h stats.h myfprintf.h sig_handlers.h decode.h log.h \
audiofile_decode.h charConv.h permission.h mpd_types.h pcm_utils.h
mpd_SOURCES = main.c buffer2array.c interface.c command.c playlist.c ls.c \
song.c list.c directory.c tables.c utils.c path.c mp3_decode.c \
tag.c player.c listen.c conf.c ogg_decode.c volume.c flac_decode.c \
audio.c playerData.c stats.c myfprintf.c sig_handlers.c decode.c log.c \
audiofile_decode.c charConv.c permission.c pcm_utils.c $(mpd_headers)
mpd_CFLAGS = $(MPD_CFLAGS)
mpd_LDADD = $(MPD_LIBS) $(ID3_LIB) $(MAD_LIB)
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "audio.h"
#include "conf.h"
#include "log.h"
#include "sig_handlers.h"
#include <string.h>
#include <assert.h>
#include <signal.h>
int audio_write_size;
int audio_ao_driver_id;
ao_option * audio_ao_options;
AudioFormat audio_format;
ao_device * audio_device = NULL;
void initAudioDriver() {
ao_info * ai;
char * dup;
char * stk1;
char * stk2;
char * n1;
char * key;
char * value;
char * test;
/*int found;
int i;*/
audio_write_size = strtol((getConf())[CONF_AUDIO_WRITE_SIZE],&test,10);
if (*test!='\0') {
ERROR("\"%s\" is not a valid write size",
(getConf())[CONF_AUDIO_WRITE_SIZE]);
exit(-1);
}
audio_ao_options = NULL;
ao_initialize();
if(strcmp(AUDIO_AO_DRIVER_DEFAULT,(getConf())[CONF_AO_DRIVER])==0) {
audio_ao_driver_id = ao_default_driver_id();
}
else if((audio_ao_driver_id =
ao_driver_id((getConf())[CONF_AO_DRIVER]))<0) {
ERROR("\"%s\" is not a valid ao driver\n",
(getConf())[CONF_AO_DRIVER]);
exit(-1);
}
if((ai = ao_driver_info(audio_ao_driver_id))==NULL) {
ERROR("problems getting ao_driver_info\n");
ERROR("you may not have permission to the audio device\n");
exit(-1);
}
dup = strdup((getConf())[CONF_AO_DRIVER_OPTIONS]);
if(strlen(dup)) {
stk1 = NULL;
n1 = strtok_r(dup,";",&stk1);
while(n1) {
stk2 = NULL;
key = strtok_r(n1,"=",&stk2);
if(!key) {
ERROR("problems parsing "
"ao_driver_options \"%s\"\n", n1);
exit(-1);
}
/*found = 0;
for(i=0;i<ai->option_count;i++) {
if(strcmp(ai->options[i],key)==0) {
found = 1;
break;
}
}
if(!found) {
ERROR("\"%s\" is not an option for "
"\"%s\" ao driver\n",key,
ai->short_name);
exit(-1);
}*/
value = strtok_r(NULL,"",&stk2);
if(!value) {
ERROR("problems parsing "
"ao_driver_options \"%s\"\n", n1);
exit(-1);
}
ao_append_option(&audio_ao_options,key,value);
n1 = strtok_r(NULL,";",&stk1);
}
}
free(dup);
}
void finishAudioDriver() {
ao_free_options(audio_ao_options);
ao_shutdown();
}
int isCurrentAudioFormat(AudioFormat * audioFormat) {
if(!audio_device) return 0;
if(audio_format.bits!=audioFormat->bits ||
audio_format.sampleRate!=audioFormat->sampleRate ||
audio_format.channels!=audioFormat->channels)
{
return 0;
}
return 1;
}
int initAudio(AudioFormat * audioFormat) {
ao_sample_format format;
if(!isCurrentAudioFormat(audioFormat)) {
finishAudio();
}
if(!audio_device) {
format.bits = audioFormat->bits;
format.rate = audioFormat->sampleRate;
format.byte_format = AO_FMT_NATIVE;
format.channels = audioFormat->channels;
audio_format.bits = format.bits;
audio_format.sampleRate = format.rate;
audio_format.channels = format.channels;
blockSignals();
audio_device = ao_open_live(audio_ao_driver_id, &format,
audio_ao_options);
if(audio_device==NULL) {
unblockSignals();
audioError();
return -1;
}
unblockSignals();
}
return 0;
}
void playAudio(char * playChunk, int size) {
int send;
assert(audio_device!=NULL);
while(size>0) {
send = audio_write_size>size?size:audio_write_size;
ao_play(audio_device,playChunk,send);
playChunk+=send;
size-=send;
}
}
void finishAudio() {
if(audio_device) {
blockSignals();
ao_close(audio_device);
audio_device = NULL;
unblockSignals();
}
}
void audioError() {
ERROR("Error opening audio device\n");
if(errno==AO_ENOTLIVE) {
ERROR("not a live ao device\n");
}
else if(errno==AO_EOPENDEVICE) {
ERROR("not able to open audio device\n");
}
else if(errno==AO_EBADOPTION) {
ERROR("bad driver option\n");
}
}
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef AUDIO_H
#define AUDIO_H
#include <stdio.h>
#include <ao/ao.h>
#define AUDIO_AO_DRIVER_DEFAULT "default"
typedef struct _AudioFormat {
int channels;
int sampleRate;
int bits;
} AudioFormat;
extern int audio_ao_driver_id;
extern ao_option * audio_ao_options;
void initAudioDriver();
void finishAudioDriver();
int initAudio(AudioFormat * audioFormat);
void playAudio(char * playChunk,int size);
void finishAudio();
void audioError();
int isCurrentAudioFormat(AudioFormat * audioFormat);
#endif
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* libaudiofile (wave) support added by Eric Wong <normalperson@yhbt.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_AUDIOFILE
#include "audiofile_decode.h"
#include "command.h"
#include "utils.h"
#include "audio.h"
#include "log.h"
#include "pcm_utils.h"
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <audiofile.h>
int getAudiofileTotalTime(char * file)
{
int time;
AFfilehandle af_fp = afOpenFile(file, "r", NULL);
if(af_fp == AF_NULL_FILEHANDLE) {
return -1;
}
time = (int)
((double)afGetFrameCount(af_fp,AF_DEFAULT_TRACK)
/afGetRate(af_fp,AF_DEFAULT_TRACK));
afCloseFile(af_fp);
return time;
}
int audiofile_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc)
{
int fs, frame_count;
AFfilehandle af_fp;
af_fp = afOpenFile(dc->file,"r", NULL);
if(af_fp == AF_NULL_FILEHANDLE) {
ERROR("failed to open %s\n",dc->file);
return -1;
}
afGetSampleFormat(af_fp, AF_DEFAULT_TRACK, &fs, &af->bits);
af->sampleRate = (int)afGetRate(af_fp, AF_DEFAULT_TRACK);
af->channels = afGetChannels(af_fp,AF_DEFAULT_TRACK);
frame_count = afGetFrameCount(af_fp,AF_DEFAULT_TRACK);
cb->totalTime = ((float)frame_count/(float)af->sampleRate);
if (af->bits != 8 && af->bits != 16) {
ERROR("Only 8 and 16-bit files are supported. %s is %i-bit\n",
dc->file,af->bits);
afCloseFile(af_fp);
return -1;
}
fs = (int)afGetFrameSize(af_fp, AF_DEFAULT_TRACK,1);
dc->state = DECODE_STATE_DECODE;
dc->start = 0;
{
int ret, eof = 0, current = 0;
unsigned char chunk[CHUNK_SIZE];
while(!eof) {
if(dc->seek) {
cb->end = 0;
cb->wrap = 0;
current = dc->seekWhere * af->sampleRate;
afSeekFrame(af_fp, AF_DEFAULT_TRACK,current);
dc->seek = 0;
}
ret = afReadFrames(af_fp, AF_DEFAULT_TRACK, chunk, CHUNK_SIZE/fs);
if(ret<=0) eof = 1;
else {
while(cb->begin==cb->end && cb->wrap &&
!dc->stop && !dc->seek){
usleep(1000);
}
if(dc->stop) break;
else if(dc->seek) continue;
#ifdef WORDS_BIGENDIAN
pcm_changeBufferEndianness(chunk,CHUNK_SIZE,
af->bits);
#endif
memcpy(cb->chunks+cb->end*CHUNK_SIZE,chunk,
CHUNK_SIZE);
cb->chunkSize[cb->end] = CHUNK_SIZE;
current += ret;
cb->times[cb->end] = (float)current/(float)af->sampleRate;
++cb->end;
if(cb->end>=BUFFERED_CHUNKS) {
cb->end = 0;
cb->wrap = 1;
}
}
}
if(dc->seek) dc->seek = 0;
if(dc->stop) {
dc->state = DECODE_STATE_STOP;
dc->stop = 0;
}
else dc->state = DECODE_STATE_STOP;
}
afCloseFile(af_fp);
return 0;
}
#endif /* HAVE_AUDIOFILE */
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* libaudiofile (wave) support added by Eric Wong <normalperson@yhbt.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef AUDIOFILE_DECODE_H
#define AUDIOFILE_DECODE_H
#ifdef HAVE_AUDIOFILE
#include "playerData.h"
int audiofile_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc);
int getAudiofileTotalTime(char * file);
#endif /* HAVE_AUDIOFILE */
#endif /* AUDIOFILE_DECODE_H */
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "buffer2array.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int buffer2array(char * origBuffer, char *** array) {
int quotes = 0;
int count = 0;
int i;
int curr;
int * beginArray;
char * buffer = strdup(origBuffer);
int bufferLength = strlen(buffer);
char * markArray = malloc(sizeof(char)*(bufferLength+1));
for(curr=0;curr<bufferLength;curr++) {
if(!quotes && (buffer[curr]==' ' || buffer[curr]=='\t') ) {
markArray[curr] = '0';
}
else if(buffer[curr] == '\"') {
if(curr>0 && buffer[curr-1]!='\\') {
quotes = quotes?0:1;
markArray[curr] = '0';
}
else {
markArray[curr] = '1';
}
}
else {
markArray[curr] = '1';
}
if(markArray[curr]=='1') {
if(curr>0) {
if(markArray[curr-1]=='0') {
count++;
}
}
else {
count++;
}
}
}
markArray[bufferLength] = '\0';
beginArray = malloc(sizeof(int)*count);
(*array) = malloc(sizeof(char *)*count);
count = 0;
for(curr=0;curr<bufferLength;curr++) {
if(markArray[curr]=='1') {
if(curr>0) {
if(markArray[curr-1]=='0') {
beginArray[count++] = curr;
}
}
else {
beginArray[count++] = curr;
}
}
else {
buffer[curr] = '\0';
}
}
for(i=0;i<count;i++) {
int len = strlen(buffer+beginArray[i])+1;
int arrayCurr = 0;
(*array)[i] = malloc(sizeof(char)*len);
for(curr=beginArray[i];buffer[curr]!='\0';curr++) {
if(buffer[curr]=='\\') {
if(buffer[curr+1]!='\0') {
curr++;
}
}
(*array)[i][arrayCurr++] = buffer[curr];
}
(*array)[i][arrayCurr] = '\0';
}
free(markArray);
free(beginArray);
free(buffer);
return count;
}
void freeArgArray(char ** array, int argArrayLength) {
int i;
for(i=0;i<argArrayLength;i++) {
free(array[i]);
}
free(array);
}
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef BUFFER_2_ARRAY_H
#define BUFFER_2_ARRAY_H
int buffer2array(char * buffer, char *** array);
void freeArgArray(char ** array, int argArrayLength);
#endif
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "charConv.h"
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#ifdef HAVE_ICONV
#include <iconv.h>
iconv_t char_conv_iconv;
char * char_conv_to = NULL;
char * char_conv_from = NULL;
#endif
#define BUFFER_SIZE 1024
int setCharSetConversion(char * to, char * from) {
#ifdef HAVE_ICONV
if(char_conv_to && strcmp(to,char_conv_to)==0 &&
char_conv_from && strcmp(from,char_conv_from)==0)
{
return 0;
}
closeCharSetConversion();
if((char_conv_iconv = iconv_open(to,from))==(iconv_t)(-1)) return -1;
char_conv_to = strdup(to);
char_conv_from = strdup(from);
return 0;
#endif
return -1;
}
char * convStrDup(char * string) {
#ifdef HAVE_ICONV
char buffer[BUFFER_SIZE];
size_t inleft = strlen(string);
char * ret;
size_t outleft;
int retlen = 0;
size_t err;
char * bufferPtr;
if(!char_conv_to) return NULL;
ret = strdup("");
while(inleft) {
bufferPtr = buffer;
outleft = BUFFER_SIZE;
err = iconv(char_conv_iconv,&string,&inleft,&bufferPtr,
&outleft);
if(outleft==BUFFER_SIZE || (err<0 && errno!=E2BIG)) {
free(ret);
return NULL;
}
ret = realloc(ret,retlen+BUFFER_SIZE-outleft+1);
strncpy(&(ret[retlen]),buffer,BUFFER_SIZE-outleft);
retlen+=BUFFER_SIZE-outleft;
ret[retlen] = '\0';
}
return ret;
#endif
return NULL;
}
void closeCharSetConversion() {
#ifdef HAVE_ICONV
if(char_conv_to) {
iconv_close(char_conv_iconv);
free(char_conv_to);
free(char_conv_from);
char_conv_to = NULL;
char_conv_from = NULL;
}
#endif
}
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CHAR_CONV_H
#define CHAR_CONV_H
int setCharSetConversion(char * to, char * from);
char * convStrDup(char * string);
void closeCharSetConversion();
#endif
This diff is collapsed. Click to expand it.
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef COMMAND_H
#define COMMAND_H
#include <stdio.h>
#define COMMAND_RETURN_KILL 10
#define COMMAND_RETURN_CLOSE 20
#define COMMAND_RESPOND_ERROR "ACK"
#define COMMAND_RESPOND_OK "OK"
int processCommand(FILE * fp, unsigned int * permission, int argArrayLength,
char ** argArray);
void initCommands();
void finishCommands();
#endif
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "conf.h"
#include "log.h"
#include "utils.h"
#include "buffer2array.h"
#include "audio.h"
#include "volume.h"
#include <sys/param.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define MAX_STRING_SIZE MAXPATHLEN+80
#define CONF_COMMENT '#'
#define CONF_NUMBER_OF_PARAMS 27
#define CONF_NUMBER_OF_PATHS 6
#define CONF_NUMBER_OF_REQUIRED 5
#define CONF_NUMBER_OF_ALLOW_CATS 1
#define CONF_CONNECTION_TIMEOUT_DEFAULT "60"
#define CONF_MAX_CONNECTIONS_DEFAULT "5"
#define CONF_MAX_PLAYLIST_LENGTH_DEFAULT "4096"
#define CONF_BUFFER_BEFORE_PLAY_DEFAULT "25%"
#define CONF_MAX_COMMAND_LIST_SIZE_DEFAULT "2048"
#define CONF_MAX_OUTPUT_BUFFER_SIZE_DEFAULT "2048"
#define CONF_AO_DRIVER_DEFAULT AUDIO_AO_DRIVER_DEFAULT
#define CONF_AO_DRIVER_OPTIONS_DEFAULT ""
#define CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS_DEFAULT "no"
#define CONF_BIND_TO_ADDRESS_DEFAULT "any"
#define CONF_USER_DEFAULT ""
#define CONF_LOG_LEVEL_DEFAULT "default"
#define CONF_AUDIO_WRITE_SIZE_DEFAULT "1024"
#define CONF_BUFFER_SIZE_DEFAULT "2048"
#ifndef NO_OSS_MIXER
#define CONF_MIXER_TYPE_DEFAULT VOLUME_MIXER_OSS
#define CONF_MIXER_DEVICE_DEFAULT ""
#else
#ifdef HAVE_ALSA
#define CONF_MIXER_TYPE_DEFAULT VOLUME_MIXER_ALSA
#define CONF_MIXER_DEVICE_DEFAULT ""
#else
#define CONF_MIXER_TYPE_DEFAULT VOLUME_MIXER_NULL
#define CONF_MIXER_DEVICE_DEFAULT ""
#endif
#endif
char * conf_params[CONF_NUMBER_OF_PARAMS];
void initConf() {
int i;
for(i=0;i<CONF_NUMBER_OF_PARAMS;i++) conf_params[i] = NULL;
/* we don't specify these on the command line */
conf_params[CONF_CONNECTION_TIMEOUT] = strdup(CONF_CONNECTION_TIMEOUT_DEFAULT);
conf_params[CONF_MIXER_DEVICE] = strdup(CONF_MIXER_DEVICE_DEFAULT);
conf_params[CONF_MAX_CONNECTIONS] = strdup(CONF_MAX_CONNECTIONS_DEFAULT);
conf_params[CONF_MAX_PLAYLIST_LENGTH] = strdup(CONF_MAX_PLAYLIST_LENGTH_DEFAULT);
conf_params[CONF_BUFFER_BEFORE_PLAY] = strdup(CONF_BUFFER_BEFORE_PLAY_DEFAULT);
conf_params[CONF_MAX_COMMAND_LIST_SIZE] = strdup(CONF_MAX_COMMAND_LIST_SIZE_DEFAULT);
conf_params[CONF_MAX_OUTPUT_BUFFER_SIZE] = strdup(CONF_MAX_OUTPUT_BUFFER_SIZE_DEFAULT);
conf_params[CONF_AO_DRIVER] = strdup(CONF_AO_DRIVER_DEFAULT);
conf_params[CONF_AO_DRIVER_OPTIONS] = strdup(CONF_AO_DRIVER_OPTIONS_DEFAULT);
conf_params[CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS] = strdup(CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS_DEFAULT);
conf_params[CONF_BIND_TO_ADDRESS] = strdup(CONF_BIND_TO_ADDRESS_DEFAULT);
conf_params[CONF_MIXER_TYPE] = strdup(CONF_MIXER_TYPE_DEFAULT);
conf_params[CONF_USER] = strdup(CONF_USER_DEFAULT);
conf_params[CONF_LOG_LEVEL] = strdup(CONF_LOG_LEVEL_DEFAULT);
conf_params[CONF_AUDIO_WRITE_SIZE] = strdup(CONF_AUDIO_WRITE_SIZE_DEFAULT);
conf_params[CONF_BUFFER_SIZE] = strdup(CONF_BUFFER_SIZE_DEFAULT);
}
char ** readConf(char * file) {
char * conf_strings[CONF_NUMBER_OF_PARAMS] = {
"port",
"music_directory",
"playlist_directory",
"log_file",
"error_file",
"connection_timeout",
"mixer_device",
"max_connections",
"max_playlist_length",
"buffer_before_play",
"max_command_list_size",
"max_output_buffer_size",
"ao_driver",
"ao_driver_options",
"save_absolute_paths_in_playlists",
"bind_to_address",
"mixer_type",
"state_file",
"user",
"db_file",
"log_level",
"mixer_control",
"audio_write_size",
"filesystem_charset",
"password",
"default_permissions",
"buffer_size"
};
int conf_absolutePaths[CONF_NUMBER_OF_PATHS] = {
CONF_MUSIC_DIRECTORY,
CONF_PLAYLIST_DIRECTORY,
CONF_LOG_FILE,
CONF_ERROR_FILE,
CONF_STATE_FILE,
CONF_DB_FILE
};
int conf_required[CONF_NUMBER_OF_REQUIRED] = {
CONF_MUSIC_DIRECTORY,
CONF_PLAYLIST_DIRECTORY,
CONF_LOG_FILE,
CONF_ERROR_FILE,
CONF_PORT
};
short conf_allowCat[CONF_NUMBER_OF_ALLOW_CATS] = {
CONF_PASSWORD
};
FILE * fp;
char string[MAX_STRING_SIZE+1];
char ** array;
int i;
int numberOfArgs;
short allowCat[CONF_NUMBER_OF_PARAMS];
for(i=0;i<CONF_NUMBER_OF_PARAMS;i++) allowCat[i] = 0;
for(i=0;i<CONF_NUMBER_OF_ALLOW_CATS;i++) allowCat[conf_allowCat[i]] = 1;
if(!(fp=fopen(file,"r"))) {
ERROR("problems opening file %s for reading\n",file);
exit(-1);
}
while(myFgets(string,sizeof(string),fp)) {
if(string[0]==CONF_COMMENT) continue;
numberOfArgs = buffer2array(string,&array);
if(numberOfArgs==0) continue;
if(2!=numberOfArgs) {
ERROR("need two args in conf at: %s\n",string);
exit(-1);
}
i = 0;
while(i<CONF_NUMBER_OF_PARAMS && 0!=strcmp(conf_strings[i],array[0])) i++;
if(i>=CONF_NUMBER_OF_PARAMS) {
ERROR("unrecognized line in conf: %s\n",string);
exit(-1);
}
if(conf_params[i]!=NULL) {
if(allowCat[i]) {
conf_params[i] = realloc(conf_params[i],
strlen(conf_params[i])+
strlen(CONF_CAT_CHAR)+
strlen(array[1])+1);
strcat(conf_params[i],CONF_CAT_CHAR);
strcat(conf_params[i],array[1]);
}
else {
free(conf_params[i]);
conf_params[i] = strdup(array[1]);
}
}
else conf_params[i] = strdup(array[1]);
free(array[0]);
free(array[1]);
free(array);
}
fclose(fp);
for(i=0;i<CONF_NUMBER_OF_REQUIRED;i++) {
if(conf_params[conf_required[i]] == NULL) {
ERROR("%s is unassigned in conf file\n",
conf_strings[conf_required[i]]);
exit(-1);
}
}
for(i=0;i<CONF_NUMBER_OF_PATHS;i++) {
if(conf_params[conf_absolutePaths[i]] &&
conf_params[conf_absolutePaths[i]][0]!='/') {
ERROR("\"%s\" is not an absolute path\n",
conf_params[conf_absolutePaths[i]]);
exit(-1);
}
}
return conf_params;
}
char ** getConf() {
return conf_params;
}
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef CONF_H
#define CONF_H
#define CONF_PORT 0
#define CONF_MUSIC_DIRECTORY 1
#define CONF_PLAYLIST_DIRECTORY 2
#define CONF_LOG_FILE 3
#define CONF_ERROR_FILE 4
#define CONF_CONNECTION_TIMEOUT 5
#define CONF_MIXER_DEVICE 6
#define CONF_MAX_CONNECTIONS 7
#define CONF_MAX_PLAYLIST_LENGTH 8
#define CONF_BUFFER_BEFORE_PLAY 9
#define CONF_MAX_COMMAND_LIST_SIZE 10
#define CONF_MAX_OUTPUT_BUFFER_SIZE 11
#define CONF_AO_DRIVER 12
#define CONF_AO_DRIVER_OPTIONS 13
#define CONF_SAVE_ABSOLUTE_PATHS_IN_PLAYLISTS 14
#define CONF_BIND_TO_ADDRESS 15
#define CONF_MIXER_TYPE 16
#define CONF_STATE_FILE 17
#define CONF_USER 18
#define CONF_DB_FILE 19
#define CONF_LOG_LEVEL 20
#define CONF_MIXER_CONTROL 21
#define CONF_AUDIO_WRITE_SIZE 22
#define CONF_FS_CHARSET 23
#define CONF_PASSWORD 24
#define CONF_DEFAULT_PERMISSIONS 25
#define CONF_BUFFER_SIZE 26
#define CONF_CAT_CHAR "\n"
/* do not free the return value, it is a static variable */
char ** readConf(char * file);
char ** getConf();
void initConf();
void writeConf(char * file);
#endif
This diff is collapsed. Click to expand it.
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DECODE_H
#define DECODE_H
#include <stdio.h>
#include <sys/param.h>
#define DECODE_TYPE_MP3 0
#define DECODE_TYPE_OGG 1
#define DECODE_TYPE_FLAC 2
#define DECODE_TYPE_AUDIOFILE 3
#define DECODE_STATE_STOP 0
#define DECODE_STATE_DECODE 1
#define DECODE_ERROR_NOERROR 0
#define DECODE_ERROR_UNKTYPE 1
typedef struct _DecoderControl {
int state;
int stop;
int start;
int error;
int seek;
double seekWhere;
char file[MAXPATHLEN+1];
} DecoderControl;
void decodeSigHandler(int sig);
void decode();
#endif
This diff is collapsed. Click to expand it.
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DIRECTORY_H
#define DIRECTORY_H
#include "song.h"
#include <stdio.h>
#include <sys/param.h>
extern char directorydb[MAXPATHLEN+1];
void initMp3Directory();
void closeMp3Directory();
int printDirectoryInfo(FILE * fp, char * dirname);
int writeDirectoryDB();
int readDirectoryDB();
int updateMp3Directory(FILE * fp);
int printAllIn(FILE * fp, char * name);
int addAllIn(FILE * fp, char * name);
int printInfoForAllIn(FILE * fp, char * name);
int searchForSongsIn(FILE * fp, char * name, char * item, char * string);
int findSongsIn(FILE * fp, char * name, char * item, char * string);
int countSongsIn(FILE * fp, char * name);
Song * getSong(char * file);
time_t getDbModTime();
#endif
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifdef HAVE_FLAC
#include "flac_decode.h"
#include "utils.h"
#include "log.h"
#include "pcm_utils.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <FLAC/file_decoder.h>
#include <FLAC/metadata.h>
typedef struct {
unsigned char chunk[CHUNK_SIZE];
int chunk_length;
float time;
Buffer * cb;
AudioFormat * af;
DecoderControl * dc;
char * file;
} FlacData;
/* this code is based on flac123, from flac-tools */
int flacSendChunk(FlacData * data);
void flacPlayfile(const char * file, Buffer * cb, ao_sample_format * format);
void flacError(const FLAC__FileDecoder *, FLAC__StreamDecoderErrorStatus, void *);
void flacPrintErroredState(FLAC__FileDecoderState state, char * file);
void flacMetadata(const FLAC__FileDecoder *, const FLAC__StreamMetadata *, void *);
FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__FileDecoder *, const FLAC__Frame *, const FLAC__int32 * const buf[], void *);
void flacPlayFile(char *file, Buffer * cb, AudioFormat * af,
DecoderControl *dc)
{
FLAC__FileDecoder * flacDec;
FlacData data;
int status = 1;
data.chunk_length = 0;
data.time = 0;
data.cb = cb;
data.af = af;
data.dc = dc;
data.file = file;
if(!(flacDec = FLAC__file_decoder_new())) return;
/*status&=FLAC__file_decoder_set_md5_checking(flacDec,1);*/
status&=FLAC__file_decoder_set_filename(flacDec,file);
status&=FLAC__file_decoder_set_write_callback(flacDec,flacWrite);
status&=FLAC__file_decoder_set_metadata_callback(flacDec,flacMetadata);
status&=FLAC__file_decoder_set_error_callback(flacDec,flacError);
status&=FLAC__file_decoder_set_client_data(flacDec, (void *)&data);
if(!status) {
ERROR("flac problem before init(): %s\n",file);
flacPrintErroredState(FLAC__file_decoder_get_state(flacDec),file);
FLAC__file_decoder_delete(flacDec);
return;
}
if(FLAC__file_decoder_init(flacDec)!=
FLAC__STREAM_DECODER_SEARCH_FOR_METADATA)
{
ERROR("flac problem doing init(): %s\n",file);
flacPrintErroredState(FLAC__file_decoder_get_state(flacDec),file);
FLAC__file_decoder_delete(flacDec);
return;
}
if(!FLAC__file_decoder_process_until_end_of_metadata(flacDec)) {
ERROR("flac problem reading metadata: %s\n",file);
flacPrintErroredState(FLAC__file_decoder_get_state(flacDec),file);
FLAC__file_decoder_delete(flacDec);
return;
}
while(1) {
FLAC__file_decoder_process_single(flacDec);
if(FLAC__file_decoder_get_state(flacDec)!=
FLAC__FILE_DECODER_OK)
{
break;
}
if(dc->seek) {
FLAC__uint64 sampleToSeek = dc->seekWhere*
af->sampleRate+0.5;
cb->end = 0;
cb->wrap = 0;
if(FLAC__file_decoder_seek_absolute(flacDec,
sampleToSeek))
{
data.time = ((float)sampleToSeek)/
af->sampleRate;
}
dc->seek = 0;
}
}
FLAC__file_decoder_process_until_end_of_file(flacDec);
if(!dc->stop) {
flacPrintErroredState(FLAC__file_decoder_get_state(flacDec),
file);
FLAC__file_decoder_finish(flacDec);
}
FLAC__file_decoder_delete(flacDec);
/* send last little bit */
if(data.chunk_length>0 && !dc->stop) flacSendChunk(&data);
}
void flacError(const FLAC__FileDecoder *dec, FLAC__StreamDecoderErrorStatus status, void *fdata) {
FlacData * data = (FlacData *) fdata;
if(data->dc->stop) return;
switch(status) {
case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC:
ERROR("flac lost sync: %s\n",data->file);
break;
case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER:
ERROR("bad header %s\n",data->file);
break;
case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH:
ERROR("crc mismatch %s\n",data->file);
break;
default:
ERROR("unknow flac error %s\n",data->file);
}
}
void flacPrintErroredState(FLAC__FileDecoderState state, char * file) {
switch(state) {
case FLAC__FILE_DECODER_ERROR_OPENING_FILE:
ERROR("error opening flac: %s\n",file);
break;
case FLAC__FILE_DECODER_MEMORY_ALLOCATION_ERROR:
ERROR("flac allocation error\n");
break;
case FLAC__FILE_DECODER_SEEK_ERROR:
ERROR("flac seek error: %s\n",file);
break;
case FLAC__FILE_DECODER_SEEKABLE_STREAM_DECODER_ERROR:
ERROR("flac seekable stream error: %s\n",file);
break;
case FLAC__FILE_DECODER_ALREADY_INITIALIZED:
ERROR("flac decoder already initilaized: %s\n",file);
break;
case FLAC__FILE_DECODER_INVALID_CALLBACK:
ERROR("invalid flac callback\n");
break;
case FLAC__FILE_DECODER_UNINITIALIZED:
ERROR("flac decoder uninitialized: %s\n",file);
break;
case FLAC__FILE_DECODER_OK:
case FLAC__FILE_DECODER_END_OF_FILE:
break;
}
}
void flacMetadata(const FLAC__FileDecoder *dec, const FLAC__StreamMetadata *meta, void *data) {
}
int flacSendChunk(FlacData * data) {
while(data->cb->begin==data->cb->end && data->cb->wrap &&
!data->dc->stop && !data->dc->seek)
{
usleep(1000);
}
if(data->dc->stop) return -1;
if(data->dc->seek) return 0;
#ifdef WORDS_BIGENDIAN
pcm_changeBufferEndianness(chunk,CHUNK_SIZE,data->af->bits);
#endif
memcpy(data->cb->chunks+data->cb->end*CHUNK_SIZE,data->chunk,
CHUNK_SIZE);
data->cb->chunkSize[data->cb->end] = data->chunk_length;
data->cb->times[data->cb->end] = data->time;
data->cb->bitRate[data->cb->end] = 0;
data->cb->end++;
if(data->cb->end>=BUFFERED_CHUNKS) {
data->cb->end = 0;
data->cb->wrap = 1;
}
return 0;
}
FLAC__StreamDecoderWriteStatus flacWrite(const FLAC__FileDecoder *dec, const FLAC__Frame *frame, const FLAC__int32 * const buf[], void * vdata) {
FlacData * data = (FlacData *)vdata;
FLAC__uint32 samples = frame->header.blocksize;
FLAC__uint16 u16;
unsigned char * uc;
int c_samp, c_chan, d_samp;
int i;
data->time+=((float)samples)/frame->header.sample_rate;
for(c_samp = d_samp = 0; c_samp < frame->header.blocksize; c_samp++) {
for(c_chan = 0; c_chan < frame->header.channels;
c_chan++, d_samp++) {
u16 = buf[c_chan][c_samp];
uc = (unsigned char *)&u16;
for(i=0;i<(data->af->bits/8);i++) {
if(data->chunk_length>=CHUNK_SIZE) {
if(flacSendChunk(data)<0) {
return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
}
data->chunk_length = 0;
if(data->dc->seek) {
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
}
data->chunk[data->chunk_length++] = *(uc++);
}
}
}
return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
}
int flac_getAudioFormatAndTime(char * file, AudioFormat * format, float * time) {
FLAC__Metadata_SimpleIterator * it;
FLAC__StreamMetadata * block = NULL;
int found = 0;
int ret = -1;
if(!(it = FLAC__metadata_simple_iterator_new())) return -1;
if(!FLAC__metadata_simple_iterator_init(it,file,1,0)) {
FLAC__metadata_simple_iterator_delete(it);
return -1;
}
do {
if(block) FLAC__metadata_object_delete(block);
block = FLAC__metadata_simple_iterator_get_block(it);
if(block->type == FLAC__METADATA_TYPE_STREAMINFO) found=1;
} while(!found && FLAC__metadata_simple_iterator_next(it));
if(found) {
format->bits = block->data.stream_info.bits_per_sample;
format->bits = 16;
format->sampleRate = block->data.stream_info.sample_rate;
format->channels = block->data.stream_info.channels;
*time = ((float)block->data.stream_info.total_samples)/
format->sampleRate;
ret = 0;
}
if(block) FLAC__metadata_object_delete(block);
FLAC__metadata_simple_iterator_delete(it);
return ret;
}
int flac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc) {
if(flac_getAudioFormatAndTime(dc->file,af,&(cb->totalTime))<0) {
ERROR("\"%s\" doesn't seem to be a flac\n",dc->file);
return -1;
}
dc->state = DECODE_STATE_DECODE;
dc->start = 0;
flacPlayFile(dc->file,cb,af,dc);
if(dc->seek) dc->seek = 0;
if(dc->stop) {
dc->state = DECODE_STATE_STOP;
dc->stop = 0;
}
else dc->state = DECODE_STATE_STOP;
return 0;
}
#endif
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef FLAC_DECODE_H
#define FLAC_DECODE_H
#include "playerData.h"
#include <stdio.h>
int flac_decode(Buffer * cb, AudioFormat * af, DecoderControl * dc);
#endif
This diff is collapsed. Click to expand it.
/* the Music Player Daemon (MPD)
* (c)2003-2004 by Warren Dukes (shank@mercury.chem.pitt.edu)
* This project's homepage is: http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef INTERFACE_H
#define INTERFACE_H
#include <stdio.h>
#include <time.h>
#include <sys/types.h>
#include <sys/socket.h>
void initInterfaces();
void openAInterface(int fd, struct sockaddr * addr);
void closeAllInterfaces();
void freeAllInterfaces();
void closeOldInterfaces();
void closeInterfaceWithFD(int fd);
void flushAllInterfaceBuffers();
int interfacePrintWithFD(int fd, char * buffer);
int doIOForInterfaces();
#endif
libid3tag - ID3 tag manipulation library
Copyright (C) 2000-2003 Underbit Technologies, Inc.
$Id: CHANGES,v 1.1 2003/08/14 03:57:13 shank Exp $
===============================================================================
Version 0.15.0 (beta)
* Updated to autoconf 2.57, automake 1.7.5, libtool 1.4.3.
* Added new id3_tag_version(), id3_tag_options(), id3_tag_setlength(),
id3_frame_field(), id3_field_getlatin1(), id3_field_getfulllatin1(),
id3_genre_index(), id3_genre_number(), id3_latin1_ucs4duplicate(),
id3_utf16_ucs4duplicate(), and id3_utf8_ucs4duplicate() API routines.
* Properly exposed the id3_frame_new(), id3_frame_delete(), and
id3_field_type() API routines.
* Fixed a possible segmentation fault rendering ID3v1 tags when a tag
field exceeds the field length limit.
* Fixed a problem whereby the file interface could try to seek and read
data from a non-seekable stream, unrecoverably losing data from the
stream. (N.B. the fix does not work under Win32.)
* Fixed a problem reading ID3v2.2 frames which corrupted their frame IDs
and caused them not to be re-rendered.
* Improved rendering of the ID3v1 genre field from ID3v2 genre
names/numbers. The genre "Other" is used in place of non-translatable
genres.
* Rendering an empty ID3v1 tag now properly returns 0 length even when a
null buffer pointer is passed.
* Changed the file implementation to maintain information about present
but unparseable tags, instead of ignoring all tags and returning an
error.
* Added an external dependency on zlib (libz), which is no longer
included.
* Changed to build a shared library by default.
* Changed to use native Cygwin build by default; give --host=mingw32 to
`configure' to use MinGW (and avoid a dependency on the Cygwin DLL).
Version 0.14.2 (beta)
* Changed Cygwin builds to use MinGW; resulting Win32 executables no
longer have a dependency on Cygwin DLLs.
Version 0.14.1 (beta)
* Updated config.guess and config.sub to latest upstream versions.
* Enabled libtool versioning rather than release numbering.
* Renamed `libid3' to `libid3tag' and enabled installation as a separate
library.
* Several other small fixes.
Version 0.14.0 (beta)
* Added a new ID3 tag manipulation library (libid3). The required zlib
support is provided either by the host system or by the included static
library implementation (libz).
* Improved MSVC++ portability and added MSVC++ project files.
===============================================================================
libid3tag - ID3 tag manipulation library
Copyright (C) 2000-2003 Underbit Technologies, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
If you would like to negotiate alternate licensing terms, you may do
so by contacting: Underbit Technologies, Inc. <info@underbit.com>
libid3tag - ID3 tag manipulation library
Copyright (C) 2000-2003 Underbit Technologies, Inc.
$Id: CREDITS,v 1.1 2003/08/14 03:57:13 shank Exp $
===============================================================================
AUTHOR
Except where otherwise noted, all code was authored by:
Robert Leslie <rob@underbit.com>
CONTRIBUTORS
Significant contributions have been incorporated with thanks to:
Mark Malson <mark@mmalson.com>
2002/10/09: frame.c
- Reported problem reading ID3v2.2 tag frames.
Brett Paterson <brett@fmod.org>
2001/10/28: global.h
- Reported missing <assert.h> et al. under MS Embedded Visual C.
===============================================================================
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
##
## libid3tag - ID3 tag manipulation library
## Copyright (C) 2000-2003 Underbit Technologies, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
## $Id: Makefile.am,v 1.1 2003/08/14 03:57:13 shank Exp $
##
## Process this file with automake to produce Makefile.in
SUBDIRS =
#DIST_SUBDIRS = msvc++
noinst_LTLIBRARIES = libid3tag.la
noinst_HEADERS = id3tag.h
## From the libtool documentation on library versioning:
##
## CURRENT
## The most recent interface number that this library implements.
##
## REVISION
## The implementation number of the CURRENT interface.
##
## AGE
## The difference between the newest and oldest interfaces that this
## library implements. In other words, the library implements all the
## interface numbers in the range from number `CURRENT - AGE' to
## `CURRENT'.
##
## If two libraries have identical CURRENT and AGE numbers, then the
## dynamic linker chooses the library with the greater REVISION number.
##
## 1. Start with version information of `0:0:0' for each libtool library.
##
## 2. Update the version information only immediately before a public
## release of your software. More frequent updates are unnecessary,
## and only guarantee that the current interface number gets larger
## faster.
##
## 3. If the library source code has changed at all since the last
## update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
##
## 4. If any interfaces have been added, removed, or changed since the
## last update, increment CURRENT, and set REVISION to 0.
##
## 5. If any interfaces have been added since the last public release,
## then increment AGE.
##
## 6. If any interfaces have been removed since the last public release,
## then set AGE to 0.
version_current = 2
version_revision = 0
version_age = 2
version_info = $(version_current):$(version_revision):$(version_age)
EXTRA_DIST = genre.dat.sed \
CHANGES COPYRIGHT CREDITS README TODO VERSION
if DEBUG
debug = debug.c debug.h
else
debug =
endif
libid3tag_la_SOURCES = version.c ucs4.c latin1.c utf16.c utf8.c \
parse.c render.c field.c frametype.c compat.c \
genre.c frame.c crc.c util.c tag.c file.c \
version.h ucs4.h latin1.h utf16.h utf8.h \
parse.h render.h field.h frametype.h compat.h \
genre.h frame.h crc.h util.h tag.h file.h \
id3tag.h global.h genre.dat $(debug)
EXTRA_libid3tag_la_SOURCES = \
frametype.gperf compat.gperf genre.dat.in \
debug.c debug.h
libid3tag_la_LDFLAGS = -version-info $(version_info)
BUILT_SOURCES = frametype.c compat.c genre.dat
$(srcdir)/frametype.c: $(srcdir)/frametype.gperf Makefile.am
cd $(srcdir) && \
gperf -tCcTonD -K id -N id3_frametype_lookup -s -3 -k '*' \
frametype.gperf | \
sed -e 's/\(struct id3_frametype\);/\1/' | \
sed -e '/\$$''Id: /s/\$$//g' >frametype.c
$(srcdir)/compat.c: $(srcdir)/compat.gperf Makefile.am
cd $(srcdir) && \
gperf -tCcTonD -K id -N id3_compat_lookup -s -3 -k '*' \
compat.gperf | \
sed -e 's/\(struct id3_compat\);/\1/' | \
sed -e '/\$$''Id: /s/\$$//g' >compat.c
$(srcdir)/genre.dat: $(srcdir)/genre.dat.in $(srcdir)/genre.dat.sed Makefile.am
cd $(srcdir) && \
sed -n -f genre.dat.sed genre.dat.in | \
sed -e '/\$$''Id: /s/\$$//g' >genre.dat
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
again:
$(MAKE) clean
$(MAKE)
.PHONY: again
libid3tag - ID3 tag manipulation library
Copyright (C) 2000-2003 Underbit Technologies, Inc.
$Id: README,v 1.1 2003/08/14 03:57:13 shank Exp $
===============================================================================
INTRODUCTION
libid3tag is a library for reading and (eventually) writing ID3 tags, both
ID3v1 and the various versions of ID3v2.
See the file `id3tag.h' for the current library interface.
This package uses GNU libtool to arrange for zlib to be linked
automatically when you link your programs with this library. If you aren't
using GNU libtool, in some cases you may need to link with zlib
explicitly:
${link_command} ... -lid3tag -lz
===============================================================================
BUILDING AND INSTALLING
Note that this library depends on zlib 1.1.4 or later. If you don't have
zlib already, you can obtain it from:
http://www.gzip.org/zlib/
You must have zlib installed before you can build this package.
Windows Platforms
libid3tag can be built under Windows using either MSVC++ or Cygwin. A
MSVC++ project file can be found under the `msvc++' subdirectory.
To build libid3tag using Cygwin, you will first need to install the Cygwin
tools:
http://www.cygwin.com/
You may then proceed with the following POSIX instructions within the
Cygwin shell.
Note that by default Cygwin will build a library that depends on the
Cygwin DLL. You can use MinGW to build a library that does not depend on
the Cygwin DLL. To do so, give the option --host=mingw32 to `configure'.
Be certain you also link with a MinGW version of zlib.
POSIX Platforms (including Cygwin)
The code is distributed with a `configure' script that will generate for
you a `Makefile' and a `config.h' for your platform. See the file
`INSTALL' for generic instructions.
The specific options you may want to give `configure' are:
--disable-debugging do not compile with debugging support, and
use more optimizations
--disable-shared do not build a shared library
By default the package will build a shared library if possible for your
platform. If you want only a static library, use --disable-shared.
If zlib is installed in an unusual place or `configure' can't find it, you
may need to indicate where it is:
./configure ... CPPFLAGS="-I${include_dir}" LDFLAGS="-L${lib_dir}"
where ${include_dir} and ${lib_dir} are the locations of the installed
header and library files, respectively.
Experimenting and Developing
Further options for `configure' that may be useful to developers and
experimenters are:
--enable-debugging enable diagnostic debugging support and
debugging symbols
--enable-profiling generate `gprof' profiling code
===============================================================================
COPYRIGHT
Please read the `COPYRIGHT' file for copyright and warranty information.
Also, the file `COPYING' contains the full text of the GNU GPL.
Send inquiries, comments, bug reports, suggestions, patches, etc. to:
Underbit Technologies, Inc. <support@underbit.com>
See also the MAD home page on the Web:
http://www.underbit.com/products/mad/
===============================================================================
libid3tag - ID3 tag manipulation library
Copyright (C) 2000-2003 Underbit Technologies, Inc.
$Id: TODO,v 1.1 2003/08/14 03:57:13 shank Exp $
===============================================================================
libid3tag:
- finish file API
- fix API headers
0.15.0b
configure.ac:24
id3tag.h:334-337
msvc++/config.h:57
Makefile.am:63-65
%{
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: compat.gperf,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include "global.h"
# include <stdlib.h>
# include <string.h>
# ifdef HAVE_ASSERT_H
# include <assert.h>
# endif
# include "id3tag.h"
# include "compat.h"
# include "frame.h"
# include "field.h"
# include "parse.h"
# include "ucs4.h"
# define EQ(id) #id, 0
# define OBSOLETE 0, 0
# define TX(id) #id, translate_##id
static id3_compat_func_t translate_TCON;
%}
struct id3_compat;
%%
#
# ID3v2.2 and ID3v2.3 frames
#
# Only obsolete frames or frames with an equivalent ID3v2.4 frame ID are
# listed here. If a frame ID is not listed, it is assumed that the same
# frame ID is itself the equivalent ID3v2.4 frame ID.
#
# This list may also include frames with new content interpretations; the
# translation function will rewrite the contents to comply with ID3v2.4.
#
BUF, EQ(RBUF) /* Recommended buffer size */
CNT, EQ(PCNT) /* Play counter */
COM, EQ(COMM) /* Comments */
CRA, EQ(AENC) /* Audio encryption */
CRM, OBSOLETE /* Encrypted meta frame [obsolete] */
EQU, OBSOLETE /* Equalization [obsolete] */
EQUA, OBSOLETE /* Equalization [obsolete] */
ETC, EQ(ETCO) /* Event timing codes */
GEO, EQ(GEOB) /* General encapsulated object */
IPL, EQ(TIPL) /* Involved people list */
IPLS, EQ(TIPL) /* Involved people list */
LNK, EQ(LINK) /* Linked information */
MCI, EQ(MCDI) /* Music CD identifier */
MLL, EQ(MLLT) /* MPEG location lookup table */
PIC, EQ(APIC) /* Attached picture */
POP, EQ(POPM) /* Popularimeter */
REV, EQ(RVRB) /* Reverb */
RVA, OBSOLETE /* Relative volume adjustment [obsolete] */
RVAD, OBSOLETE /* Relative volume adjustment [obsolete] */
SLT, EQ(SYLT) /* Synchronised lyric/text */
STC, EQ(SYTC) /* Synchronised tempo codes */
TAL, EQ(TALB) /* Album/movie/show title */
TBP, EQ(TBPM) /* BPM (beats per minute) */
TCM, EQ(TCOM) /* Composer */
TCO, TX(TCON) /* Content type */
TCON, TX(TCON) /* Content type */
TCR, EQ(TCOP) /* Copyright message */
TDA, OBSOLETE /* Date [obsolete] */
TDAT, OBSOLETE /* Date [obsolete] */
TDY, EQ(TDLY) /* Playlist delay */
TEN, EQ(TENC) /* Encoded by */
TFT, EQ(TFLT) /* File type */
TIM, OBSOLETE /* Time [obsolete] */
TIME, OBSOLETE /* Time [obsolete] */
TKE, EQ(TKEY) /* Initial key */
TLA, EQ(TLAN) /* Language(s) */
TLE, EQ(TLEN) /* Length */
TMT, EQ(TMED) /* Media type */
TOA, EQ(TOPE) /* Original artist(s)/performer(s) */
TOF, EQ(TOFN) /* Original filename */
TOL, EQ(TOLY) /* Original lyricist(s)/text writer(s) */
TOR, EQ(TDOR) /* Original release year [obsolete] */
TORY, EQ(TDOR) /* Original release year [obsolete] */
TOT, EQ(TOAL) /* Original album/movie/show title */
TP1, EQ(TPE1) /* Lead performer(s)/soloist(s) */
TP2, EQ(TPE2) /* Band/orchestra/accompaniment */
TP3, EQ(TPE3) /* Conductor/performer refinement */
TP4, EQ(TPE4) /* Interpreted, remixed, or otherwise modified by */
TPA, EQ(TPOS) /* Part of a set */
TPB, EQ(TPUB) /* Publisher */
TRC, EQ(TSRC) /* ISRC (international standard recording code) */
TRD, OBSOLETE /* Recording dates [obsolete] */
TRDA, OBSOLETE /* Recording dates [obsolete] */
TRK, EQ(TRCK) /* Track number/position in set */
TSI, OBSOLETE /* Size [obsolete] */
TSIZ, OBSOLETE /* Size [obsolete] */
TSS, EQ(TSSE) /* Software/hardware and settings used for encoding */
TT1, EQ(TIT1) /* Content group description */
TT2, EQ(TIT2) /* Title/songname/content description */
TT3, EQ(TIT3) /* Subtitle/description refinement */
TXT, EQ(TEXT) /* Lyricist/text writer */
TXX, EQ(TXXX) /* User defined text information frame */
TYE, OBSOLETE /* Year [obsolete] */
TYER, OBSOLETE /* Year [obsolete] */
UFI, EQ(UFID) /* Unique file identifier */
ULT, EQ(USLT) /* Unsynchronised lyric/text transcription */
WAF, EQ(WOAF) /* Official audio file webpage */
WAR, EQ(WOAR) /* Official artist/performer webpage */
WAS, EQ(WOAS) /* Official audio source webpage */
WCM, EQ(WCOM) /* Commercial information */
WCP, EQ(WCOP) /* Copyright/legal information */
WPB, EQ(WPUB) /* Publishers official webpage */
WXX, EQ(WXXX) /* User defined URL link frame */
%%
static
int translate_TCON(struct id3_frame *frame, char const *oldid,
id3_byte_t const *data, id3_length_t length)
{
id3_byte_t const *end;
enum id3_field_textencoding encoding;
id3_ucs4_t *string = 0, *ptr, *endptr;
int result = 0;
/* translate old TCON syntax into multiple strings */
assert(frame->nfields == 2);
encoding = ID3_FIELD_TEXTENCODING_ISO_8859_1;
end = data + length;
if (id3_field_parse(&frame->fields[0], &data, end - data, &encoding) == -1)
goto fail;
string = id3_parse_string(&data, end - data, encoding, 0);
if (string == 0)
goto fail;
ptr = string;
while (*ptr == '(') {
if (*++ptr == '(')
break;
endptr = ptr;
while (*endptr && *endptr != ')')
++endptr;
if (*endptr)
*endptr++ = 0;
if (id3_field_addstring(&frame->fields[1], ptr) == -1)
goto fail;
ptr = endptr;
}
if (*ptr && id3_field_addstring(&frame->fields[1], ptr) == -1)
goto fail;
if (0) {
fail:
result = -1;
}
if (string)
free(string);
return result;
}
/*
* NAME: compat->fixup()
* DESCRIPTION: finish compatibility translations
*/
int id3_compat_fixup(struct id3_tag *tag)
{
struct id3_frame *frame;
unsigned int index;
id3_ucs4_t timestamp[17] = { 0 };
int result = 0;
/* create a TDRC frame from obsolete TYER/TDAT/TIME frames */
/*
* TYE/TYER: YYYY
* TDA/TDAT: DDMM
* TIM/TIME: HHMM
*
* TDRC: yyyy-MM-ddTHH:mm
*/
index = 0;
while ((frame = id3_tag_findframe(tag, ID3_FRAME_OBSOLETE, index++))) {
char const *id;
id3_byte_t const *data, *end;
id3_length_t length;
enum id3_field_textencoding encoding;
id3_ucs4_t *string;
id = id3_field_getframeid(&frame->fields[0]);
assert(id);
if (strcmp(id, "TYER") != 0 && strcmp(id, "YTYE") != 0 &&
strcmp(id, "TDAT") != 0 && strcmp(id, "YTDA") != 0 &&
strcmp(id, "TIME") != 0 && strcmp(id, "YTIM") != 0)
continue;
data = id3_field_getbinarydata(&frame->fields[1], &length);
assert(data);
if (length < 1)
continue;
end = data + length;
encoding = id3_parse_uint(&data, 1);
string = id3_parse_string(&data, end - data, encoding, 0);
if (id3_ucs4_length(string) < 4) {
free(string);
continue;
}
if (strcmp(id, "TYER") == 0 ||
strcmp(id, "YTYE") == 0) {
timestamp[0] = string[0];
timestamp[1] = string[1];
timestamp[2] = string[2];
timestamp[3] = string[3];
}
else if (strcmp(id, "TDAT") == 0 ||
strcmp(id, "YTDA") == 0) {
timestamp[4] = '-';
timestamp[5] = string[2];
timestamp[6] = string[3];
timestamp[7] = '-';
timestamp[8] = string[0];
timestamp[9] = string[1];
}
else { /* TIME or YTIM */
timestamp[10] = 'T';
timestamp[11] = string[0];
timestamp[12] = string[1];
timestamp[13] = ':';
timestamp[14] = string[2];
timestamp[15] = string[3];
}
free(string);
}
if (timestamp[0]) {
id3_ucs4_t *strings;
frame = id3_frame_new("TDRC");
if (frame == 0)
goto fail;
strings = timestamp;
if (id3_field_settextencoding(&frame->fields[0],
ID3_FIELD_TEXTENCODING_ISO_8859_1) == -1 ||
id3_field_setstrings(&frame->fields[1], 1, &strings) == -1 ||
id3_tag_attachframe(tag, frame) == -1) {
id3_frame_delete(frame);
goto fail;
}
}
if (0) {
fail:
result = -1;
}
return result;
}
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: compat.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_COMPAT_H
# define LIBID3TAG_COMPAT_H
# include "id3tag.h"
typedef int id3_compat_func_t(struct id3_frame *, char const *,
id3_byte_t const *, id3_length_t);
struct id3_compat {
char const *id;
char const *equiv;
id3_compat_func_t *translate;
};
struct id3_compat const *id3_compat_lookup(register char const *,
register unsigned int);
int id3_compat_fixup(struct id3_tag *);
# endif
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define to enable diagnostic debugging support. */
#undef DEBUG
/* Define to 1 if you have the <assert.h> header file. */
#undef HAVE_ASSERT_H
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the `ftruncate' function. */
#undef HAVE_FTRUNCATE
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to disable debugging assertions. */
#undef NDEBUG
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define as `__inline' if that's what the C compiler calls it, or to nothing
if it is not supported. */
#undef inline
dnl -*- m4 -*-
dnl
dnl libid3tag - ID3 tag manipulation library
dnl Copyright (C) 2000-2003 Underbit Technologies, Inc.
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
AC_REVISION([$Id: configure.ac,v 1.1 2003/08/14 03:57:13 shank Exp $])dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT([ID3 Tag], [0.15.0b], [support@underbit.com], [libid3tag])
AC_PREREQ(2.53)
AC_CONFIG_SRCDIR([id3tag.h])
AM_INIT_AUTOMAKE
AM_CONFIG_HEADER([config.h])
dnl System type.
AC_CANONICAL_HOST
dnl Checks for programs.
AC_PROG_CC
if test "$GCC" = yes
then
case "$host" in
*-*-mingw*)
case "$build" in
*-*-cygwin*)
CPPFLAGS="$CPPFLAGS -mno-cygwin"
LDFLAGS="$LDFLAGS -mno-cygwin"
;;
esac
esac
dnl case "$host" in
dnl *-*-cygwin* | *-*-mingw*)
dnl LDFLAGS="$LDFLAGS -no-undefined -mdll"
dnl ;;
dnl esac
fi
dnl Support for libtool.
AC_DISABLE_SHARED
dnl AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
dnl Compiler options.
arch=""
debug=""
optimize=""
profile=""
set -- $CFLAGS
CFLAGS=""
if test "$GCC" = yes
then
CFLAGS="-Wall"
fi
while test $# -gt 0
do
case "$1" in
-Wall)
if test "$GCC" = yes
then
:
else
CFLAGS="$CFLAGS $1"
fi
shift
;;
-g)
debug="-g"
shift
;;
-mno-cygwin)
shift
;;
-m*)
arch="$arch $1"
shift
;;
-fomit-frame-pointer)
shift
;;
-O*|-f*)
optimize="$1"
shift
;;
*)
CFLAGS="$CFLAGS $1"
shift
;;
esac
done
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(assert.h unistd.h)
AC_CHECK_HEADER(zlib.h, [], [
AC_MSG_ERROR([zlib.h was not found
*** You must first install zlib (libz) before you can build this package.
*** If zlib is already installed, you may need to use the CPPFLAGS
*** environment variable to specify its installed location, e.g. -I<dir>.])
])
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
dnl Checks for library functions.
AC_CHECK_FUNCS(ftruncate)
AC_CHECK_LIB(z, compress2, [], [
AC_MSG_ERROR([libz was not found
*** You must first install zlib (libz) before you can build this package.
*** If zlib is already installed, you may need to use the LDFLAGS
*** environment variable to specify its installed location, e.g. -L<dir>.])
])
dnl handle --enable and --disable options
AC_CACHE_SAVE
AC_MSG_CHECKING([whether to enable profiling])
AC_ARG_ENABLE(profiling, AC_HELP_STRING([--enable-profiling],
[generate profiling code]),
[
case "$enableval" in
yes) profile="-pg" ;;
esac
])
AC_MSG_RESULT(${enable_profiling-no})
AC_MSG_CHECKING([whether to enable debugging])
AC_ARG_ENABLE(debugging, AC_HELP_STRING([--enable-debugging],
[enable diagnostic debugging support])
AC_HELP_STRING([--disable-debugging],
[do not enable debugging and use more optimization]),
[
case "$enableval" in
yes)
AC_DEFINE(DEBUG, 1,
[Define to enable diagnostic debugging support.])
optimize=""
;;
no)
if test -n "$profile"
then
AC_MSG_ERROR(--enable-profiling and --disable-debugging are incompatible)
fi
AC_DEFINE(NDEBUG, 1,
[Define to disable debugging assertions.])
debug=""
if test "$GCC" = yes
then
optimize="$optimize -fomit-frame-pointer"
fi
;;
esac
])
AC_MSG_RESULT(${enable_debugging-default})
AM_CONDITIONAL(DEBUG, test ${enable_debugging-default} = yes)
dnl Create output files.
test -n "$arch" && CFLAGS="$CFLAGS $arch"
test -n "$debug" && CFLAGS="$CFLAGS $debug"
test -n "$optimize" && CFLAGS="$CFLAGS $optimize"
test -n "$profile" && CFLAGS="$CFLAGS $profile" LDFLAGS="$LDFLAGS $profile"
dnl LTLIBOBJS=`echo "$LIBOBJS" | sed -e 's/\.o/.lo/g'`
dnl AC_SUBST(LTLIBOBJS)
AC_CONFIG_FILES([Makefile \
libid3tag.list])
AC_OUTPUT
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: crc.c,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include "global.h"
# include "id3tag.h"
# include "crc.h"
static
unsigned long const crc_table[256] = {
0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL,
0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L,
0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L,
0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L,
0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL,
0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L,
0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL,
0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L,
0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L,
0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL,
0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L,
0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L,
0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L,
0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL,
0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L,
0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL,
0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL,
0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L,
0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L,
0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L,
0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL,
0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L,
0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL,
0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L,
0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L,
0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL,
0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L,
0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L,
0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L,
0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL,
0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L,
0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL,
0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL,
0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L,
0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L,
0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L,
0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL,
0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L,
0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL,
0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L,
0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L,
0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL,
0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L,
0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L,
0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L,
0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL,
0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L,
0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL,
0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL,
0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L,
0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L,
0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L,
0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL,
0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L,
0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL,
0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L,
0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L,
0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL,
0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L,
0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L,
0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L,
0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL,
0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L,
0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL
};
/*
* NAME: crc->calculate()
* DESCRIPTION: compute CRC-32 value (ISO 3309)
*/
unsigned long id3_crc_calculate(id3_byte_t const *data, id3_length_t length)
{
register unsigned long crc;
for (crc = 0xffffffffL; length >= 8; length -= 8) {
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
}
switch (length) {
case 7: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 6: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 5: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 4: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 3: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 2: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 1: crc = crc_table[(crc ^ *data++) & 0xff] ^ (crc >> 8);
case 0: break;
}
return crc ^ 0xffffffffL;
}
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: crc.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_CRC_H
# define LIBID3TAG_CRC_H
# include "id3tag.h"
unsigned long id3_crc_calculate(id3_byte_t const *, id3_length_t);
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: debug.c,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include "global.h"
# undef malloc
# undef calloc
# undef realloc
# undef free
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "debug.h"
# if defined(DEBUG)
# define DEBUG_MAGIC 0xdeadbeefL
struct debug {
char const *file;
unsigned int line;
size_t size;
struct debug *next;
struct debug *prev;
long int magic;
};
static struct debug *allocated;
static int registered;
static
void check(void)
{
struct debug *debug;
for (debug = allocated; debug; debug = debug->next) {
if (debug->magic != DEBUG_MAGIC) {
fprintf(stderr, "memory corruption\n");
break;
}
fprintf(stderr, "%s:%u: leaked %lu bytes\n",
debug->file, debug->line, debug->size);
}
}
void *id3_debug_malloc(size_t size, char const *file, unsigned int line)
{
struct debug *debug;
if (!registered) {
atexit(check);
registered = 1;
}
if (size == 0)
fprintf(stderr, "%s:%u: malloc(0)\n", file, line);
debug = malloc(sizeof(*debug) + size);
if (debug == 0) {
fprintf(stderr, "%s:%u: malloc(%lu) failed\n", file, line, size);
return 0;
}
debug->magic = DEBUG_MAGIC;
debug->file = file;
debug->line = line;
debug->size = size;
debug->next = allocated;
debug->prev = 0;
if (allocated)
allocated->prev = debug;
allocated = debug;
return ++debug;
}
void *id3_debug_calloc(size_t nmemb, size_t size,
char const *file, unsigned int line)
{
void *ptr;
ptr = id3_debug_malloc(nmemb * size, file, line);
if (ptr)
memset(ptr, 0, nmemb * size);
return ptr;
}
void *id3_debug_realloc(void *ptr, size_t size,
char const *file, unsigned int line)
{
struct debug *debug, *new;
if (size == 0) {
id3_debug_free(ptr, file, line);
return 0;
}
if (ptr == 0)
return id3_debug_malloc(size, file, line);
debug = ptr;
--debug;
if (debug->magic != DEBUG_MAGIC) {
fprintf(stderr, "%s:%u: realloc(%p, %lu) memory not allocated\n",
file, line, ptr, size);
return 0;
}
new = realloc(debug, sizeof(*debug) + size);
if (new == 0) {
fprintf(stderr, "%s:%u: realloc(%p, %lu) failed\n", file, line, ptr, size);
return 0;
}
if (allocated == debug)
allocated = new;
debug = new;
debug->file = file;
debug->line = line;
debug->size = size;
if (debug->next)
debug->next->prev = debug;
if (debug->prev)
debug->prev->next = debug;
return ++debug;
}
void id3_debug_free(void *ptr, char const *file, unsigned int line)
{
struct debug *debug;
if (ptr == 0) {
fprintf(stderr, "%s:%u: free(0)\n", file, line);
return;
}
debug = ptr;
--debug;
if (debug->magic != DEBUG_MAGIC) {
fprintf(stderr, "%s:%u: free(%p) memory not allocated\n", file, line, ptr);
return;
}
debug->magic = 0;
if (debug->next)
debug->next->prev = debug->prev;
if (debug->prev)
debug->prev->next = debug->next;
if (allocated == debug)
allocated = debug->next;
free(debug);
}
void *id3_debug_release(void *ptr, char const *file, unsigned int line)
{
struct debug *debug;
if (ptr == 0)
return 0;
debug = ptr;
--debug;
if (debug->magic != DEBUG_MAGIC) {
fprintf(stderr, "%s:%u: release(%p) memory not allocated\n",
file, line, ptr);
return ptr;
}
if (debug->next)
debug->next->prev = debug->prev;
if (debug->prev)
debug->prev->next = debug->next;
if (allocated == debug)
allocated = debug->next;
memmove(debug, debug + 1, debug->size);
return debug;
}
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: debug.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_DEBUG_H
# define LIBID3TAG_DEBUG_H
# include <stdlib.h>
void *id3_debug_malloc(size_t, char const *, unsigned int);
void *id3_debug_calloc(size_t, size_t,
char const *file, unsigned int line);
void *id3_debug_realloc(void *, size_t, char const *, unsigned int);
void id3_debug_free(void *, char const *, unsigned int);
void *id3_debug_release(void *, char const *, unsigned int);
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: field.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_FIELD_H
# define LIBID3TAG_FIELD_H
# include "id3tag.h"
void id3_field_init(union id3_field *, enum id3_field_type);
void id3_field_finish(union id3_field *);
int id3_field_parse(union id3_field *, id3_byte_t const **,
id3_length_t, enum id3_field_textencoding *);
id3_length_t id3_field_render(union id3_field const *, id3_byte_t **,
enum id3_field_textencoding *, int);
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: file.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_FILE_H
# define LIBID3TAG_FILE_H
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: frame.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_FRAME_H
# define LIBID3TAG_FRAME_H
# include "id3tag.h"
int id3_frame_validid(char const *);
void id3_frame_addref(struct id3_frame *);
void id3_frame_delref(struct id3_frame *);
struct id3_frame *id3_frame_parse(id3_byte_t const **, id3_length_t,
unsigned int);
id3_length_t id3_frame_render(struct id3_frame const *, id3_byte_t **, int);
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: frametype.h,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifndef LIBID3TAG_FRAMETYPE_H
# define LIBID3TAG_FRAMETYPE_H
struct id3_frametype {
char const *id;
unsigned int nfields;
enum id3_field_type const *fields;
int defaultflags;
char const *description;
};
extern struct id3_frametype const id3_frametype_text;
extern struct id3_frametype const id3_frametype_url;
extern struct id3_frametype const id3_frametype_experimental;
extern struct id3_frametype const id3_frametype_unknown;
extern struct id3_frametype const id3_frametype_obsolete;
struct id3_frametype const *id3_frametype_lookup(register char const *,
register unsigned int);
# endif
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: genre.c,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
# ifdef HAVE_CONFIG_H
# include "config.h"
# endif
# include "global.h"
# include "id3tag.h"
# include "ucs4.h"
/* genres are stored in ucs4 format */
# include "genre.dat"
# define NGENRES (sizeof(genre_table) / sizeof(genre_table[0]))
/*
* NAME: genre->index()
* DESCRIPTION: return an ID3v1 genre string indexed by number
*/
id3_ucs4_t const *id3_genre_index(unsigned int index)
{
return (index < NGENRES) ? genre_table[index] : 0;
}
/*
* NAME: genre->name()
* DESCRIPTION: translate an ID3v2 genre number/keyword to its full name
*/
id3_ucs4_t const *id3_genre_name(id3_ucs4_t const *string)
{
id3_ucs4_t const *ptr;
static id3_ucs4_t const genre_remix[] = { 'R', 'e', 'm', 'i', 'x', 0 };
static id3_ucs4_t const genre_cover[] = { 'C', 'o', 'v', 'e', 'r', 0 };
unsigned long number;
if (string == 0 || *string == 0)
return id3_ucs4_empty;
if (string[0] == 'R' && string[1] == 'X' && string[2] == 0)
return genre_remix;
if (string[0] == 'C' && string[1] == 'R' && string[2] == 0)
return genre_cover;
for (ptr = string; *ptr; ++ptr) {
if (*ptr < '0' || *ptr > '9')
return string;
}
number = id3_ucs4_getnumber(string);
return (number < NGENRES) ? genre_table[number] : string;
}
/*
* NAME: translate()
* DESCRIPTION: return a canonicalized character for testing genre equivalence
*/
static
id3_ucs4_t translate(id3_ucs4_t ch)
{
if (ch) {
if (ch >= 'A' && ch <= 'Z')
ch += 'a' - 'A';
if (ch < 'a' || ch > 'z')
ch = ID3_UCS4_REPLACEMENTCHAR;
}
return ch;
}
/*
* NAME: compare()
* DESCRIPTION: test two ucs4 genre strings for equivalence
*/
static
int compare(id3_ucs4_t const *str1, id3_ucs4_t const *str2)
{
id3_ucs4_t c1, c2;
if (str1 == str2)
return 1;
do {
do
c1 = translate(*str1++);
while (c1 == ID3_UCS4_REPLACEMENTCHAR);
do
c2 = translate(*str2++);
while (c2 == ID3_UCS4_REPLACEMENTCHAR);
}
while (c1 && c1 == c2);
return c1 == c2;
}
/*
* NAME: genre->number()
* DESCRIPTION: translate an ID3v2 genre name/number to its ID3v1 index number
*/
int id3_genre_number(id3_ucs4_t const *string)
{
id3_ucs4_t const *ptr;
int i;
if (string == 0 || *string == 0)
return -1;
for (ptr = string; *ptr; ++ptr) {
if (*ptr < '0' || *ptr > '9')
break;
}
if (*ptr == 0) {
unsigned long number;
number = id3_ucs4_getnumber(string);
return (number <= 0xff) ? number : -1;
}
for (i = 0; i < NGENRES; ++i) {
if (compare(string, genre_table[i]))
return i;
}
/* no equivalent */
return -1;
}
/*
* libid3tag - ID3 tag manipulation library
* Copyright (C) 2000-2003 Underbit Technologies, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $Id: genre.dat.in,v 1.1 2003/08/14 03:57:13 shank Exp $
*/
/*
* These are the ID3 genre names, taken as a combination of names from ID3v1
* (listed in Appendix A of the ID3 tag version 2.4.0 informal standard) and
* the extensions made by Winamp as of version 2.80.
*/
/* ID3v1 names (0-79) */
Blues
Classic Rock
Country
Dance
Disco
Funk
Grunge
Hip-Hop
Jazz
Metal
New Age
Oldies
Other
Pop
R&B
Rap
Reggae
Rock
Techno
Industrial
Alternative
Ska
Death Metal
Pranks
Soundtrack
Euro-Techno
Ambient
Trip-Hop
Vocal
Jazz+Funk
Fusion
Trance
Classical
Instrumental
Acid
House
Game
Sound Clip
Gospel
Noise
AlternRock
Bass
Soul
Punk
Space
Meditative
Instrumental Pop
Instrumental Rock
Ethnic
Gothic
Darkwave
Techno-Industrial
Electronic
Pop-Folk
Eurodance
Dream
Southern Rock
Comedy
Cult
Gangsta
Top 40
Christian Rap
Pop/Funk
Jungle
Native American
Cabaret
New Wave
Psychedelic
Rave
Showtunes
Trailer
Lo-Fi
Tribal
Acid Punk
Acid Jazz
Polka
Retro
Musical
Rock & Roll
Hard Rock
/* Winamp extensions (80-147) */
Folk
Folk/Rock
National Folk
Swing
Fast-Fusion
Bebob
Latin
Revival
Celtic
Bluegrass
Avantgarde
Gothic Rock
Progressive Rock
Psychedelic Rock
Symphonic Rock
Slow Rock
Big Band
Chorus
Easy Listening
Acoustic
Humour
Speech
Chanson
Opera
Chamber Music
Sonata
Symphony
Booty Bass
Primus
Porn Groove
Satire
Slow Jam
Club
Tango
Samba
Folklore
Ballad
Power Ballad
Rhythmic Soul
Freestyle
Duet
Punk Rock
Drum Solo
A Cappella
Euro-House
Dance Hall
Goa
Drum & Bass
Club-House
Hardcore
Terror
Indie
BritPop
Negerpunk
Polsk Punk
Beat
Christian Gangsta Rap
Heavy Metal
Black Metal
Crossover
Contemporary Christian
Christian Rock
Merengue
Salsa
Thrash Metal
Anime
JPop
Synthpop
This diff is collapsed. Click to expand it.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment