diff options
author | Jamieson Christian | 2002-11-18 09:08:45 +0000 |
---|---|---|
committer | Jamieson Christian | 2002-11-18 09:08:45 +0000 |
commit | 5214cb3463804bda39b10d52e4a7f6ccd943780d (patch) | |
tree | c857f7f0c58bfd65bd5e1e0fb03a0b3c2d434419 /simon/midi.h | |
parent | 713f11d99eb28474bcb8b31942c89e9fa8b66575 (diff) | |
download | scummvm-rg350-5214cb3463804bda39b10d52e4a7f6ccd943780d.tar.gz scummvm-rg350-5214cb3463804bda39b10d52e4a7f6ccd943780d.tar.bz2 scummvm-rg350-5214cb3463804bda39b10d52e4a7f6ccd943780d.zip |
Added support for volume and pause control to Simon music.
Note that MidiStreamer is now used as a streaming wrapper
for ALL MidiDriver types, even those that natively support
streaming. This is because MidiStreamer supports a hybrid
of streamed and non-streamed MIDI, which is necessary to
support interactive events.
svn-id: r5596
Diffstat (limited to 'simon/midi.h')
-rw-r--r-- | simon/midi.h | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/simon/midi.h b/simon/midi.h index 064acca416..3653a37316 100644 --- a/simon/midi.h +++ b/simon/midi.h @@ -28,15 +28,17 @@ struct MidiEvent; class MidiPlayer { public: - void read_all_songs(File *in, uint music); - void read_all_songs_old(File *in, uint music); + MidiPlayer(); + + void read_all_songs (File *in, uint music); + void read_all_songs_old (File *in, uint music); void initialize(); void shutdown(); void play(); - void pause(bool b); - uint get_volume(); - void set_volume(uint volume); - void set_driver(MidiDriver *md); + void pause (bool b); + int get_volume(); + void set_volume (int volume); + void set_driver (MidiDriver *md); private: struct Track { @@ -69,8 +71,9 @@ private: uint _lastDelay; Song *_currentSong; Song _songs[8]; - uint32 _volumeTable[16]; - + byte _volumeTable[16]; // 0-127 + byte _masterVolume; // 0-255 + bool _paused; void read_mthd(File *in, Song *s, bool old, uint music); @@ -79,8 +82,8 @@ private: static uint32 track_read_gamma(Track *t); static byte track_read_byte(Track *t); - int fill(MidiEvent *me, int num_event); - bool fill_helper(NoteRec *nr, MidiEvent *me); + int fill (MidiEvent *me, int num_event); + bool fill_helper (NoteRec *nr, MidiEvent *me); void reset_tracks(); void read_next_note(Track *t, NoteRec *nr); |