aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorOliver Kiehl2002-11-17 17:15:29 +0000
committerOliver Kiehl2002-11-17 17:15:29 +0000
commit128580df1e7611d1d8a5955f2eb43ef8b58c5fa9 (patch)
tree5c9463a0d6ff8a50b9f2470cef67ddd38a292dff /simon
parent5ae9b1e05b38a60e473257db9bc7bd37fe55de20 (diff)
downloadscummvm-rg350-128580df1e7611d1d8a5955f2eb43ef8b58c5fa9.tar.gz
scummvm-rg350-128580df1e7611d1d8a5955f2eb43ef8b58c5fa9.tar.bz2
scummvm-rg350-128580df1e7611d1d8a5955f2eb43ef8b58c5fa9.zip
added structures for midi pause/volume
svn-id: r5591
Diffstat (limited to 'simon')
-rw-r--r--simon/midi.cpp15
-rw-r--r--simon/midi.h3
-rw-r--r--simon/simon.cpp8
-rw-r--r--simon/simon.h2
4 files changed, 28 insertions, 0 deletions
diff --git a/simon/midi.cpp b/simon/midi.cpp
index 717093aaae..04b727dd77 100644
--- a/simon/midi.cpp
+++ b/simon/midi.cpp
@@ -417,6 +417,21 @@ void MidiPlayer::play()
_midiDriver->pause(false);
}
+void MidiPlayer::pause(bool b)
+{
+ _midiDriver->pause(b);
+}
+
+uint MidiPlayer::get_volume()
+{
+ // TODO: implement me
+ return 0;
+}
+
+void MidiPlayer::set_volume(uint volume)
+{
+ // TODO: implement me
+}
void MidiPlayer::set_driver(MidiDriver *md)
{
diff --git a/simon/midi.h b/simon/midi.h
index a3f443b99a..064acca416 100644
--- a/simon/midi.h
+++ b/simon/midi.h
@@ -33,6 +33,9 @@ public:
void initialize();
void shutdown();
void play();
+ void pause(bool b);
+ uint get_volume();
+ void set_volume(uint volume);
void set_driver(MidiDriver *md);
private:
diff --git a/simon/simon.cpp b/simon/simon.cpp
index b8aef5e9b3..de26fc38c8 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -153,6 +153,8 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst)
_effects_sound = 0;
_voice_sound = 0;
_ambient_sound = 0;
+
+ _music_playing = false;
}
SimonState::~SimonState()
@@ -4608,6 +4610,12 @@ void SimonState::delay(uint amount)
case OSystem::EVENT_KEYDOWN:
if (event.kbd.keycode == 't') {
_vk_t_toggle ^= 1;
+ } else if (event.kbd.keycode == '+') {
+ midi.set_volume(midi.get_volume() + 10);
+ } else if (event.kbd.keycode == '-') {
+ midi.set_volume(midi.get_volume() - 10);
+ } else if (event.kbd.keycode == 'm') {
+ midi.pause(_music_playing ^= 1);
} else if (event.kbd.flags == OSystem::KBD_CTRL) {
if (event.kbd.keycode == 'f') {
_fast_mode ^= 1;
diff --git a/simon/simon.h b/simon/simon.h
index 8ee3df6259..992b47ece8 100644
--- a/simon/simon.h
+++ b/simon/simon.h
@@ -341,6 +341,8 @@ public:
int _ambient_index;
uint _ambient_playing;
+ bool _music_playing;
+
int _timer_id;
FILE *_dump_file;