aboutsummaryrefslogtreecommitdiffstats
path: root/src/OutputAll.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-26 22:09:42 +0200
committerMax Kellermann <max@duempel.org>2013-09-26 22:21:56 +0200
commit3216f4b25753d566793173c7a4f53a126ac37744 (patch)
tree5a151a5c6f1750011279b50f0c8478787dac46e8 /src/OutputAll.cxx
parentce1d8975751251d49581129193e09490ca650a8b (diff)
downloadmpd-3216f4b25753d566793173c7a4f53a126ac37744.tar.gz
mpd-3216f4b25753d566793173c7a4f53a126ac37744.tar.xz
mpd-3216f4b25753d566793173c7a4f53a126ac37744.zip
MusicBuffer: expose the C++ API
Diffstat (limited to '')
-rw-r--r--src/OutputAll.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/OutputAll.cxx b/src/OutputAll.cxx
index 928a64a91..0b110f5ee 100644
--- a/src/OutputAll.cxx
+++ b/src/OutputAll.cxx
@@ -45,9 +45,9 @@ static struct audio_output **audio_outputs;
static unsigned int num_audio_outputs;
/**
- * The #music_buffer object where consumed chunks are returned.
+ * The #MusicBuffer object where consumed chunks are returned.
*/
-static struct music_buffer *g_music_buffer;
+static MusicBuffer *g_music_buffer;
/**
* The #MusicPipe object which feeds all audio outputs. It is filled
@@ -302,17 +302,16 @@ audio_output_all_play(struct music_chunk *chunk, Error &error)
bool
audio_output_all_open(const AudioFormat audio_format,
- struct music_buffer *buffer,
+ MusicBuffer &buffer,
Error &error)
{
bool ret = false, enabled = false;
unsigned int i;
- assert(buffer != NULL);
- assert(g_music_buffer == NULL || g_music_buffer == buffer);
+ assert(g_music_buffer == NULL || g_music_buffer == &buffer);
assert((g_mp == NULL) == (g_music_buffer == NULL));
- g_music_buffer = buffer;
+ g_music_buffer = &buffer;
/* the audio format must be the same as existing chunks in the
pipe */
@@ -463,7 +462,7 @@ audio_output_all_check(void)
audio_outputs[i]->mutex.unlock();
/* return the chunk to the buffer */
- music_buffer_return(g_music_buffer, shifted);
+ g_music_buffer->Return(shifted);
}
return 0;
@@ -522,7 +521,7 @@ audio_output_all_cancel(void)
/* clear the music pipe and return all chunks to the buffer */
if (g_mp != NULL)
- g_mp->Clear(g_music_buffer);
+ g_mp->Clear(*g_music_buffer);
/* the audio outputs are now waiting for a signal, to
synchronize the cleared music pipe */
@@ -545,7 +544,7 @@ audio_output_all_close(void)
if (g_mp != NULL) {
assert(g_music_buffer != NULL);
- g_mp->Clear(g_music_buffer);
+ g_mp->Clear(*g_music_buffer);
delete g_mp;
g_mp = NULL;
}
@@ -568,7 +567,7 @@ audio_output_all_release(void)
if (g_mp != NULL) {
assert(g_music_buffer != NULL);
- g_mp->Clear(g_music_buffer);
+ g_mp->Clear(*g_music_buffer);
delete g_mp;
g_mp = NULL;
}