aboutsummaryrefslogtreecommitdiff
path: root/sound/softsynth
diff options
context:
space:
mode:
authorJamieson Christian2006-02-27 01:59:07 +0000
committerJamieson Christian2006-02-27 01:59:07 +0000
commit2469e00248423b7d0a8595d0870818c6ebfb40cf (patch)
tree3400500ba27325ba74215e27fc11a92f3b6b334c /sound/softsynth
parent2d2258f5965e0987f61b7667ab248965e770ac93 (diff)
downloadscummvm-rg350-2469e00248423b7d0a8595d0870818c6ebfb40cf.tar.gz
scummvm-rg350-2469e00248423b7d0a8595d0870818c6ebfb40cf.tar.bz2
scummvm-rg350-2469e00248423b7d0a8595d0870818c6ebfb40cf.zip
SysEx data now passed around with const pointers. Permits simplification of some SysEx client code.
Testing on Windows. Developers on other platforms, please verify integrity of music handling in your respective MidiDrivers. svn-id: r20952
Diffstat (limited to 'sound/softsynth')
-rw-r--r--sound/softsynth/adlib.cpp10
-rw-r--r--sound/softsynth/mt32.cpp8
-rw-r--r--sound/softsynth/ym2612.cpp8
3 files changed, 13 insertions, 13 deletions
diff --git a/sound/softsynth/adlib.cpp b/sound/softsynth/adlib.cpp
index 84cb7d3c7e..4c584eb4d6 100644
--- a/sound/softsynth/adlib.cpp
+++ b/sound/softsynth/adlib.cpp
@@ -124,7 +124,7 @@ public:
void allNotesOff();
// SysEx messages
- void sysEx_customInstrument(uint32 type, byte *instr);
+ void sysEx_customInstrument(uint32 type, const byte *instr);
};
// FYI (Jamieson630)
@@ -153,7 +153,7 @@ public:
void sustain(bool value) { }
// SysEx messages
- void sysEx_customInstrument(uint32 type, byte *instr) { }
+ void sysEx_customInstrument(uint32 type, const byte *instr) { }
};
struct Struct10 {
@@ -553,7 +553,7 @@ public:
uint32 property(int prop, uint32 param);
void setPitchBendRange(byte channel, uint range);
- void sysEx_customInstrument(byte channel, uint32 type, byte *instr);
+ void sysEx_customInstrument(byte channel, uint32 type, const byte *instr);
MidiChannel *allocateChannel();
MidiChannel *getPercussionChannel() { return &_percussion; } // Percussion partially supported
@@ -758,7 +758,7 @@ void AdlibPart::allNotesOff() {
_owner->mc_off(_voice);
}
-void AdlibPart::sysEx_customInstrument(uint32 type, byte *instr) {
+void AdlibPart::sysEx_customInstrument(uint32 type, const byte *instr) {
if (type == 'ADL ') {
AdlibInstrument *i = &_part_instr;
memcpy(i, instr, sizeof(AdlibInstrument));
@@ -945,7 +945,7 @@ void MidiDriver_ADLIB::setPitchBendRange(byte channel, uint range) {
}
}
-void MidiDriver_ADLIB::sysEx_customInstrument(byte channel, uint32 type, byte *instr) {
+void MidiDriver_ADLIB::sysEx_customInstrument(byte channel, uint32 type, const byte *instr) {
_parts[channel].sysEx_customInstrument(type, instr);
}
diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp
index 0e840b2b44..0b3b6dffe3 100644
--- a/sound/softsynth/mt32.cpp
+++ b/sound/softsynth/mt32.cpp
@@ -64,7 +64,7 @@ public:
void close();
void send(uint32 b);
void setPitchBendRange (byte channel, uint range);
- void sysEx(byte *msg, uint16 length);
+ void sysEx(const byte *msg, uint16 length);
uint32 property(int prop, uint32 param);
MidiChannel *allocateChannel();
@@ -305,7 +305,7 @@ void MidiDriver_MT32::setPitchBendRange(byte channel, uint range) {
sysEx(benderRangeSysex, 9);
}
-void MidiDriver_MT32::sysEx(byte *msg, uint16 length) {
+void MidiDriver_MT32::sysEx(const byte *msg, uint16 length) {
if (msg[0] == 0xf0) {
_synth->playSysex(msg, length);
} else {
@@ -398,7 +398,7 @@ private:
protected:
void send(uint32 b);
- void sysEx(byte *msg, uint16 length);
+ void sysEx(const byte *msg, uint16 length);
public:
MidiDriver_ThreadedMT32(Audio::Mixer *mixer);
@@ -457,7 +457,7 @@ void MidiDriver_ThreadedMT32::send(uint32 b) {
pushMidiEvent(event);
}
-void MidiDriver_ThreadedMT32::sysEx(byte *msg, uint16 length) {
+void MidiDriver_ThreadedMT32::sysEx(const byte *msg, uint16 length) {
MidiEvent_MT32 *event = new MidiEvent_MT32(0xFFFFFFFF, msg, length);
pushMidiEvent(event);
}
diff --git a/sound/softsynth/ym2612.cpp b/sound/softsynth/ym2612.cpp
index ae50e3011e..49f63abd63 100644
--- a/sound/softsynth/ym2612.cpp
+++ b/sound/softsynth/ym2612.cpp
@@ -150,7 +150,7 @@ public:
void pitchBend(int16 value);
void controlChange(byte control, byte value);
void pitchBendFactor(byte value) { }
- void sysEx_customInstrument(uint32 type, byte *instr);
+ void sysEx_customInstrument(uint32 type, const byte *instr);
};
class MidiDriver_YM2612 : public MidiDriver_Emulated {
@@ -179,7 +179,7 @@ public:
uint32 property(int prop, uint32 param) { return 0; }
void setPitchBendRange(byte channel, uint range) { }
- void sysEx(byte *msg, uint16 length);
+ void sysEx(const byte *msg, uint16 length);
MidiChannel *allocateChannel() { return 0; }
MidiChannel *getPercussionChannel() { return 0; }
@@ -675,7 +675,7 @@ void MidiChannel_YM2612::controlChange(byte control, byte value) {
}
}
-void MidiChannel_YM2612::sysEx_customInstrument(uint32 type, byte *fmInst) {
+void MidiChannel_YM2612::sysEx_customInstrument(uint32 type, const byte *fmInst) {
if (type != 'EUP ')
return;
Voice2612 *voice = new Voice2612;
@@ -798,7 +798,7 @@ void MidiDriver_YM2612::send(byte chan, uint32 b) {
}
}
-void MidiDriver_YM2612::sysEx(byte *msg, uint16 length) {
+void MidiDriver_YM2612::sysEx(const byte *msg, uint16 length) {
if (msg[0] != 0x7C || msg[1] >= ARRAYSIZE(_channel))
return;
_channel[msg[1]]->sysEx_customInstrument('EUP ', &msg[2]);