diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-05-30 00:39:12 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-05-30 00:39:12 +0000 |
commit | 94786c5f8af9dcbc291d7ebd35c0477bec4c4f9e (patch) | |
tree | b9b5ae273e394e1bad805be36bb115aa5d1a6590 /src/input_plugin.h | |
parent | b65ec79c1651b10a3f5ce4fe21bbd2f829fff72a (diff) | |
download | mpd-94786c5f8af9dcbc291d7ebd35c0477bec4c4f9e.tar.gz mpd-94786c5f8af9dcbc291d7ebd35c0477bec4c4f9e.tar.xz mpd-94786c5f8af9dcbc291d7ebd35c0477bec4c4f9e.zip |
input plugin sheme
git-svn-id: https://svn.musicpd.org/mpd/trunk@1233 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to 'src/input_plugin.h')
-rw-r--r-- | src/input_plugin.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/input_plugin.h b/src/input_plugin.h new file mode 100644 index 000000000..8a7efeb7d --- /dev/null +++ b/src/input_plugin.h @@ -0,0 +1,48 @@ +#ifndef INPUT_PLUGIN_H +#define INPUT_PLUGIN_H + +#define INPUT_PLUGIN_STREAM_FILE 0x01 +#define INPUT_PLUGIN_STREAM_URL 0x02 + +#define INPUT_PLUGIN_NAME_LENGTH 64 + +typedef int (* InputPlugin_streamDecodeFunc) (OutputBuffer *, DecoderControl *, + InputStream *); + +typedef int (* InputPlugin_fileDecodeFunc) (OutputBuffer *, DecoderControl *); + +typedef MpdTag * (* InputPlugin_tagDupFunc) (char * utf8file); + +typedef struct _InputPlugin { + char name[INPUT_PLUGIN_NAME_LENGTH]; + InputPlugin_streamDecodeFunc streamDecodeFunc; + InputPlugin_fileDecodeFunc fileDecodeFunc; + InputPlugin_tagDupFunc tagDupFunc; + unsigned char streamTypes; + char ** suffixes; + char ** mimeTypes; +} InputPlugin; + +/* interface for adding and removing plugins */ + +InputPlugin * newInputPlugin(); + +void addSuffixToInputPlugin(InputPlugin * inPlugin, char * suffix); + +void addMimeTypeToInputPlugin(InputPlugin * inPlugin, char * suffix); + +void freeInputPlugin(InputPlugin * inputPlugin); + +/* interface for using plugins */ + +InputPlugin * getInputPluginFromSuffix(char * suffix); + +InputPlugin * getInputPluginFromMimeTypes(char * mimeType); + +InputPlugin * getInputPluginFromName(char * name); + +/* this is needed b/c shoutcast and such don't indicate the proper mime type + and don't have a suffix in the url! */ +InputPlugin * getDefaultInputPlugin(); + +#endif |