783 |
case VirtualMidiDevice::EVENT_TYPE_PROGRAM: |
case VirtualMidiDevice::EVENT_TYPE_PROGRAM: |
784 |
SendProgramChange(devEvent.Arg1); |
SendProgramChange(devEvent.Arg1); |
785 |
continue; // don't push this event into FIFO |
continue; // don't push this event into FIFO |
786 |
|
case VirtualMidiDevice::EVENT_TYPE_CHPRESSURE: |
787 |
|
event.Type = Event::type_channel_pressure; |
788 |
|
event.Param.ChannelPressure.Controller = CTRL_TABLE_IDX_AFTERTOUCH; |
789 |
|
event.Param.ChannelPressure.Value = devEvent.Arg2; |
790 |
|
event.Param.ChannelPressure.Channel = channel; |
791 |
|
break; |
792 |
default: |
default: |
793 |
std::cerr << "AbstractEngineChannel::ImportEvents() ERROR: unknown event type (" |
std::cerr << "AbstractEngineChannel::ImportEvents() ERROR: unknown event type (" |
794 |
<< devEvent.Type << "). This is a bug!"; |
<< devEvent.Type << "). This is a bug!"; |
915 |
} |
} |
916 |
} |
} |
917 |
|
|
918 |
|
/** @brief Order resuming of script execution instance "now". |
919 |
|
* |
920 |
|
* Called by real-time instrument script function stop_wait() to resume a |
921 |
|
* script callback currently being suspended (i.e. due to a wait() script |
922 |
|
* function call). |
923 |
|
* |
924 |
|
* @param itCallback - suspended script callback to be resumed |
925 |
|
* @param now - current scheduler time to be "now" |
926 |
|
* @param forever - whether this particulare script callback should ignore |
927 |
|
* all subsequent wait*() script function calls |
928 |
|
*/ |
929 |
|
void AbstractEngineChannel::ScheduleResumeOfScriptCallback(RTList<ScriptEvent>::Iterator& itCallback, sched_time_t now, bool forever) { |
930 |
|
// ignore if invalid iterator was passed |
931 |
|
if (!itCallback) return; |
932 |
|
|
933 |
|
ScriptEvent* pCallback = &*itCallback; |
934 |
|
|
935 |
|
// mark this callback to ignore all subsequent built-in wait*() script function calls |
936 |
|
if (forever) pCallback->ignoreAllWaitCalls = true; |
937 |
|
|
938 |
|
// ignore if callback is not in the scheduler queue |
939 |
|
if (pCallback->currentSchedulerQueue() != &pScript->suspendedEvents) return; |
940 |
|
|
941 |
|
// ignore if callback is already scheduled to be resumed "now" |
942 |
|
if (pCallback->scheduleTime <= now) return; |
943 |
|
|
944 |
|
// take it out from the scheduler queue and re-insert callback |
945 |
|
// to schedule the script callback for resuming execution "now" |
946 |
|
pScript->suspendedEvents.erase(*pCallback); |
947 |
|
pCallback->scheduleTime = now + 1; |
948 |
|
pScript->suspendedEvents.insert(*pCallback); |
949 |
|
} |
950 |
|
|
951 |
FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) { |
FxSend* AbstractEngineChannel::AddFxSend(uint8_t MidiCtrl, String Name) throw (Exception) { |
952 |
if (pEngine) pEngine->DisableAndLock(); |
if (pEngine) pEngine->DisableAndLock(); |
953 |
FxSend* pFxSend = new FxSend(this, MidiCtrl, Name); |
FxSend* pFxSend = new FxSend(this, MidiCtrl, Name); |
975 |
} |
} |
976 |
|
|
977 |
uint AbstractEngineChannel::GetFxSendCount() { |
uint AbstractEngineChannel::GetFxSendCount() { |
978 |
return fxSends.size(); |
return (uint)fxSends.size(); |
979 |
} |
} |
980 |
|
|
981 |
void AbstractEngineChannel::RemoveFxSend(FxSend* pFxSend) { |
void AbstractEngineChannel::RemoveFxSend(FxSend* pFxSend) { |