aboutsummaryrefslogtreecommitdiff
path: root/sound/midistreamer.h
diff options
context:
space:
mode:
authorMax Horn2002-12-11 16:09:58 +0000
committerMax Horn2002-12-11 16:09:58 +0000
commitbf62494fd5fc578a609b5986237035997c214b15 (patch)
tree68c3f90d9ddd0f93fafc1c84548e611d458d88de /sound/midistreamer.h
parent5bf87dd3682af7de77fd0fff8d182087ebc8151a (diff)
downloadscummvm-rg350-bf62494fd5fc578a609b5986237035997c214b15.tar.gz
scummvm-rg350-bf62494fd5fc578a609b5986237035997c214b15.tar.bz2
scummvm-rg350-bf62494fd5fc578a609b5986237035997c214b15.zip
ripped out obsolete midi streaming code from backends (this may break Alsa/SEQ/Windows/Morphos compile, I tried my best, but you'll have to clean up after me)
svn-id: r5905
Diffstat (limited to 'sound/midistreamer.h')
-rw-r--r--sound/midistreamer.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/sound/midistreamer.h b/sound/midistreamer.h
index d2b70bed86..f1158e8b45 100644
--- a/sound/midistreamer.h
+++ b/sound/midistreamer.h
@@ -27,11 +27,19 @@ class MidiStreamer;
#include "mididrv.h"
class MidiStreamer : public MidiDriver {
+public:
+ /* called whenever the midi driver is in streaming mode,
+ * and more midi commands need to be generated
+ * return 0 to tell the mididriver that the end of stream was reached
+ */
+ typedef int StreamCallback (void *param, MidiEvent * ev, int num);
+
private:
+
MidiDriver *_target;
StreamCallback *_stream_proc;
void *_stream_param;
- int _mode;
+ bool _isOpen;
bool _paused;
MidiEvent _events [64];
@@ -43,19 +51,21 @@ private:
uint16 _ticks_per_beat;
long _delay;
- uint32 property(int prop, uint32 param);
static void timer_thread (void *param);
void on_timer();
public:
+
MidiStreamer (MidiDriver *target);
- int open(int mode);
+ int open();
void close();
- void send(uint32 b) { if (_mode) _target->send (b); }
+ void send(uint32 b) { if (_isOpen) _target->send (b); }
+ uint32 property(int prop, uint32 param);
+ void setPitchBendRange (byte channel, uint range) { _target->setPitchBendRange (channel, range); }
+
void pause(bool p) { _paused = p; }
void set_stream_callback(void *param, StreamCallback *sc);
- void setPitchBendRange (byte channel, uint range) { _target->setPitchBendRange (channel, range); }
void setTimerCallback (void *timer_param, void (*timer_proc) (void *)) { }
uint32 getBaseTempo (void) { return _target->getBaseTempo(); }