aboutsummaryrefslogtreecommitdiffstats
path: root/src/audioOutput.c
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 /src/audioOutput.c
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
Diffstat (limited to 'src/audioOutput.c')
-rw-r--r--src/audioOutput.c43
1 files changed, 43 insertions, 0 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);