mod_plugin, just for tarzeau

git-svn-id: https://svn.musicpd.org/mpd/trunk@1263 09075e82-0dd4-0310-85a5-a0d7c8717e4f
This commit is contained in:
Warren Dukes 2004-05-31 20:59:55 +00:00
parent 2c1f5365eb
commit d9f5cca9b8
9 changed files with 49 additions and 3 deletions

View File

@ -40,8 +40,9 @@ 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(aac,[ --disable-aac disable AAC support],,enable_aac=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(mod,[ --disable-mod disable MOD support],,enable_mod=yes)
AC_ARG_ENABLE(id3,[ --disable-id3 disable id3 support],,enable_id3=yes)
AC_ARG_ENABLE(mpd_mad,[ --enable-mpd-mad use mpd libmad],use_mpd_mad=yes,)
AC_ARG_ENABLE(mpd_id3tag,[ --enable-mpd-id3tag use mpd libid3tag],use_mpd_id3tag=yes,)
AC_ARG_WITH(iconv,[ --with-iconv=PFX Prefix where iconv is installed (optional)], iconv_prefix="$withval", iconv_prefix="")
@ -473,6 +474,14 @@ if test x$enable_audiofile = xyes; then
AC_DEFINE(HAVE_AUDIOFILE,1,[Define for audiofile support])
fi
if test x$enable_mod = xyes; then
AM_PATH_LIBMIKMOD(3.1.7, MPD_CFLAGS="$MPD_CFLAGS $LIBMIKMOD_CFLAGS"
MPD_LIBS="$MPD_LIBS $LIBMIKMOD_LIBS", enable_mod=no)
if test x$enable_mod = xyes; then
AC_DEFINE(HAVE_MIKMOD, 1, [Define for mikmod support])
fi
fi
AC_OUTPUT(src/mp4ff/Makefile doc/Makefile src/Makefile Makefile )
echo ""
@ -565,6 +574,12 @@ else
echo "MP4/AAC support ...............disabled"
fi
if test x$enable_mod = xyes; then
echo "MOD support ...................enabled"
else
echo "MOD support ...................disabled"
fi
echo ""
echo "##########################################"
echo ""

View File

@ -3,7 +3,8 @@ SUBDIRS = $(ID3_SUBDIR) $(MAD_SUBDIR) $(MP4FF_SUBDIR)
mpd_inputPlugins = inputPlugins/mp3_plugin.c inputPlugins/ogg_plugin.c \
inputPlugins/flac_plugin.c inputPlugins/audiofile_plugin.c \
inputPlugins/mp4_plugin.c inputPlugins/aac_plugin.c
inputPlugins/mp4_plugin.c inputPlugins/aac_plugin.c \
inputPlugins/mod_plugin.c
mpd_headers = buffer2array.h interface.h command.h playlist.h ls.h \
song.h list.h directory.h tables.h utils.h path.h \

View File

@ -11,10 +11,13 @@ void loadInputPlugin(InputPlugin * inputPlugin) {
if(!inputPlugin) return;
if(!inputPlugin->name) return;
if(inputPlugin->initFunc && inputPlugin->initFunc() < 0) return;
insertInList(inputPlugin_list, inputPlugin->name, (void *)inputPlugin);
}
void unloadInputPlugin(InputPlugin * inputPlugin) {
if(inputPlugin->finishFunc) inputPlugin->finishFunc();
deleteFromList(inputPlugin_list, inputPlugin->name);
}
@ -73,6 +76,7 @@ extern InputPlugin flacPlugin;
extern InputPlugin audiofilePlugin;
extern InputPlugin mp4Plugin;
extern InputPlugin aacPlugin;
extern InputPlugin modPlugin;
void initInputPlugins() {
inputPlugin_list = makeList(NULL);
@ -83,7 +87,7 @@ void initInputPlugins() {
loadInputPlugin(&flacPlugin);
loadInputPlugin(&audiofilePlugin);
loadInputPlugin(&mp4Plugin);
loadInputPlugin(&aacPlugin);
loadInputPlugin(&modPlugin);
}
void finishInputPlugins() {

View File

@ -10,6 +10,10 @@
#define INPUT_PLUGIN_STREAM_FILE 0x01
#define INPUT_PLUGIN_STREAM_URL 0x02
typedef int (* InputPlugin_initFunc) ();
typedef void (* InputPlugin_finishFunc) ();
typedef int (* InputPlugin_streamDecodeFunc) (OutputBuffer *, DecoderControl *,
InputStream *);
@ -21,6 +25,8 @@ typedef MpdTag * (* InputPlugin_tagDupFunc) (char * file);
typedef struct _InputPlugin {
char * name;
InputPlugin_initFunc initFunc;
InputPlugin_finishFunc finishFunc;
InputPlugin_streamDecodeFunc streamDecodeFunc;
InputPlugin_fileDecodeFunc fileDecodeFunc;
InputPlugin_tagDupFunc tagDupFunc;

View File

@ -415,6 +415,8 @@ InputPlugin aacPlugin =
{
"aac",
NULL,
NULL,
NULL,
aac_decode,
aacTagDup,
INPUT_PLUGIN_STREAM_FILE,
@ -430,6 +432,8 @@ InputPlugin aacPlugin =
NULL,
NULL,
NULL,
NULL,
NULL,
0,
NULL,
NULL,

View File

@ -555,6 +555,8 @@ InputPlugin flacPlugin =
{
"flac",
NULL,
NULL,
NULL,
flac_decode,
flacTagDup,
INPUT_PLUGIN_STREAM_FILE,
@ -570,6 +572,8 @@ InputPlugin flacPlugin =
NULL,
NULL,
NULL,
NULL,
NULL,
0,
NULL,
NULL,

View File

@ -634,6 +634,8 @@ char * mp3_mimeTypes[] = {"audio/mpeg", NULL};
InputPlugin mp3Plugin =
{
"mp3",
NULL,
NULL,
mp3_decode,
NULL,
mp3_tagDup,
@ -649,6 +651,8 @@ InputPlugin mp3Plugin =
NULL,
NULL,
NULL,
NULL,
NULL,
0,
NULL,
NULL

View File

@ -403,6 +403,8 @@ InputPlugin mp4Plugin =
{
"mp4",
NULL,
NULL,
NULL,
mp4_decode,
mp4TagDup,
INPUT_PLUGIN_STREAM_FILE,
@ -417,6 +419,8 @@ InputPlugin mp4Plugin =
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
0,
NULL,

View File

@ -335,6 +335,8 @@ char * oggMimeTypes[] = {"application/ogg", NULL};
InputPlugin oggPlugin =
{
"ogg",
NULL,
NULL,
ogg_decode,
NULL,
oggTagDup,
@ -347,6 +349,8 @@ InputPlugin oggPlugin =
InputPlugin oggPlugin =
{
NULL,
NULL,
NULL,
NULL,
NULL,