/[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 3276 by schoenebeck, Tue May 30 15:43:39 2017 UTC revision 3277 by schoenebeck, Mon Jun 5 18:40:18 2017 UTC
# Line 1911  namespace LinuxSampler { Line 1911  namespace LinuxSampler {
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

Legend:
Removed from v.3276  
changed lines
  Added in v.3277

  ViewVC Help
Powered by ViewVC