32 |
|
|
33 |
// hand back old script reference and VM execution contexts |
// hand back old script reference and VM execution contexts |
34 |
// (if not done already) |
// (if not done already) |
35 |
reset(); |
unload(); |
36 |
|
|
37 |
|
code = text; |
38 |
|
|
39 |
AbstractInstrumentManager* pManager = |
AbstractInstrumentManager* pManager = |
40 |
dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager()); |
dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager()); |
86 |
* is used to share equivalent scripts among multiple sampler channels, and |
* is used to share equivalent scripts among multiple sampler channels, and |
87 |
* to deallocate the parsed script once not used on any engine channel |
* to deallocate the parsed script once not used on any engine channel |
88 |
* anymore. |
* anymore. |
89 |
|
* |
90 |
|
* Calling thid method will however not clear the @c code member variable. |
91 |
|
* Thus, the script can be parsed again afterwards. |
92 |
*/ |
*/ |
93 |
void InstrumentScript::reset() { |
void InstrumentScript::unload() { |
94 |
if (parserContext) |
if (parserContext) |
95 |
dmsg(1,("Unloading current instrument script.")); |
dmsg(1,("Unloading current instrument script.\n")); |
96 |
|
|
97 |
// free allocated VM execution contexts |
// free allocated VM execution contexts |
98 |
if (pEvents) { |
if (pEvents) { |
124 |
bHasValidScript = false; |
bHasValidScript = false; |
125 |
} |
} |
126 |
|
|
127 |
|
/** |
128 |
|
* Same as unload(), but this one also empties the @c code member variable |
129 |
|
* to an empty string. |
130 |
|
*/ |
131 |
|
void InstrumentScript::resetAll() { |
132 |
|
unload(); |
133 |
|
code.clear(); |
134 |
|
} |
135 |
|
|
136 |
/////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////// |
137 |
// class 'InstrumentScriptVM' |
// class 'InstrumentScriptVM' |
138 |
|
|