1 |
/* |
/* |
2 |
* Copyright (c) 2014 - 2017 Christian Schoenebeck |
* Copyright (c) 2014 - 2021 Christian Schoenebeck |
3 |
* |
* |
4 |
* http://www.linuxsampler.org |
* http://www.linuxsampler.org |
5 |
* |
* |
20 |
/////////////////////////////////////////////////////////////////////// |
/////////////////////////////////////////////////////////////////////// |
21 |
// class 'EventGroup' |
// class 'EventGroup' |
22 |
|
|
23 |
void EventGroup::insert(int eventID) { |
void EventGroup::insert(vmint eventID) { |
24 |
if (contains(eventID)) return; |
if (contains(eventID)) return; |
25 |
|
|
26 |
AbstractEngine* pEngine = m_script->pEngineChannel->pEngine; |
AbstractEngine* pEngine = m_script->pEngineChannel->pEngine; |
31 |
// events die before being removed explicitly from the group by script |
// events die before being removed explicitly from the group by script |
32 |
// |
// |
33 |
// NOTE: or should we do this "dead ones" check only once in a while? |
// NOTE: or should we do this "dead ones" check only once in a while? |
34 |
int firstDead = -1; |
ssize_t firstDead = -1; |
35 |
for (int i = 0; i < size(); ++i) { |
for (size_t i = 0; i < size(); ++i) { |
36 |
if (firstDead >= 0) { |
if (firstDead >= 0) { |
37 |
if (pEngine->EventByID(eventID)) { |
if (pEngine->EventByID(eventID)) { |
38 |
remove(firstDead, i - firstDead); |
remove(firstDead, i - firstDead); |
42 |
if (!pEngine->EventByID(eventID)) firstDead = i; |
if (!pEngine->EventByID(eventID)) firstDead = i; |
43 |
} |
} |
44 |
} |
} |
45 |
|
if (firstDead >= 0) |
46 |
|
remove(firstDead, size() - firstDead); |
47 |
|
|
48 |
append(eventID); |
append(eventID); |
49 |
} |
} |
50 |
|
|
51 |
void EventGroup::erase(int eventID) { |
void EventGroup::erase(vmint eventID) { |
52 |
int index = find(eventID); |
size_t index = find(eventID); |
53 |
remove(index); |
remove(index); |
54 |
} |
} |
55 |
|
|
63 |
handlerNote = NULL; |
handlerNote = NULL; |
64 |
handlerRelease = NULL; |
handlerRelease = NULL; |
65 |
handlerController = NULL; |
handlerController = NULL; |
66 |
|
handlerRpn = NULL; |
67 |
|
handlerNrpn = NULL; |
68 |
pEvents = NULL; |
pEvents = NULL; |
69 |
for (int i = 0; i < 128; ++i) |
for (int i = 0; i < 128; ++i) |
70 |
pKeyEvents[i] = NULL; |
pKeyEvents[i] = NULL; |
90 |
* channels. |
* channels. |
91 |
* |
* |
92 |
* @param text - source code of script |
* @param text - source code of script |
93 |
|
* @param patchVars - 'patch' variables being overridden by instrument |
94 |
*/ |
*/ |
95 |
void InstrumentScript::load(const String& text) { |
void InstrumentScript::load(const String& text, |
96 |
|
const std::map<String,String>& patchVars) |
97 |
|
{ |
98 |
dmsg(1,("Loading real-time instrument script ... ")); |
dmsg(1,("Loading real-time instrument script ... ")); |
99 |
|
|
100 |
// hand back old script reference and VM execution contexts |
// hand back old script reference and VM execution contexts |
107 |
dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager()); |
dynamic_cast<AbstractInstrumentManager*>(pEngineChannel->pEngine->GetInstrumentManager()); |
108 |
|
|
109 |
// get new script reference |
// get new script reference |
110 |
parserContext = pManager->scripts.Borrow(text, pEngineChannel); |
parserContext = pManager->scripts.Borrow( |
111 |
|
{ .code = text, .patchVars = patchVars }, pEngineChannel |
112 |
|
); |
113 |
if (!parserContext->errors().empty()) { |
if (!parserContext->errors().empty()) { |
114 |
std::vector<ParserIssue> errors = parserContext->errors(); |
std::vector<ParserIssue> errors = parserContext->errors(); |
115 |
std::cerr << "[ScriptVM] Could not load instrument script, there were " |
std::cerr << "[ScriptVM] Could not load instrument script, there were " |
123 |
handlerNote = parserContext->eventHandlerByName("note"); |
handlerNote = parserContext->eventHandlerByName("note"); |
124 |
handlerRelease = parserContext->eventHandlerByName("release"); |
handlerRelease = parserContext->eventHandlerByName("release"); |
125 |
handlerController = parserContext->eventHandlerByName("controller"); |
handlerController = parserContext->eventHandlerByName("controller"); |
126 |
|
handlerRpn = parserContext->eventHandlerByName("rpn"); |
127 |
|
handlerNrpn = parserContext->eventHandlerByName("nrpn"); |
128 |
bHasValidScript = |
bHasValidScript = |
129 |
handlerInit || handlerNote || handlerRelease || handlerController; |
handlerInit || handlerNote || handlerRelease || handlerController || |
130 |
|
handlerRpn || handlerNrpn; |
131 |
|
|
132 |
// amount of script handlers each script event has to execute |
// amount of script handlers each script event has to execute |
133 |
int handlerExecCount = 0; |
int handlerExecCount = 0; |
134 |
if (handlerNote || handlerRelease || handlerController) // only one of these are executed after "init" handler |
if (handlerNote || handlerRelease || handlerController || handlerRpn || |
135 |
|
handlerNrpn) // only one of these are executed after "init" handler |
136 |
handlerExecCount++; |
handlerExecCount++; |
137 |
|
|
138 |
// create script event pool (if it doesn't exist already) |
// create script event pool (if it doesn't exist already) |
146 |
RTList<ScriptEvent>::Iterator it = pEvents->allocAppend(); |
RTList<ScriptEvent>::Iterator it = pEvents->allocAppend(); |
147 |
it->reset(); |
it->reset(); |
148 |
} |
} |
|
pEvents->clear(); |
|
149 |
} |
} |
150 |
|
pEvents->clear(); // outside of upper block, as loop below must always start from cleared list |
151 |
|
|
152 |
// create new VM execution contexts for new script |
// create new VM execution contexts for new script |
153 |
while (!pEvents->poolIsEmpty()) { |
while (!pEvents->poolIsEmpty()) { |
186 |
pEvents->clear(); |
pEvents->clear(); |
187 |
while (!pEvents->poolIsEmpty()) { |
while (!pEvents->poolIsEmpty()) { |
188 |
RTList<ScriptEvent>::Iterator it = pEvents->allocAppend(); |
RTList<ScriptEvent>::Iterator it = pEvents->allocAppend(); |
189 |
|
if (!it) break; |
190 |
if (it->execCtx) { |
if (it->execCtx) { |
191 |
// free VM execution context object |
// free VM execution context object |
192 |
delete it->execCtx; |
delete it->execCtx; |
193 |
it->execCtx = NULL; |
it->execCtx = NULL; |
194 |
// free C array of handler pointers |
// free C array of handler pointers |
195 |
delete [] it->handlers; |
delete [] it->handlers; |
196 |
|
it->handlers = NULL; |
197 |
} |
} |
198 |
} |
} |
199 |
pEvents->clear(); |
pEvents->clear(); |
209 |
handlerNote = NULL; |
handlerNote = NULL; |
210 |
handlerRelease = NULL; |
handlerRelease = NULL; |
211 |
handlerController = NULL; |
handlerController = NULL; |
212 |
|
handlerRpn = NULL; |
213 |
|
handlerNrpn = NULL; |
214 |
} |
} |
215 |
bHasValidScript = false; |
bHasValidScript = false; |
216 |
} |
} |
246 |
|
|
247 |
InstrumentScriptVM::InstrumentScriptVM() : |
InstrumentScriptVM::InstrumentScriptVM() : |
248 |
m_event(NULL), m_fnPlayNote(this), m_fnSetController(this), |
m_event(NULL), m_fnPlayNote(this), m_fnSetController(this), |
249 |
|
m_fnSetRpn(this), m_fnSetNrpn(this), |
250 |
m_fnIgnoreEvent(this), m_fnIgnoreController(this), m_fnNoteOff(this), |
m_fnIgnoreEvent(this), m_fnIgnoreController(this), m_fnNoteOff(this), |
251 |
m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this), |
m_fnSetEventMark(this), m_fnDeleteEventMark(this), m_fnByMarks(this), |
252 |
m_fnChangeVol(this), m_fnChangeVolTime(this), |
m_fnChangeVol(this), m_fnChangeVolTime(this), |
253 |
m_fnChangeTune(this), m_fnChangeTuneTime(this), m_fnChangePan(this), |
m_fnChangeTune(this), m_fnChangeTuneTime(this), m_fnChangePan(this), |
254 |
|
m_fnChangePanTime(this), m_fnChangePanCurve(this), |
255 |
m_fnChangeCutoff(this), m_fnChangeReso(this), m_fnChangeAttack(this), |
m_fnChangeCutoff(this), m_fnChangeReso(this), m_fnChangeAttack(this), |
256 |
m_fnChangeDecay(this), m_fnChangeRelease(this), |
m_fnChangeDecay(this), m_fnChangeSustain(this), m_fnChangeRelease(this), |
257 |
|
m_fnChangeCutoffAttack(this), m_fnChangeCutoffDecay(this), |
258 |
|
m_fnChangeCutoffSustain(this), m_fnChangeCutoffRelease(this), |
259 |
m_fnChangeAmpLFODepth(this), m_fnChangeAmpLFOFreq(this), |
m_fnChangeAmpLFODepth(this), m_fnChangeAmpLFOFreq(this), |
260 |
|
m_fnChangeCutoffLFODepth(this), m_fnChangeCutoffLFOFreq(this), |
261 |
m_fnChangePitchLFODepth(this), m_fnChangePitchLFOFreq(this), |
m_fnChangePitchLFODepth(this), m_fnChangePitchLFOFreq(this), |
262 |
m_fnChangeNote(this), m_fnChangeVelo(this), |
m_fnChangeNote(this), m_fnChangeVelo(this), m_fnFork(this), |
263 |
m_fnEventStatus(this), m_fnWait2(this), m_fnStopWait(this), |
m_fnEventStatus(this), m_fnWait2(this), m_fnStopWait(this), |
264 |
m_fnFadeIn(this), m_fnFadeOut(this), |
m_fnAbort(this), m_fnFadeIn(this), m_fnFadeOut(this), |
265 |
m_fnChangeVolCurve(this), m_fnChangeTuneCurve(this), |
m_fnChangeVolCurve(this), m_fnChangeTuneCurve(this), |
266 |
m_fnGetEventPar(this), m_fnSetEventPar(this), |
m_fnGetEventPar(this), m_fnSetEventPar(this), m_fnChangePlayPos(this), |
267 |
m_varEngineUptime(this), m_varCallbackID(this), m_varAllEvents(this) |
m_fnCallbackStatus(this), |
268 |
|
m_varEngineUptime(this), m_varCallbackID(this), m_varAllEvents(this), |
269 |
|
m_varCallbackChildID(this) |
270 |
{ |
{ |
271 |
m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable); |
m_CC.size = _MEMBER_SIZEOF(AbstractEngineChannel, ControllerTable); |
272 |
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); |
273 |
m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id); |
m_EVENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, id); |
274 |
m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key); |
m_EVENT_NOTE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Key); |
275 |
m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity); |
m_EVENT_VELOCITY = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.Note.Velocity); |
276 |
|
m_RPN_ADDRESS = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Parameter); |
277 |
|
m_RPN_VALUE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, cause.Param.RPN.Value); |
278 |
m_KEY_DOWN.size = 128; |
m_KEY_DOWN.size = 128; |
279 |
m_KEY_DOWN.readonly = true; |
m_KEY_DOWN.readonly = true; |
280 |
m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType); |
m_NI_CALLBACK_TYPE = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, handlerType); |
281 |
m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls); |
m_NKSP_IGNORE_WAIT = DECLARE_VMINT(m_event, class ScriptEvent, ignoreAllWaitCalls); |
282 |
|
m_NKSP_CALLBACK_PARENT_ID = DECLARE_VMINT_READONLY(m_event, class ScriptEvent, parentHandlerID); |
283 |
} |
} |
284 |
|
|
285 |
VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) { |
VMExecStatus_t InstrumentScriptVM::exec(VMParserContext* parserCtx, ScriptEvent* event) { |
321 |
parserCtx, event->execCtx, event->handlers[event->currentHandler] |
parserCtx, event->execCtx, event->handlers[event->currentHandler] |
322 |
); |
); |
323 |
event->executionSlices++; |
event->executionSlices++; |
324 |
|
if (!(res & VM_EXEC_SUSPENDED)) { // if script terminated ... |
325 |
|
// check if this script handler instance has any forked children |
326 |
|
// to be auto aborted |
327 |
|
for (int iChild = 0; iChild < MAX_FORK_PER_SCRIPT_HANDLER && |
328 |
|
event->childHandlerID[iChild]; ++iChild) |
329 |
|
{ |
330 |
|
RTList<ScriptEvent>::Iterator itChild = |
331 |
|
pEngineChannel->ScriptCallbackByID(event->childHandlerID[iChild]); |
332 |
|
if (itChild && itChild->autoAbortByParent) |
333 |
|
itChild->execCtx->signalAbort(); |
334 |
|
} |
335 |
|
} |
336 |
if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res; |
if (res & VM_EXEC_SUSPENDED || res & VM_EXEC_ERROR) return res; |
337 |
} |
} |
338 |
|
|
339 |
return res; |
return res; |
340 |
} |
} |
341 |
|
|
342 |
std::map<String,VMIntRelPtr*> InstrumentScriptVM::builtInIntVariables() { |
std::map<String,VMIntPtr*> InstrumentScriptVM::builtInIntVariables() { |
343 |
// first get built-in integer variables of derived VM class |
// first get built-in integer variables of derived VM class |
344 |
std::map<String,VMIntRelPtr*> m = ScriptVM::builtInIntVariables(); |
std::map<String,VMIntPtr*> m = ScriptVM::builtInIntVariables(); |
345 |
|
|
346 |
// now add own built-in variables |
// now add own built-in variables |
347 |
m["$CC_NUM"] = &m_CC_NUM; |
m["$CC_NUM"] = &m_CC_NUM; |
349 |
m["$EVENT_NOTE"] = &m_EVENT_NOTE; |
m["$EVENT_NOTE"] = &m_EVENT_NOTE; |
350 |
m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY; |
m["$EVENT_VELOCITY"] = &m_EVENT_VELOCITY; |
351 |
// m["$POLY_AT_NUM"] = &m_POLY_AT_NUM; |
// m["$POLY_AT_NUM"] = &m_POLY_AT_NUM; |
352 |
|
m["$RPN_ADDRESS"] = &m_RPN_ADDRESS; // used for both RPN and NRPN events |
353 |
|
m["$RPN_VALUE"] = &m_RPN_VALUE; // used for both RPN and NRPN events |
354 |
m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE; |
m["$NI_CALLBACK_TYPE"] = &m_NI_CALLBACK_TYPE; |
355 |
m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT; |
m["$NKSP_IGNORE_WAIT"] = &m_NKSP_IGNORE_WAIT; |
356 |
|
m["$NKSP_CALLBACK_PARENT_ID"] = &m_NKSP_CALLBACK_PARENT_ID; |
357 |
|
|
358 |
return m; |
return m; |
359 |
} |
} |
370 |
return m; |
return m; |
371 |
} |
} |
372 |
|
|
373 |
std::map<String,int> InstrumentScriptVM::builtInConstIntVariables() { |
std::map<String,vmint> InstrumentScriptVM::builtInConstIntVariables() { |
374 |
// first get built-in integer variables of derived VM class |
// first get built-in integer variables of derived VM class |
375 |
std::map<String,int> m = ScriptVM::builtInConstIntVariables(); |
std::map<String,vmint> m = ScriptVM::builtInConstIntVariables(); |
376 |
|
|
377 |
m["$EVENT_STATUS_INACTIVE"] = EVENT_STATUS_INACTIVE; |
m["$EVENT_STATUS_INACTIVE"] = EVENT_STATUS_INACTIVE; |
378 |
m["$EVENT_STATUS_NOTE_QUEUE"] = EVENT_STATUS_NOTE_QUEUE; |
m["$EVENT_STATUS_NOTE_QUEUE"] = EVENT_STATUS_NOTE_QUEUE; |
391 |
m["$EVENT_PAR_3"] = EVENT_PAR_3; |
m["$EVENT_PAR_3"] = EVENT_PAR_3; |
392 |
m["$NKSP_LINEAR"] = FADE_CURVE_LINEAR; |
m["$NKSP_LINEAR"] = FADE_CURVE_LINEAR; |
393 |
m["$NKSP_EASE_IN_EASE_OUT"] = FADE_CURVE_EASE_IN_EASE_OUT; |
m["$NKSP_EASE_IN_EASE_OUT"] = FADE_CURVE_EASE_IN_EASE_OUT; |
394 |
|
m["$CALLBACK_STATUS_TERMINATED"] = CALLBACK_STATUS_TERMINATED; |
395 |
|
m["$CALLBACK_STATUS_QUEUE"] = CALLBACK_STATUS_QUEUE; |
396 |
|
m["$CALLBACK_STATUS_RUNNING"] = CALLBACK_STATUS_RUNNING; |
397 |
|
|
398 |
return m; |
return m; |
399 |
} |
} |
405 |
m["%ALL_EVENTS"] = &m_varAllEvents; |
m["%ALL_EVENTS"] = &m_varAllEvents; |
406 |
m["$ENGINE_UPTIME"] = &m_varEngineUptime; |
m["$ENGINE_UPTIME"] = &m_varEngineUptime; |
407 |
m["$NI_CALLBACK_ID"] = &m_varCallbackID; |
m["$NI_CALLBACK_ID"] = &m_varCallbackID; |
408 |
|
m["%NKSP_CALLBACK_CHILD_ID"] = &m_varCallbackChildID; |
409 |
|
|
410 |
return m; |
return m; |
411 |
} |
} |
414 |
// built-in script functions of this class |
// built-in script functions of this class |
415 |
if (name == "play_note") return &m_fnPlayNote; |
if (name == "play_note") return &m_fnPlayNote; |
416 |
else if (name == "set_controller") return &m_fnSetController; |
else if (name == "set_controller") return &m_fnSetController; |
417 |
|
else if (name == "set_rpn") return &m_fnSetRpn; |
418 |
|
else if (name == "set_nrpn") return &m_fnSetNrpn; |
419 |
else if (name == "ignore_event") return &m_fnIgnoreEvent; |
else if (name == "ignore_event") return &m_fnIgnoreEvent; |
420 |
else if (name == "ignore_controller") return &m_fnIgnoreController; |
else if (name == "ignore_controller") return &m_fnIgnoreController; |
421 |
else if (name == "note_off") return &m_fnNoteOff; |
else if (name == "note_off") return &m_fnNoteOff; |
429 |
else if (name == "change_note") return &m_fnChangeNote; |
else if (name == "change_note") return &m_fnChangeNote; |
430 |
else if (name == "change_velo") return &m_fnChangeVelo; |
else if (name == "change_velo") return &m_fnChangeVelo; |
431 |
else if (name == "change_pan") return &m_fnChangePan; |
else if (name == "change_pan") return &m_fnChangePan; |
432 |
|
else if (name == "change_pan_time") return &m_fnChangePanTime; |
433 |
|
else if (name == "change_pan_curve") return &m_fnChangePanCurve; |
434 |
else if (name == "change_cutoff") return &m_fnChangeCutoff; |
else if (name == "change_cutoff") return &m_fnChangeCutoff; |
435 |
else if (name == "change_reso") return &m_fnChangeReso; |
else if (name == "change_reso") return &m_fnChangeReso; |
436 |
else if (name == "change_attack") return &m_fnChangeAttack; |
else if (name == "change_attack") return &m_fnChangeAttack; |
437 |
else if (name == "change_decay") return &m_fnChangeDecay; |
else if (name == "change_decay") return &m_fnChangeDecay; |
438 |
|
else if (name == "change_sustain") return &m_fnChangeSustain; |
439 |
else if (name == "change_release") return &m_fnChangeRelease; |
else if (name == "change_release") return &m_fnChangeRelease; |
440 |
|
else if (name == "change_cutoff_attack") return &m_fnChangeCutoffAttack; |
441 |
|
else if (name == "change_cutoff_decay") return &m_fnChangeCutoffDecay; |
442 |
|
else if (name == "change_cutoff_sustain") return &m_fnChangeCutoffSustain; |
443 |
|
else if (name == "change_cutoff_release") return &m_fnChangeCutoffRelease; |
444 |
else if (name == "change_amp_lfo_depth") return &m_fnChangeAmpLFODepth; |
else if (name == "change_amp_lfo_depth") return &m_fnChangeAmpLFODepth; |
445 |
else if (name == "change_amp_lfo_freq") return &m_fnChangeAmpLFOFreq; |
else if (name == "change_amp_lfo_freq") return &m_fnChangeAmpLFOFreq; |
446 |
|
else if (name == "change_cutoff_lfo_depth") return &m_fnChangeCutoffLFODepth; |
447 |
|
else if (name == "change_cutoff_lfo_freq") return &m_fnChangeCutoffLFOFreq; |
448 |
else if (name == "change_pitch_lfo_depth") return &m_fnChangePitchLFODepth; |
else if (name == "change_pitch_lfo_depth") return &m_fnChangePitchLFODepth; |
449 |
else if (name == "change_pitch_lfo_freq") return &m_fnChangePitchLFOFreq; |
else if (name == "change_pitch_lfo_freq") return &m_fnChangePitchLFOFreq; |
450 |
else if (name == "fade_in") return &m_fnFadeIn; |
else if (name == "fade_in") return &m_fnFadeIn; |
451 |
else if (name == "fade_out") return &m_fnFadeOut; |
else if (name == "fade_out") return &m_fnFadeOut; |
452 |
else if (name == "change_vol_curve") return &m_fnChangeVolCurve; |
else if (name == "change_vol_curve") return &m_fnChangeVolCurve; |
453 |
else if (name == "change_tune_curve") return &m_fnChangeTuneCurve; |
else if (name == "change_tune_curve") return &m_fnChangeTuneCurve; |
454 |
|
else if (name == "change_play_pos") return &m_fnChangePlayPos; |
455 |
else if (name == "get_event_par") return &m_fnGetEventPar; |
else if (name == "get_event_par") return &m_fnGetEventPar; |
456 |
else if (name == "set_event_par") return &m_fnSetEventPar; |
else if (name == "set_event_par") return &m_fnSetEventPar; |
457 |
else if (name == "event_status") return &m_fnEventStatus; |
else if (name == "event_status") return &m_fnEventStatus; |
458 |
else if (name == "wait") return &m_fnWait2; // override wait() core implementation |
else if (name == "wait") return &m_fnWait2; // override wait() core implementation |
459 |
else if (name == "stop_wait") return &m_fnStopWait; |
else if (name == "stop_wait") return &m_fnStopWait; |
460 |
|
else if (name == "abort") return &m_fnAbort; |
461 |
|
else if (name == "fork") return &m_fnFork; |
462 |
|
else if (name == "callback_status") return &m_fnCallbackStatus; |
463 |
|
|
464 |
// built-in script functions of derived VM class |
// built-in script functions of derived VM class |
465 |
return ScriptVM::functionByName(name); |
return ScriptVM::functionByName(name); |