diff options
Diffstat (limited to 'src/audioOutput.c')
-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); +} |