--- linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2017/05/25 14:46:47 3214 +++ linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2019/08/18 00:06:04 3557 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 - 2017 Christian Schoenebeck + * Copyright (c) 2014 - 2019 Christian Schoenebeck * * http://www.linuxsampler.org * @@ -22,11 +22,11 @@ class InstrumentScriptVMFunction_play_note : public VMIntResultFunction { public: InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 1; } - int maxAllowedArgs() const { return 4; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -34,11 +34,11 @@ class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction { public: InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -46,11 +46,11 @@ class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 0; } - int maxAllowedArgs() const { return 1; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -58,11 +58,11 @@ class InstrumentScriptVMFunction_ignore_controller : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 0; } - int maxAllowedArgs() const { return 1; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -70,11 +70,11 @@ class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 1; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -82,11 +82,11 @@ class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -94,11 +94,11 @@ class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -106,11 +106,11 @@ class InstrumentScriptVMFunction_by_marks : public VMFunction { public: InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent); - int minRequiredArgs() const OVERRIDE { return 1; } - int maxAllowedArgs() const OVERRIDE { return 1; } - bool acceptsArgType(int iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} - bool modifiesArg(int iArg) const OVERRIDE { return false; } - ExprType_t argType(int iArg) const OVERRIDE { return INT_EXPR; } + 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: @@ -120,9 +120,9 @@ StmtFlags_t flags; EventGroup* eventGroup; - int arraySize() const OVERRIDE; - int evalIntElement(uint i) OVERRIDE; - void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment + 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; } @@ -135,11 +135,11 @@ class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 3; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + vmint minRequiredArgs() const OVERRIDE { return 2; } + vmint maxAllowedArgs() const OVERRIDE { return 3; } + 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; }; @@ -147,11 +147,11 @@ class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 3; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + vmint minRequiredArgs() const OVERRIDE { return 2; } + vmint maxAllowedArgs() const OVERRIDE { return 3; } + 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; }; @@ -159,11 +159,11 @@ class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 3; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + vmint minRequiredArgs() const OVERRIDE { return 2; } + vmint maxAllowedArgs() const OVERRIDE { return 3; } + 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; }; @@ -171,11 +171,11 @@ class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -183,11 +183,11 @@ class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -195,11 +195,11 @@ class InstrumentScriptVMFunction_change_attack : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -207,11 +207,11 @@ class InstrumentScriptVMFunction_change_decay : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -219,11 +219,11 @@ class InstrumentScriptVMFunction_change_release : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -231,62 +231,142 @@ class VMChangeSynthParamFunction : public VMEmptyResultFunction { public: VMChangeSynthParamFunction(InstrumentScriptVM* parent) : m_vm(parent) {} - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } + 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 + template VMFnResult* execTemplate(VMFnArgs* args, const char* functionName); protected: InstrumentScriptVM* m_vm; }; + class InstrumentScriptVMFunction_change_sustain : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_attack : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_decay : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_sustain : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_release : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_lfo_depth : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_cutoff_lfo_freq : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_vol_time : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_change_tune_time : public VMChangeSynthParamFunction { public: InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + }; + + class InstrumentScriptVMFunction_change_pan_time : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + 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); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -294,11 +374,11 @@ class InstrumentScriptVMFunction_fade_out : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 3; } - bool acceptsArgType(int iArg, ExprType_t type) const; - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + vmint minRequiredArgs() const OVERRIDE { return 2; } + vmint maxAllowedArgs() const OVERRIDE { return 3; } + 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; }; @@ -306,11 +386,11 @@ class InstrumentScriptVMFunction_get_event_par : public VMIntResultFunction { public: InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -318,11 +398,11 @@ class InstrumentScriptVMFunction_set_event_par : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 3; } - int maxAllowedArgs() const { return 3; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -330,11 +410,11 @@ class InstrumentScriptVMFunction_change_note : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -342,11 +422,23 @@ class InstrumentScriptVMFunction_change_velo : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 2; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; } + ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -354,11 +446,23 @@ class InstrumentScriptVMFunction_event_status : public VMIntResultFunction { public: InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 1; } - int maxAllowedArgs() const { return 1; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; }; @@ -367,17 +471,41 @@ class InstrumentScriptVMFunction_wait : public CoreVMFunction_wait { public: InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent); - VMFnResult* exec(VMFnArgs* args); + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class InstrumentScriptVMFunction_stop_wait : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 1; } - int maxAllowedArgs() const { return 2; } - bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;} - ExprType_t argType(int iArg) const { return INT_EXPR; } - VMFnResult* exec(VMFnArgs* args); + 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; };