summaryrefslogtreecommitdiff
path: root/mixer.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-03-12 09:38:03 +0000
committertron <tron@openttd.org>2005-03-12 09:38:03 +0000
commitf04780e66d038b0fc9f376dcec1e77d2d94ae29b (patch)
tree340956851983446ee2f0d5ae554a95a5a94cbbca /mixer.h
parent70be35f319ecf29f81332ef124475b8ed748d5e4 (diff)
downloadopenttd-f04780e66d038b0fc9f376dcec1e77d2d94ae29b.tar.xz
(svn r2000) Split the sound system into backend (mixer.[ch]) and frontend (sound.[ch])
Diffstat (limited to 'mixer.h')
-rw-r--r--mixer.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/mixer.h b/mixer.h
new file mode 100644
index 000000000..86ace050d
--- /dev/null
+++ b/mixer.h
@@ -0,0 +1,24 @@
+#ifndef MIXER_H
+#define MIXER_H
+
+typedef struct Mixer Mixer;
+typedef struct MixerChannel MixerChannel;
+
+enum {
+ MX_AUTOFREE = 1,
+// MX_8BIT = 2,
+// MX_STEREO = 4,
+// MX_UNSIGNED = 8,
+};
+
+VARDEF Mixer *_mixer;
+
+bool MxInitialize(uint rate);
+void MxMixSamples(Mixer *mx, void *buffer, uint samples);
+
+MixerChannel *MxAllocateChannel(Mixer *mx);
+void MxSetChannelRawSrc(MixerChannel *mc, int8 *mem, uint size, uint rate, uint flags);
+void MxSetChannelVolume(MixerChannel *mc, uint left, uint right);
+void MxActivate(MixerChannel*);
+
+#endif