909 |
} |
} |
910 |
} |
} |
911 |
|
|
912 |
|
/** @brief Order resuming of script execution instance "now". |
913 |
|
* |
914 |
|
* Called by real-time instrument script function stop_wait() to resume a |
915 |
|
* script callback currently being suspended (i.e. due to a wait() script |
916 |
|
* function call). |
917 |
|
* |
918 |
|
* @param itCallback - suspended script callback to be resumed |
919 |
|
* @param now - current scheduler time to be "now" |
920 |
|
* @param forever - whether this particulare script callback should ignore |
921 |
|
* all subsequent wait*() script function calls |
922 |
|
*/ |
923 |
|
void AbstractEngineChannel::ScheduleResumeOfScriptCallback(RTList<ScriptEvent>::Iterator& itCallback, sched_time_t now, bool forever) { |
924 |
|
// ignore if invalid iterator was passed |
925 |
|
if (!itCallback) return; |
926 |
|
|
927 |
|
ScriptEvent* pCallback = &*itCallback; |
928 |
|
|
929 |
|
// mark this callback to ignore all subsequent built-in wait*() script function calls |
930 |
|
if (forever) pCallback->ignoreAllWaitCalls = true; |
931 |
|
|
932 |
|
// ignore if callback is not in the scheduler queue |
933 |
|
if (pCallback->currentSchedulerQueue() != &pScript->suspendedEvents) return; |
934 |
|
|
935 |
|
// ignore if callback is already scheduled to be resumed "now" |
936 |
|
if (pCallback->scheduleTime <= now) return; |
937 |
|
|
938 |
|
// take it out from the scheduler queue and re-insert callback |
939 |
|
// to schedule the script callback for resuming execution "now" |
940 |
|
pScript->suspendedEvents.erase(*pCallback); |
941 |
|
pCallback->scheduleTime = now + 1; |
942 |
|
pScript->suspendedEvents.insert(*pCallback); |
943 |
|
} |
944 |
|
|
945 |
FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) { |
FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) { |
946 |
if (pEngine) pEngine->DisableAndLock(); |
if (pEngine) pEngine->DisableAndLock(); |
947 |
FxSend* pFxSend = new FxSend(this, MidiCtrl, Name); |
FxSend* pFxSend = new FxSend(this, MidiCtrl, Name); |