/[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 2942 by schoenebeck, Wed Jul 13 15:51:06 2016 UTC revision 2948 by schoenebeck, Fri Jul 15 15:29:04 2016 UTC
# Line 125  namespace LinuxSampler { Line 125  namespace LinuxSampler {
125              pEvents = new Pool<ScriptEvent>(CONFIG_MAX_EVENTS_PER_FRAGMENT);              pEvents = new Pool<ScriptEvent>(CONFIG_MAX_EVENTS_PER_FRAGMENT);
126              for (int i = 0; i < 128; ++i)              for (int i = 0; i < 128; ++i)
127                  pKeyEvents[i] = new RTList<ScriptEvent>(pEvents);                  pKeyEvents[i] = new RTList<ScriptEvent>(pEvents);
128                // reset RTAVLNode's tree node member variables after nodes are allocated
129                // (since we can't use a constructor right now, we do that initialization here)
130                while (!pEvents->poolIsEmpty()) {
131                    RTList<ScriptEvent>::Iterator it = pEvents->allocAppend();
132                    it->reset();
133                }
134                pEvents->clear();
135          }          }
136    
137          // create new VM execution contexts for new script          // create new VM execution contexts for new script
# Line 224  namespace LinuxSampler { Line 231  namespace LinuxSampler {
231          m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this),          m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this),
232          m_fnChangeVol(this), m_fnChangeTune(this), m_fnChangePan(this),          m_fnChangeVol(this), m_fnChangeTune(this), m_fnChangePan(this),
233          m_fnChangeCutoff(this), m_fnChangeReso(this), m_fnEventStatus(this),          m_fnChangeCutoff(this), m_fnChangeReso(this), m_fnEventStatus(this),
234          m_varEngineUptime(this)          m_fnWait2(this), m_fnStopWait(this),
235            m_varEngineUptime(this), m_varCallbackID(this)
236      {      {
237          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);          m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable);
238          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);
239          m_EVENT_ID = DECLARE_VMINT(m_event, class ScriptEvent, id);          m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id);
240          m_EVENT_NOTE = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.Note.Key);          m_EVENT_NOTE = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.Note.Key);
241          m_EVENT_VELOCITY = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.Note.Velocity);          m_EVENT_VELOCITY = DECLARE_VMINT(m_event, class ScriptEvent, cause.Param.Note.Velocity);
242          m_KEY_DOWN.size = 128;          m_KEY_DOWN.size = 128;
243            m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType);
244            m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls);
245      }      }
246    
247      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {
# Line 287  namespace LinuxSampler { Line 297  namespace LinuxSampler {
297          m["$EVENT_NOTE"] = &m_EVENT_NOTE;          m["$EVENT_NOTE"] = &m_EVENT_NOTE;
298          m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY;          m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY;
299  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;  //         m["$POLY_AT_NUM"] = &m_POLY_AT_NUM;
300            m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE;
301            m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT;
302    
303          return m;          return m;
304      }      }
# Line 323  namespace LinuxSampler { Line 335  namespace LinuxSampler {
335          std::map<String,VMDynVar*> m = ScriptVM::builtInDynamicVariables();          std::map<String,VMDynVar*> m = ScriptVM::builtInDynamicVariables();
336    
337          m["$ENGINE_UPTIME"] = &m_varEngineUptime;          m["$ENGINE_UPTIME"] = &m_varEngineUptime;
338            m["$NI_CALLBACK_ID"] = &m_varCallbackID;
339    
340          return m;          return m;
341      }      }
# Line 343  namespace LinuxSampler { Line 356  namespace LinuxSampler {
356          else if (name == "change_cutoff") return &m_fnChangeCutoff;          else if (name == "change_cutoff") return &m_fnChangeCutoff;
357          else if (name == "change_reso") return &m_fnChangeReso;          else if (name == "change_reso") return &m_fnChangeReso;
358          else if (name == "event_status") return &m_fnEventStatus;          else if (name == "event_status") return &m_fnEventStatus;
359            else if (name == "wait") return &m_fnWait2; // override wait() core implementation
360            else if (name == "stop_wait") return &m_fnStopWait;
361    
362          // built-in script functions of derived VM class          // built-in script functions of derived VM class
363          return ScriptVM::functionByName(name);          return ScriptVM::functionByName(name);

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

  ViewVC Help
Powered by ViewVC