summaryrefslogtreecommitdiff
path: root/src/mixer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mixer.h')
-rw-r--r--src/mixer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mixer.h b/src/mixer.h
index 0ccee6109..9766682d6 100644
--- a/src/mixer.h
+++ b/src/mixer.h
@@ -14,6 +14,14 @@
struct MixerChannel;
+/**
+ * Type of callback functions for supplying PCM music.
+ * A music decoder/renderer implements this function and installs it with MxSetMusicSource, which also returns the sample rate used.
+ * @param buffer Pointer to interleaved 2-channel signed 16 bit PCM data buffer, guaranteed to be 0-initialized.
+ * @param samples number of samples that must be filled into \c buffer.
+ */
+typedef void(*MxStreamCallback)(int16 *buffer, size_t samples);
+
bool MxInitialize(uint rate);
void MxMixSamples(void *buffer, uint samples);
@@ -22,4 +30,6 @@ void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, size_t size, uint rate, boo
void MxSetChannelVolume(MixerChannel *mc, uint volume, float pan);
void MxActivateChannel(MixerChannel*);
+uint32 MxSetMusicSource(MxStreamCallback music_callback);
+
#endif /* MIXER_H */