1911 |
return successResult(); |
return successResult(); |
1912 |
} |
} |
1913 |
|
|
1914 |
|
// abort() function |
1915 |
|
|
1916 |
|
InstrumentScriptVMFunction_abort::InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent) |
1917 |
|
: m_vm(parent) |
1918 |
|
{ |
1919 |
|
} |
1920 |
|
|
1921 |
|
VMFnResult* InstrumentScriptVMFunction_abort::exec(VMFnArgs* args) { |
1922 |
|
const script_callback_id_t id = args->arg(0)->asInt()->evalInt(); |
1923 |
|
if (!id) { |
1924 |
|
wrnMsg("abort(): callback ID for argument 1 may not be zero"); |
1925 |
|
return successResult(); |
1926 |
|
} |
1927 |
|
|
1928 |
|
AbstractEngineChannel* pEngineChannel = |
1929 |
|
static_cast<AbstractEngineChannel*>(m_vm->m_event->cause.pEngineChannel); |
1930 |
|
|
1931 |
|
RTList<ScriptEvent>::Iterator itCallback = pEngineChannel->ScriptCallbackByID(id); |
1932 |
|
if (!itCallback) return successResult(); // ignore if callback is i.e. not alive anymore |
1933 |
|
|
1934 |
|
itCallback->execCtx->signalAbort(); |
1935 |
|
|
1936 |
|
return successResult(); |
1937 |
|
} |
1938 |
|
|
1939 |
} // namespace LinuxSampler |
} // namespace LinuxSampler |