/[svn]/linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3295 by schoenebeck, Tue Jun 27 22:19:19 2017 UTC revision 3296 by schoenebeck, Wed Jun 28 09:45:56 2017 UTC
# Line 1865  namespace LinuxSampler { Line 1865  namespace LinuxSampler {
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)

Legend:
Removed from v.3295  
changed lines
  Added in v.3296

  ViewVC Help
Powered by ViewVC