/* * Copyright (c) 2014 - 2019 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_INSTRSCRIPTVMFUNCTIONS_H #define LS_INSTRSCRIPTVMFUNCTIONS_H #include "../../common/global.h" #include "../../scriptvm/CoreVMFunctions.h" #include "Note.h" namespace LinuxSampler { class EventGroup; class InstrumentScriptVM; class InstrumentScriptVMFunction_play_note : public VMIntResultFunction { public: InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 4; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction { public: InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 0; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_ignore_controller : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 0; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_by_marks : public VMFunction { public: InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} bool modifiesArg(vmint iArg) const OVERRIDE { return false; } ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } ExprType_t returnType() OVERRIDE { return INT_ARR_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; class Result : public VMFnResult, public VMIntArrayExpr { public: StmtFlags_t flags; EventGroup* eventGroup; vmint arraySize() const OVERRIDE; vmint evalIntElement(vmuint i) OVERRIDE; void assignIntElement(vmuint i, vmint value) OVERRIDE {} // ignore assignment VMExpr* resultValue() OVERRIDE { return this; } StmtFlags_t resultFlags() OVERRIDE { return flags; } bool isConstExpr() const OVERRIDE { return false; } } m_result; VMFnResult* errorResult(); VMFnResult* successResult(EventGroup* eventGroup); }; class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 3; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 3; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 3; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_attack : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_decay : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_release : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class VMChangeSynthParamFunction : public VMEmptyResultFunction { public: VMChangeSynthParamFunction(InstrumentScriptVM* parent, bool acceptFinal, StdUnit_t unit) : m_vm(parent), m_acceptFinal(acceptFinal), m_unit(unit) {} vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } template VMFnResult* execTemplate(VMFnArgs* args, const char* functionName); protected: InstrumentScriptVM* m_vm; const bool m_acceptFinal; const StdUnit_t m_unit; }; class InstrumentScriptVMFunction_change_sustain : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_attack : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_decay : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_sustain : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_release : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_lfo_depth : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_cutoff_lfo_freq : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_vol_time : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_tune_time : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pan_time : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class VMChangeFadeCurveFunction : public VMEmptyResultFunction { public: VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {} vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } template VMFnResult* execTemplate(VMFnArgs* args, const char* functionName); protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_vol_curve : public VMChangeFadeCurveFunction { public: InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_tune_curve : public VMChangeFadeCurveFunction { public: InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pan_curve : public VMChangeFadeCurveFunction { public: InstrumentScriptVMFunction_change_pan_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {} VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_fade_in : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_fade_out : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 3; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE; bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_get_event_par : public VMIntResultFunction { public: InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_set_event_par : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 3; } vmint maxAllowedArgs() const OVERRIDE { return 3; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_note : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_velo : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_play_pos : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_play_pos(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; } bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg) const OVERRIDE; ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_event_status : public VMIntResultFunction { public: InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_callback_status : public VMIntResultFunction { public: InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; // overrides core wait() implementation class InstrumentScriptVMFunction_wait : public CoreVMFunction_wait { public: InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent); VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_stop_wait : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_abort : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 1; } vmint maxAllowedArgs() const OVERRIDE { return 1; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; } ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_fork : public VMIntResultFunction { public: InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 0; } vmint maxAllowedArgs() const OVERRIDE { return 2; } bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; } // namespace LinuxSampler #endif // LS_INSTRSCRIPTVMFUNCTIONS_H