aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sfx/sci_midi.h
diff options
context:
space:
mode:
authorFilippos Karapetis2009-10-22 07:18:37 +0000
committerFilippos Karapetis2009-10-22 07:18:37 +0000
commit93517e7649da286cd5b86efb3ee2e5cf7e7be436 (patch)
treee3f3e4ffa263dd8ec3768187f48707e7bcf1576b /engines/sci/sfx/sci_midi.h
parentf79d3bb7cd181326e8ddba5d7f5a43a3871dac65 (diff)
downloadscummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.tar.gz
scummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.tar.bz2
scummvm-rg350-93517e7649da286cd5b86efb3ee2e5cf7e7be436.zip
Applied a modified version of patch #2881486 - "Add volume changing to SCI"
svn-id: r45329
Diffstat (limited to 'engines/sci/sfx/sci_midi.h')
-rw-r--r--engines/sci/sfx/sci_midi.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/sci/sfx/sci_midi.h b/engines/sci/sfx/sci_midi.h
index 9facca27b8..623dbd9f33 100644
--- a/engines/sci/sfx/sci_midi.h
+++ b/engines/sci/sfx/sci_midi.h
@@ -35,7 +35,8 @@ namespace Sci {
class ResourceManager;
enum {
- MIDI_CHANNELS = 16
+ MIDI_CHANNELS = 16,
+ MIDI_PROP_MASTER_VOLUME = 0
};
@@ -80,12 +81,14 @@ public:
virtual int getPolyphony() const = 0;
virtual void setVolume(byte volume) {
- // Master Volume SysEx message
- const byte message[] = {0x7f, 0x7f, 0x04, 0x01, (volume * 127 / 15) & 0x7f, (volume * 127 / 15) & 0x7f};
-
- _driver->sysEx(message, 6);
+ if(_driver)
+ _driver->property(MIDI_PROP_MASTER_VOLUME, volume);
}
+ virtual int getVolume() {
+ return _driver ? _driver->property(MIDI_PROP_MASTER_VOLUME, -1) : 0;
+ }
+
virtual void playSwitch(bool play) {
if (!play) {
// Send "All Sound Off" on all channels