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

@@ -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,