/[svn]/linuxsampler/trunk/src/scriptvm/ScriptVM.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/scriptvm/ScriptVM.cpp

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

revision 3332 by schoenebeck, Mon Jul 24 18:51:21 2017 UTC revision 3551 by schoenebeck, Thu Aug 1 10:22:56 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 - 2017 Christian Schoenebeck   * Copyright (c) 2014 - 2019 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 143  namespace LinuxSampler { Line 143  namespace LinuxSampler {
143          return max;          return max;
144      }      }
145    
146      ScriptVM::ScriptVM() : m_eventHandler(NULL), m_parserContext(NULL), m_autoSuspend(true) {      ScriptVM::ScriptVM() :
147            m_eventHandler(NULL), m_parserContext(NULL), m_autoSuspend(true),
148            m_acceptExitRes(false)
149        {
150          m_fnMessage = new CoreVMFunction_message;          m_fnMessage = new CoreVMFunction_message;
151          m_fnExit = new CoreVMFunction_exit;          m_fnExit = new CoreVMFunction_exit(this);
152          m_fnWait = new CoreVMFunction_wait(this);          m_fnWait = new CoreVMFunction_wait(this);
153          m_fnAbs = new CoreVMFunction_abs;          m_fnAbs = new CoreVMFunction_abs;
154          m_fnRandom = new CoreVMFunction_random;          m_fnRandom = new CoreVMFunction_random;
# Line 357  namespace LinuxSampler { Line 360  namespace LinuxSampler {
360          return m_autoSuspend;          return m_autoSuspend;
361      }      }
362    
363        void ScriptVM::setExitResultEnabled(bool b) {
364            m_acceptExitRes = b;
365        }
366    
367        bool ScriptVM::isExitResultEnabled() const {
368            return m_acceptExitRes;
369        }
370    
371      VMExecStatus_t ScriptVM::exec(VMParserContext* parserContext, VMExecContext* execContex, VMEventHandler* handler) {      VMExecStatus_t ScriptVM::exec(VMParserContext* parserContext, VMExecContext* execContex, VMEventHandler* handler) {
372          m_parserContext = dynamic_cast<ParserContext*>(parserContext);          m_parserContext = dynamic_cast<ParserContext*>(parserContext);
373          if (!m_parserContext) {          if (!m_parserContext) {
# Line 380  namespace LinuxSampler { Line 391  namespace LinuxSampler {
391    
392          ctx->status = VM_EXEC_RUNNING;          ctx->status = VM_EXEC_RUNNING;
393          ctx->instructionsCount = 0;          ctx->instructionsCount = 0;
394            ctx->clearExitRes();
395          StmtFlags_t& flags = ctx->flags;          StmtFlags_t& flags = ctx->flags;
396          int instructionsCounter = 0;          int instructionsCounter = 0;
397          int synced = m_autoSuspend ? 0 : 1;          int synced = m_autoSuspend ? 0 : 1;

Legend:
Removed from v.3332  
changed lines
  Added in v.3551

  ViewVC Help
Powered by ViewVC