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

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVM.cpp

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

revision 3277 by schoenebeck, Mon Jun 5 18:40:18 2017 UTC revision 3296 by schoenebeck, Wed Jun 28 09:45:56 2017 UTC
# Line 237  namespace LinuxSampler { Line 237  namespace LinuxSampler {
237          m_fnChangeDecay(this), m_fnChangeRelease(this),          m_fnChangeDecay(this), m_fnChangeRelease(this),
238          m_fnChangeAmpLFODepth(this), m_fnChangeAmpLFOFreq(this),          m_fnChangeAmpLFODepth(this), m_fnChangeAmpLFOFreq(this),
239          m_fnChangePitchLFODepth(this), m_fnChangePitchLFOFreq(this),          m_fnChangePitchLFODepth(this), m_fnChangePitchLFOFreq(this),
240          m_fnChangeNote(this), m_fnChangeVelo(this),          m_fnChangeNote(this), m_fnChangeVelo(this), m_fnFork(this),
241          m_fnEventStatus(this), m_fnWait2(this), m_fnStopWait(this),          m_fnEventStatus(this), m_fnWait2(this), m_fnStopWait(this),
242          m_fnAbort(this), m_fnFadeIn(this), m_fnFadeOut(this),          m_fnAbort(this), m_fnFadeIn(this), m_fnFadeOut(this),
243          m_fnChangeVolCurve(this), m_fnChangeTuneCurve(this),          m_fnChangeVolCurve(this), m_fnChangeTuneCurve(this),
244          m_fnGetEventPar(this), m_fnSetEventPar(this), m_fnChangePlayPos(this),          m_fnGetEventPar(this), m_fnSetEventPar(this), m_fnChangePlayPos(this),
245          m_varEngineUptime(this), m_varCallbackID(this), m_varAllEvents(this)          m_fnCallbackStatus(this),
246            m_varEngineUptime(this), m_varCallbackID(this), m_varAllEvents(this),
247            m_varCallbackChildID(this)
248      {      {
249          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);
250          m_CC_NUM = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.CC.Controller);          m_CC_NUM = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.CC.Controller);
# Line 253  namespace LinuxSampler { Line 255  namespace LinuxSampler {
255          m_KEY_DOWN.readonly = true;          m_KEY_DOWN.readonly = true;
256          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);
257          m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls);          m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls);
258            m_NKSP_CALLBACK_PARENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, parentHandlerID);
259      }      }
260    
261      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {
# Line 294  namespace LinuxSampler { Line 297  namespace LinuxSampler {
297                  parserCtx, event->execCtx, event->handlers[event->currentHandler]                  parserCtx, event->execCtx, event->handlers[event->currentHandler]
298              );              );
299              event->executionSlices++;              event->executionSlices++;
300                if (!(res & VM_EXEC_SUSPENDED)) { // if script terminated ...
301                    // check if this script handler instance has any forked children
302                    // to be auto aborted
303                    for (int iChild = 0; iChild < MAX_FORK_PER_SCRIPT_HANDLER &&
304                         event->childHandlerID[iChild]; ++iChild)
305                    {
306                        RTList<ScriptEvent>::Iterator itChild =
307                            pEngineChannel->ScriptCallbackByID(event->childHandlerID[iChild]);
308                        if (itChild && itChild->autoAbortByParent)
309                            itChild->execCtx->signalAbort();
310                    }
311                }
312              if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res;              if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res;
313          }          }
314    
# Line 312  namespace LinuxSampler { Line 327  namespace LinuxSampler {
327  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;
328          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;
329          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;
330            m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID;
331    
332          return m;          return m;
333      }      }
# Line 349  namespace LinuxSampler { Line 365  namespace LinuxSampler {
365          m["$EVENT_PAR_3"] = EVENT_PAR_3;          m["$EVENT_PAR_3"] = EVENT_PAR_3;
366          m["$NKSP_LINEAR"] = FADE_CURVE_LINEAR;          m["$NKSP_LINEAR"] = FADE_CURVE_LINEAR;
367          m["$NKSP_EASE_IN_EASE_OUT"] = FADE_CURVE_EASE_IN_EASE_OUT;          m["$NKSP_EASE_IN_EASE_OUT"] = FADE_CURVE_EASE_IN_EASE_OUT;
368            m["$CALLBACK_STATUS_TERMINATED"] = CALLBACK_STATUS_TERMINATED;
369            m["$CALLBACK_STATUS_QUEUE"]      = CALLBACK_STATUS_QUEUE;
370            m["$CALLBACK_STATUS_RUNNING"]    = CALLBACK_STATUS_RUNNING;
371    
372          return m;          return m;
373      }      }
# Line 360  namespace LinuxSampler { Line 379  namespace LinuxSampler {
379          m["%ALL_EVENTS"] = &m_varAllEvents;          m["%ALL_EVENTS"] = &m_varAllEvents;
380          m["$ENGINE_UPTIME"] = &m_varEngineUptime;          m["$ENGINE_UPTIME"] = &m_varEngineUptime;
381          m["$NI_CALLBACK_ID"] = &m_varCallbackID;          m["$NI_CALLBACK_ID"] = &m_varCallbackID;
382            m["%NKSP_CALLBACK_CHILD_ID"] = &m_varCallbackChildID;
383    
384          return m;          return m;
385      }      }
# Line 401  namespace LinuxSampler { Line 421  namespace LinuxSampler {
421          else if (name == "wait") return &m_fnWait2; // override wait() core implementation          else if (name == "wait") return &m_fnWait2; // override wait() core implementation
422          else if (name == "stop_wait") return &m_fnStopWait;          else if (name == "stop_wait") return &m_fnStopWait;
423          else if (name == "abort") return &m_fnAbort;          else if (name == "abort") return &m_fnAbort;
424            else if (name == "fork") return &m_fnFork;
425            else if (name == "callback_status") return &m_fnCallbackStatus;
426    
427          // built-in script functions of derived VM class          // built-in script functions of derived VM class
428          return ScriptVM::functionByName(name);          return ScriptVM::functionByName(name);

Legend:
Removed from v.3277  
changed lines
  Added in v.3296

  ViewVC Help
Powered by ViewVC