/[svn]/linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/AbstractEngineChannel.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2947 by schoenebeck, Wed Apr 20 15:22:58 2016 UTC revision 2948 by schoenebeck, Fri Jul 15 15:29:04 2016 UTC
# Line 909  namespace LinuxSampler { Line 909  namespace LinuxSampler {
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);

Legend:
Removed from v.2947  
changed lines
  Added in v.2948

  ViewVC Help
Powered by ViewVC