/[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 3557 by schoenebeck, Sun Aug 18 00:06:04 2019 UTC revision 3690 by schoenebeck, Fri Jan 3 10:18:21 2020 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 - 2019 Christian Schoenebeck   * Copyright (c) 2014 - 2020 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 61  namespace LinuxSampler { Line 61  namespace LinuxSampler {
61          handlerNote = NULL;          handlerNote = NULL;
62          handlerRelease = NULL;          handlerRelease = NULL;
63          handlerController = NULL;          handlerController = NULL;
64            handlerRpn = NULL;
65            handlerNrpn = NULL;
66          pEvents = NULL;          pEvents = NULL;
67          for (int i = 0; i < 128; ++i)          for (int i = 0; i < 128; ++i)
68              pKeyEvents[i] = NULL;              pKeyEvents[i] = NULL;
# Line 114  namespace LinuxSampler { Line 116  namespace LinuxSampler {
116          handlerNote = parserContext->eventHandlerByName("note");          handlerNote = parserContext->eventHandlerByName("note");
117          handlerRelease = parserContext->eventHandlerByName("release");          handlerRelease = parserContext->eventHandlerByName("release");
118          handlerController = parserContext->eventHandlerByName("controller");          handlerController = parserContext->eventHandlerByName("controller");
119            handlerRpn = parserContext->eventHandlerByName("rpn");
120            handlerNrpn = parserContext->eventHandlerByName("nrpn");
121          bHasValidScript =          bHasValidScript =
122              handlerInit || handlerNote || handlerRelease || handlerController;              handlerInit || handlerNote || handlerRelease || handlerController ||
123                handlerRpn || handlerNrpn;
124    
125          // amount of script handlers each script event has to execute          // amount of script handlers each script event has to execute
126          int handlerExecCount = 0;          int handlerExecCount = 0;
127          if (handlerNote || handlerRelease || handlerController) // only one of these are executed after "init" handler          if (handlerNote || handlerRelease || handlerController || handlerRpn ||
128                handlerNrpn) // only one of these are executed after "init" handler
129              handlerExecCount++;              handlerExecCount++;
130    
131          // create script event pool (if it doesn't exist already)          // create script event pool (if it doesn't exist already)
# Line 194  namespace LinuxSampler { Line 200  namespace LinuxSampler {
200              handlerNote = NULL;              handlerNote = NULL;
201              handlerRelease = NULL;              handlerRelease = NULL;
202              handlerController = NULL;              handlerController = NULL;
203                handlerRpn = NULL;
204                handlerNrpn = NULL;
205          }          }
206          bHasValidScript = false;          bHasValidScript = false;
207      }      }
# Line 255  namespace LinuxSampler { Line 263  namespace LinuxSampler {
263          m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id);          m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id);
264          m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key);          m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key);
265          m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity);          m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity);
266            m_RPN_ADDRESS = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Parameter);
267            m_RPN_VALUE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Value);
268          m_KEY_DOWN.size = 128;          m_KEY_DOWN.size = 128;
269          m_KEY_DOWN.readonly = true;          m_KEY_DOWN.readonly = true;
270          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);          m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);
# Line 329  namespace LinuxSampler { Line 339  namespace LinuxSampler {
339          m["$EVENT_NOTE"] = &m_EVENT_NOTE;          m["$EVENT_NOTE"] = &m_EVENT_NOTE;
340          m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY;          m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY;
341  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;
342            m["$RPN_ADDRESS"] = &m_RPN_ADDRESS; // used for both RPN and NRPN events
343            m["$RPN_VALUE"] = &m_RPN_VALUE;     // used for both RPN and NRPN events
344          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;          m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;
345          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;          m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;
346          m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID;          m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID;

Legend:
Removed from v.3557  
changed lines
  Added in v.3690

  ViewVC Help
Powered by ViewVC