diff options
author | Warren Dukes <warren.dukes@gmail.com> | 2004-10-20 16:05:13 +0000 |
---|---|---|
committer | Warren Dukes <warren.dukes@gmail.com> | 2004-10-20 16:05:13 +0000 |
commit | 608ac668db2dfc4ca5e1b3c68d432086476dd074 (patch) | |
tree | 18a9cf49ef3383cc2dbe9351ae70119e7eda69a0 /src/audioOutput.c | |
parent | 4951f9f809d1c06f675d25fec7a92b8fae8bea51 (diff) | |
download | mpd-608ac668db2dfc4ca5e1b3c68d432086476dd074.tar.gz mpd-608ac668db2dfc4ca5e1b3c68d432086476dd074.tar.xz mpd-608ac668db2dfc4ca5e1b3c68d432086476dd074.zip |
some work on the new audioOutput layer
git-svn-id: https://svn.musicpd.org/mpd/trunk@2277 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r-- | src/audioOutput.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/audioOutput.c b/src/audioOutput.c index aedfda59f..ff0c614a2 100644 --- a/src/audioOutput.c +++ b/src/audioOutput.c @@ -28,16 +28,30 @@ AudioOutput * newAudioOutput(char * name) { 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; + + plugin->initDriverFunc(ret); } return ret; } -void closeAudioOutput(AudioOutput * audioOutput); +int openAudioOutput(AudioOutput * audioOutput, AudioFormat * audioFormat) { + return audioOutput->openDeviceFunc(audioOutput, audioFormat); +} + +int playAudioOutput(AudioOutput * audioOutput, char * playChunk, int size) { + return audioOutput->playFunc(audioOutput, playChunk, size); +} + +void closeAudioOutput(AudioOutput * audioOutput) { + audioOutput->closeDeviceFunc(audioOutput); +} + +void finishAudioOutput(AudioOutput * audioOutput) { + audioOutput->finishDriverFunc(audioOutput); + free(audioOutput); +} |