39 |
bool bChangeInstrument; ///< Set to true by the loader when the channel should change instrument. |
bool bChangeInstrument; ///< Set to true by the loader when the channel should change instrument. |
40 |
I* pInstrument; ///< The new instrument. Also used by the loader to read the previously loaded instrument. |
I* pInstrument; ///< The new instrument. Also used by the loader to read the previously loaded instrument. |
41 |
RTList<R*>* pRegionsInUse; ///< List of dimension regions in use by the currently loaded instrument. Continuously updated by the audio thread. |
RTList<R*>* pRegionsInUse; ///< List of dimension regions in use by the currently loaded instrument. Continuously updated by the audio thread. |
42 |
InstrumentScript* pScript; ///< Instrument script to be executed for this instrument, or NULL if instrument does not have a script. |
InstrumentScript* pScript; ///< Instrument script to be executed for this instrument. This is never NULL, it is always a valid InstrumentScript pointer. Use InstrumentScript::bHasValidScript whether it reflects a valid instrument script to be executed. |
43 |
}; |
}; |
44 |
|
|
45 |
template<class R> |
template<class R> |
289 |
template<class TV, class TRR, class TR, class TD, class TIM, class TI> friend class EngineBase; |
template<class TV, class TRR, class TR, class TD, class TIM, class TI> friend class EngineBase; |
290 |
|
|
291 |
protected: |
protected: |
292 |
EngineChannelBase() : InstrumentChangeCommandReader(InstrumentChangeCommand) { |
EngineChannelBase() : |
293 |
|
MidiKeyboardManager<V>(this), |
294 |
|
InstrumentChangeCommandReader(InstrumentChangeCommand) |
295 |
|
{ |
296 |
pInstrument = NULL; |
pInstrument = NULL; |
297 |
|
|
298 |
// reset the instrument change command struct (need to be done |
// reset the instrument change command struct (need to be done |
391 |
void UnloadScriptInUse() { |
void UnloadScriptInUse() { |
392 |
{ |
{ |
393 |
InstrumentChangeCmd<R, I>& cmd = InstrumentChangeCommand.GetConfigForUpdate(); |
InstrumentChangeCmd<R, I>& cmd = InstrumentChangeCommand.GetConfigForUpdate(); |
394 |
if (cmd.pScript) pScript->unload(); |
if (cmd.pScript) cmd.pScript->unload(); |
395 |
} |
} |
396 |
{ |
{ |
397 |
InstrumentChangeCmd<R, I>& cmd = InstrumentChangeCommand.SwitchConfig(); |
InstrumentChangeCmd<R, I>& cmd = InstrumentChangeCommand.SwitchConfig(); |
398 |
if (cmd.pScript) pScript->unload(); |
if (cmd.pScript) cmd.pScript->unload(); |
399 |
} |
} |
400 |
|
InstrumentChangeCommand.SwitchConfig(); // switch back to original one |
401 |
} |
} |
402 |
|
|
403 |
/** |
/** |