/[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 3690 by schoenebeck, Fri Jan 3 10:18:21 2020 UTC revision 3733 by schoenebeck, Sat Feb 1 18:11:20 2020 UTC
# Line 88  namespace LinuxSampler { Line 88  namespace LinuxSampler {
88       * channels.       * channels.
89       *       *
90       * @param text - source code of script       * @param text - source code of script
91         * @param patchVars - 'patch' variables being overridden by instrument
92       */       */
93      void InstrumentScript::load(const String& text) {      void InstrumentScript::load(const String& text,
94                                    const std::map<String,String>& patchVars)
95        {
96          dmsg(1,("Loading real-time instrument script ... "));          dmsg(1,("Loading real-time instrument script ... "));
97    
98          // hand back old script reference and VM execution contexts          // hand back old script reference and VM execution contexts
# Line 102  namespace LinuxSampler { Line 105  namespace LinuxSampler {
105              dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager());              dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager());
106    
107          // get new script reference          // get new script reference
108          parserContext = pManager->scripts.Borrow(text, pEngineChannel);          parserContext = pManager->scripts.Borrow(
109                { .code = text, .patchVars = patchVars }, pEngineChannel
110            );
111          if (!parserContext->errors().empty()) {          if (!parserContext->errors().empty()) {
112              std::vector<ParserIssue> errors = parserContext->errors();              std::vector<ParserIssue> errors = parserContext->errors();
113              std::cerr << "[ScriptVM] Could not load instrument script, there were "              std::cerr << "[ScriptVM] Could not load instrument script, there were "
# Line 237  namespace LinuxSampler { Line 242  namespace LinuxSampler {
242    
243      InstrumentScriptVM::InstrumentScriptVM() :      InstrumentScriptVM::InstrumentScriptVM() :
244          m_event(NULL), m_fnPlayNote(this), m_fnSetController(this),          m_event(NULL), m_fnPlayNote(this), m_fnSetController(this),
245            m_fnSetRpn(this), m_fnSetNrpn(this),
246          m_fnIgnoreEvent(this), m_fnIgnoreController(this), m_fnNoteOff(this),          m_fnIgnoreEvent(this), m_fnIgnoreController(this), m_fnNoteOff(this),
247          m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this),          m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this),
248          m_fnChangeVol(this), m_fnChangeVolTime(this),          m_fnChangeVol(this), m_fnChangeVolTime(this),
# Line 404  namespace LinuxSampler { Line 410  namespace LinuxSampler {
410          // built-in script functions of this class          // built-in script functions of this class
411          if      (name == "play_note") return &m_fnPlayNote;          if      (name == "play_note") return &m_fnPlayNote;
412          else if (name == "set_controller") return &m_fnSetController;          else if (name == "set_controller") return &m_fnSetController;
413            else if (name == "set_rpn") return &m_fnSetRpn;
414            else if (name == "set_nrpn") return &m_fnSetNrpn;
415          else if (name == "ignore_event") return &m_fnIgnoreEvent;          else if (name == "ignore_event") return &m_fnIgnoreEvent;
416          else if (name == "ignore_controller") return &m_fnIgnoreController;          else if (name == "ignore_controller") return &m_fnIgnoreController;
417          else if (name == "note_off") return &m_fnNoteOff;          else if (name == "note_off") return &m_fnNoteOff;

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

  ViewVC Help
Powered by ViewVC