--- linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2019/08/31 12:08:49 3587 +++ linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2019/09/01 16:06:48 3588 @@ -20,6 +20,7 @@ class InstrumentScriptVM; class InstrumentScriptVMFunction_play_note FINAL : public VMIntResultFunction { + using Super = VMIntResultFunction; // just an alias for the super class public: InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent); StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; } @@ -29,6 +30,8 @@ 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; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; @@ -70,39 +73,49 @@ }; class InstrumentScriptVMFunction_note_off FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class 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; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_set_event_mark FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class 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;} + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_delete_event_mark FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class 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;} + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_by_marks FINAL : public VMFunction { + using Super = VMFunction; // just an alias for the super class public: InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent); StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; } @@ -112,6 +125,8 @@ bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;} bool modifiesArg(vmint iArg) const OVERRIDE { return false; } ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_ARR_EXPR; } + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; @@ -174,6 +189,7 @@ }; class InstrumentScriptVMFunction_change_cutoff FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class public: InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } @@ -182,6 +198,8 @@ bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; @@ -200,6 +218,7 @@ }; class InstrumentScriptVMFunction_change_attack FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class public: InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } @@ -208,12 +227,15 @@ bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_decay FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class public: InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } @@ -222,12 +244,15 @@ bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class InstrumentScriptVMFunction_change_release FINAL : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class public: InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent); vmint minRequiredArgs() const OVERRIDE { return 2; } @@ -236,12 +261,15 @@ bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; VMFnResult* exec(VMFnArgs* args) OVERRIDE; protected: InstrumentScriptVM* m_vm; }; class VMChangeSynthParamFunction : public VMEmptyResultFunction { + using Super = VMEmptyResultFunction; // just an alias for the super class public: struct Opt_t { InstrumentScriptVM* vm = NULL; ///< Parent object owning the built-in function implementation object. @@ -260,6 +288,8 @@ bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE; bool acceptsArgFinal(vmint iArg) const OVERRIDE; + void checkArgs(VMFnArgs* args, std::function err, + std::function wrn) OVERRIDE; template