/[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 2612 by schoenebeck, Tue Jun 10 13:32:16 2014 UTC revision 2618 by schoenebeck, Wed Jun 11 11:39:44 2014 UTC
# Line 11  Line 11 
11  #include "../AbstractEngineChannel.h"  #include "../AbstractEngineChannel.h"
12  #include "../../common/global_private.h"  #include "../../common/global_private.h"
13  #include "AbstractInstrumentManager.h"  #include "AbstractInstrumentManager.h"
14    #include "MidiKeyboardManager.h"
15    
16  namespace LinuxSampler {  namespace LinuxSampler {
17    
# Line 87  namespace LinuxSampler { Line 88  namespace LinuxSampler {
88       * to deallocate the parsed script once not used on any engine channel       * to deallocate the parsed script once not used on any engine channel
89       * anymore.       * anymore.
90       *       *
91       * Calling thid method will however not clear the @c code member variable.       * Calling this method will however not clear the @c code member variable.
92       * Thus, the script can be parsed again afterwards.       * Thus, the script can be parsed again afterwards.
93       */       */
94      void InstrumentScript::unload() {      void InstrumentScript::unload() {
95            //dmsg(1,("InstrumentScript::unload(this=0x%llx)\n", this));
96    
97          if (parserContext)          if (parserContext)
98              dmsg(1,("Unloading current instrument script.\n"));              dmsg(1,("Unloading current instrument script.\n"));
99    
# Line 145  namespace LinuxSampler { Line 148  namespace LinuxSampler {
148          m_EVENT_ID = DECLARE_VMINT(m_event, class ScriptEvent, id);          m_EVENT_ID = DECLARE_VMINT(m_event, class ScriptEvent, id);
149          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);
150          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);
151            m_KEY_DOWN.size = 128;
152      }      }
153    
154      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {      VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) {
# Line 154  namespace LinuxSampler { Line 158  namespace LinuxSampler {
158          // prepare built-in script variables for script execution          // prepare built-in script variables for script execution
159          m_event = event;          m_event = event;
160          m_CC.data = (int8_t*) &pEngineChannel->ControllerTable[0];          m_CC.data = (int8_t*) &pEngineChannel->ControllerTable[0];
161            m_KEY_DOWN.data = &pEngineChannel->GetMidiKeyboardManager()->KeyDown[0];
162    
163          // if script is in start condition, then do mandatory MIDI event          // if script is in start condition, then do mandatory MIDI event
164          // preprocessing tasks, which essentially means updating i.e. controller          // preprocessing tasks, which essentially means updating i.e. controller
# Line 209  namespace LinuxSampler { Line 214  namespace LinuxSampler {
214    
215          // now add own built-in variables          // now add own built-in variables
216          m["%CC"] = &m_CC;          m["%CC"] = &m_CC;
217          //m["%KEY_DOWN"] = &m_KEY_DOWN;          m["%KEY_DOWN"] = &m_KEY_DOWN;
218          //m["%POLY_AT"] = &m_POLY_AT;          //m["%POLY_AT"] = &m_POLY_AT;
219    
220          return m;          return m;

Legend:
Removed from v.2612  
changed lines
  Added in v.2618

  ViewVC Help
Powered by ViewVC