144 |
} |
} |
145 |
|
|
146 |
void EngineChannel::SetMidiInstrumentMapToNone() { |
void EngineChannel::SetMidiInstrumentMapToNone() { |
147 |
|
if (iMidiInstrumentMap == NO_MIDI_INSTRUMENT_MAP) return; |
148 |
iMidiInstrumentMap = NO_MIDI_INSTRUMENT_MAP; |
iMidiInstrumentMap = NO_MIDI_INSTRUMENT_MAP; |
149 |
|
StatusChanged(true); |
150 |
} |
} |
151 |
|
|
152 |
void EngineChannel::SetMidiInstrumentMapToDefault() { |
void EngineChannel::SetMidiInstrumentMapToDefault() { |
153 |
|
if (iMidiInstrumentMap == DEFAULT_MIDI_INSTRUMENT_MAP) return; |
154 |
iMidiInstrumentMap = DEFAULT_MIDI_INSTRUMENT_MAP; |
iMidiInstrumentMap = DEFAULT_MIDI_INSTRUMENT_MAP; |
155 |
|
StatusChanged(true); |
156 |
} |
} |
157 |
|
|
158 |
void EngineChannel::SetMidiInstrumentMap(int MidiMap) throw (Exception) { |
void EngineChannel::SetMidiInstrumentMap(int MidiMap) throw (Exception) { |
159 |
|
if (iMidiInstrumentMap == MidiMap) return; |
160 |
|
|
161 |
// check if given map actually exists in the MIDI instrument mapper |
// check if given map actually exists in the MIDI instrument mapper |
162 |
std::vector<int> maps = MidiInstrumentMapper::Maps(); |
std::vector<int> maps = MidiInstrumentMapper::Maps(); |
163 |
if (find(maps.begin(), maps.end(), MidiMap) == maps.end()) |
if (find(maps.begin(), maps.end(), MidiMap) == maps.end()) |
164 |
throw Exception("MIDI instrument map doesn't exist"); |
throw Exception("MIDI instrument map doesn't exist"); |
165 |
iMidiInstrumentMap = MidiMap; // assign the new map ID |
iMidiInstrumentMap = MidiMap; // assign the new map ID |
166 |
|
StatusChanged(true); |
167 |
} |
} |
168 |
|
|
169 |
void EngineChannel::SetMidiRpnControllerMsb(uint8_t CtrlMSB) { |
void EngineChannel::SetMidiRpnControllerMsb(uint8_t CtrlMSB) { |