aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2004-10-10 13:51:33 +0000
committerWarren Dukes <warren.dukes@gmail.com>2004-10-10 13:51:33 +0000
commitd05c3b510e0e9c197c57895eaa4e80030c26a95e (patch)
tree20aeb70144a03c586038df2277bb823c47f886bb
parentde48cf67b4cde400ee16687b97449314717abe62 (diff)
downloadmpd-d05c3b510e0e9c197c57895eaa4e80030c26a95e.tar.gz
mpd-d05c3b510e0e9c197c57895eaa4e80030c26a95e.tar.xz
mpd-d05c3b510e0e9c197c57895eaa4e80030c26a95e.zip
add audioOutput.c
git-svn-id: https://svn.musicpd.org/mpd/trunk@2205 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/audioOutput.c43
-rw-r--r--src/audioOutput.h6
-rw-r--r--src/utf8.h1
3 files changed, 49 insertions, 1 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c
new file mode 100644
index 000000000..aedfda59f
--- /dev/null
+++ b/src/audioOutput.c
@@ -0,0 +1,43 @@
+#include <audioOutput.h>
+
+#include <list.h>
+
+static List * audioOutputPluginList;
+
+void loadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin) {
+ insertInList(audioOutputPluginList, audioOutputPlugin->name,
+ audioOutputPlugin);
+}
+
+void unloadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin) {
+ deleteFromList(audioOutputPluginList, audioOutputPlugin->name);
+}
+
+void initAudioOutputPlugins() {
+ audioOutputPluginList = makeList(NULL);
+}
+
+void finishAudioOutputPlugins() {
+ freeList(audioOutputPluginList);
+}
+
+AudioOutput * newAudioOutput(char * name) {
+ AudioOutput * ret = NULL;
+ void * data = NULL;
+
+ if(findInList(audioOutputPluginList, name, &data)) {
+ AudioOutputPlugin * plugin = (AudioOutputPlugin *) data;
+ ret = malloc(sizeof(AudioOutput));
+ ret->initConfigFunc = plugin->initConfigFunc;
+ ret->finishConfigFunc = plugin->finishConfigFunc;
+ ret->initDriverFunc = plugin->initDriverFunc;
+ ret->finishDriverFunc = plugin->initDriverFunc;
+ ret->openDeviceFunc = plugin->openDeviceFunc;
+ ret->playFunc = plugin->playFunc;
+ ret->closeDeviceFunc = plugin->closeDeviceFunc;
+ }
+
+ return ret;
+}
+
+void closeAudioOutput(AudioOutput * audioOutput);
diff --git a/src/audioOutput.h b/src/audioOutput.h
index 30d3b996e..1a01263b8 100644
--- a/src/audioOutput.h
+++ b/src/audioOutput.h
@@ -69,4 +69,10 @@ typedef struct _AudioOutputPlugin {
AudioOutputCloseDevicFunc closeDeviceFunc;
} AudioOutputPlugin;
+void loadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin);
+void unloadAudioOutputPlugin(AudioOutputPlugin * audioOutputPlugin);
+
+AudioOutput * newAudioOutput(char * name);
+void closeAudioOutput(AudioOutput * audioOutput);
+
#endif
diff --git a/src/utf8.h b/src/utf8.h
index 75f1b3226..ef3af91f5 100644
--- a/src/utf8.h
+++ b/src/utf8.h
@@ -26,4 +26,3 @@ unsigned char * utf8StrToLatin1Dup(unsigned char * utf8);
int validUtf8String(unsigned char * string);
#endif
-/* vim:set shiftwidth=4 tabstop=8 expandtab: */