/[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 3293 by schoenebeck, Tue Jun 27 22:19:19 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_varEngineUptime(this), m_varCallbackID(this), m_varAllEvents(this),
246            m_varCallbackChildID(this)
247      {      {
248          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);
249          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 254  namespace LinuxSampler {
254          m_KEY_DOWN.readonly = true;          m_KEY_DOWN.readonly = true;
255          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);
256          m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls);          m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls);
257            m_NKSP_CALLBACK_PARENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, parentHandlerID);
258      }      }
259    
260      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {
# Line 294  namespace LinuxSampler { Line 296  namespace LinuxSampler {
296                  parserCtx, event->execCtx, event->handlers[event->currentHandler]                  parserCtx, event->execCtx, event->handlers[event->currentHandler]
297              );              );
298              event->executionSlices++;              event->executionSlices++;
299                if (!(res & VM_EXEC_SUSPENDED)) { // if script terminated ...
300                    // check if this script handler instance has any forked children
301                    // to be auto aborted
302                    for (int iChild = 0; iChild < MAX_FORK_PER_SCRIPT_HANDLER &&
303                         event->childHandlerID[iChild]; ++iChild)
304                    {
305                        RTList<ScriptEvent>::Iterator itChild =
306                            pEngineChannel->ScriptCallbackByID(event->childHandlerID[iChild]);
307                        if (itChild && itChild->autoAbortByParent)
308                            itChild->execCtx->signalAbort();
309                    }
310                }
311              if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res;              if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res;
312          }          }
313    
# Line 312  namespace LinuxSampler { Line 326  namespace LinuxSampler {
326  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;
327          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;
328          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;
329            m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID;
330    
331          return m;          return m;
332      }      }
# Line 360  namespace LinuxSampler { Line 375  namespace LinuxSampler {
375          m["%ALL_EVENTS"] = &m_varAllEvents;          m["%ALL_EVENTS"] = &m_varAllEvents;
376          m["$ENGINE_UPTIME"] = &m_varEngineUptime;          m["$ENGINE_UPTIME"] = &m_varEngineUptime;
377          m["$NI_CALLBACK_ID"] = &m_varCallbackID;          m["$NI_CALLBACK_ID"] = &m_varCallbackID;
378            m["%NKSP_CALLBACK_CHILD_ID"] = &m_varCallbackChildID;
379    
380          return m;          return m;
381      }      }
# Line 401  namespace LinuxSampler { Line 417  namespace LinuxSampler {
417          else if (name == "wait") return &m_fnWait2; // override wait() core implementation          else if (name == "wait") return &m_fnWait2; // override wait() core implementation
418          else if (name == "stop_wait") return &m_fnStopWait;          else if (name == "stop_wait") return &m_fnStopWait;
419          else if (name == "abort") return &m_fnAbort;          else if (name == "abort") return &m_fnAbort;
420            else if (name == "fork") return &m_fnFork;
421    
422          // built-in script functions of derived VM class          // built-in script functions of derived VM class
423          return ScriptVM::functionByName(name);          return ScriptVM::functionByName(name);

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

  ViewVC Help
Powered by ViewVC