/* * Copyright (c) 2014 Christian Schoenebeck * * http://www.linuxsampler.org * * This file is part of LinuxSampler and released under the same terms. * See README file for details. */ #ifndef LS_INSTRUMENT_SCRIPT_VM_H #define LS_INSTRUMENT_SCRIPT_VM_H #include "../../common/global.h" #include "../../scriptvm/ScriptVM.h" #include "Event.h" namespace LinuxSampler { /** @brief Real-time instrument script virtual machine. * * Extends the core ScriptVM implementation with MIDI specific built-in * script functions and MIDI specific built-in script variables required * for MIDI processing by instrument script for all sampler engine * implementations (sampler formats) of this sampler. * * Note that this class is currently re-entrant safe, but @b not thread * safe! See also comments of base class ScriptVM regarding this issue. */ class InstrumentScriptVM : public ScriptVM { public: InstrumentScriptVM(); VMExecStatus_t exec(VMParserContext* parserCtx, ScriptEvent* event); std::map builtInIntVariables() OVERRIDE; std::map builtInIntArrayVariables() OVERRIDE; std::map builtInConstIntVariables() OVERRIDE; protected: ScriptEvent* m_event; ///< The event currently executed by exec(). Event* m_cause; // buil-in script variables VMInt8Array m_CC; VMInt8RelPtr m_CC_NUM; VMInt8RelPtr m_EVENT_NOTE; VMInt8RelPtr m_EVENT_VELOCITY; //VMIntArray m_KEY_DOWN; //TODO: ... //VMIntArray m_POLY_AT; //TODO: ... //int m_POLY_AT_NUM; //TODO: ... }; } // namespace LinuxSampler #endif // LS_INSTRUMENT_SCRIPT_VM_H