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 |
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 " |