--- linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2020/01/03 10:18:21 3690 +++ linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2020/01/03 12:35:20 3691 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 - 2019 Christian Schoenebeck + * Copyright (c) 2014 - 2020 Christian Schoenebeck * * http://www.linuxsampler.org * @@ -43,6 +43,32 @@ StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; } bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; } 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;} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + protected: + InstrumentScriptVM* m_vm; + }; + + class InstrumentScriptVMFunction_set_rpn FINAL : public VMIntResultFunction { + public: + InstrumentScriptVMFunction_set_rpn(InstrumentScriptVM* parent); + StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; } + bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; } + 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;} + VMFnResult* exec(VMFnArgs* args) OVERRIDE; + protected: + InstrumentScriptVM* m_vm; + }; + + class InstrumentScriptVMFunction_set_nrpn FINAL : public VMIntResultFunction { + public: + InstrumentScriptVMFunction_set_nrpn(InstrumentScriptVM* parent); + StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; } + bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; } + 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;} VMFnResult* exec(VMFnArgs* args) OVERRIDE;