1865 |
return successResult(pNote ? EVENT_STATUS_NOTE_QUEUE : EVENT_STATUS_INACTIVE); |
return successResult(pNote ? EVENT_STATUS_NOTE_QUEUE : EVENT_STATUS_INACTIVE); |
1866 |
} |
} |
1867 |
|
|
1868 |
|
// callback_status() function |
1869 |
|
|
1870 |
|
InstrumentScriptVMFunction_callback_status::InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent) |
1871 |
|
: m_vm(parent) |
1872 |
|
{ |
1873 |
|
} |
1874 |
|
|
1875 |
|
VMFnResult* InstrumentScriptVMFunction_callback_status::exec(VMFnArgs* args) { |
1876 |
|
const script_callback_id_t id = args->arg(0)->asInt()->evalInt(); |
1877 |
|
if (!id) { |
1878 |
|
wrnMsg("callback_status(): callback ID for argument 1 may not be zero"); |
1879 |
|
return successResult(); |
1880 |
|
} |
1881 |
|
|
1882 |
|
AbstractEngineChannel* pEngineChannel = |
1883 |
|
static_cast<AbstractEngineChannel*>(m_vm->m_event->cause.pEngineChannel); |
1884 |
|
|
1885 |
|
RTList<ScriptEvent>::Iterator itCallback = pEngineChannel->ScriptCallbackByID(id); |
1886 |
|
if (!itCallback) |
1887 |
|
return successResult(CALLBACK_STATUS_TERMINATED); |
1888 |
|
|
1889 |
|
return successResult( |
1890 |
|
(m_vm->m_event->execCtx == itCallback->execCtx) ? |
1891 |
|
CALLBACK_STATUS_RUNNING : CALLBACK_STATUS_QUEUE |
1892 |
|
); |
1893 |
|
} |
1894 |
|
|
1895 |
// wait() function (overrides core wait() implementation) |
// wait() function (overrides core wait() implementation) |
1896 |
|
|
1897 |
InstrumentScriptVMFunction_wait::InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent) |
InstrumentScriptVMFunction_wait::InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent) |