--- linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2019/01/27 10:07:54 3455 +++ linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2019/08/24 09:18:57 3564 @@ -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,14 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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; }; @@ -147,11 +150,13 @@ 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; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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; }; @@ -159,11 +164,12 @@ 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; + 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; }; @@ -171,11 +177,14 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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; }; @@ -183,11 +192,12 @@ 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; + 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; }; @@ -195,11 +205,14 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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; }; @@ -207,11 +220,14 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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; }; @@ -219,123 +235,136 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_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 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; } - - template + VMChangeSynthParamFunction(InstrumentScriptVM* parent, bool acceptFinal, StdUnit_t unit, bool acceptUnitPrefix) + : m_vm(parent), m_acceptFinal(acceptFinal), m_acceptUnitPrefix(acceptUnitPrefix), 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, StdUnit_t type) 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 bool m_acceptUnitPrefix; + const StdUnit_t m_unit; }; class InstrumentScriptVMFunction_change_sustain : public VMChangeSynthParamFunction { public: - InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL,true) {} + 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); + InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {} + 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); + InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {} + 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); + InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL,true) {} + 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); + InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {} + 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); + InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {} + 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); + InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {} + 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); + InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {} + 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); + InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {} + 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); + InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {} + 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); + InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {} + 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); + InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {} + 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); + InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {} + 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); + InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; }; class VMChangeFadeCurveFunction : public VMEmptyResultFunction { public: VMChangeFadeCurveFunction(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; @@ -344,29 +373,31 @@ class InstrumentScriptVMFunction_change_vol_curve : public VMChangeFadeCurveFunction { public: InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {} - VMFnResult* exec(VMFnArgs* args); + 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); + 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); + 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; + ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -374,11 +405,13 @@ 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; + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; + ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -386,11 +419,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; }; @@ -398,11 +431,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; }; @@ -410,11 +443,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; }; @@ -422,11 +455,11 @@ 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; }; @@ -434,11 +467,13 @@ class InstrumentScriptVMFunction_change_play_pos : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_change_play_pos(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; } + bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; + bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; + ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } + VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; @@ -446,11 +481,11 @@ 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; }; @@ -458,11 +493,11 @@ class InstrumentScriptVMFunction_callback_status : public VMIntResultFunction { public: InstrumentScriptVMFunction_callback_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; }; @@ -471,17 +506,17 @@ 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; }; @@ -489,10 +524,10 @@ class InstrumentScriptVMFunction_abort : public VMEmptyResultFunction { public: InstrumentScriptVMFunction_abort(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; } - 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; } + ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; } VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; @@ -501,11 +536,11 @@ class InstrumentScriptVMFunction_fork : public VMIntResultFunction { public: InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent); - int minRequiredArgs() const { return 0; } - 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 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; };