--- linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2017/04/16 23:20:30 3117 +++ linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h 2017/04/21 13:33:03 3118 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 - 2016 Christian Schoenebeck + * Copyright (c) 2014 - 2017 Christian Schoenebeck * * http://www.linuxsampler.org * @@ -12,6 +12,7 @@ #include "../../common/global.h" #include "../../scriptvm/CoreVMFunctions.h" +#include "Note.h" namespace LinuxSampler { @@ -227,6 +228,44 @@ 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 + VMFnResult* execTemplate(VMFnArgs* args, const char* functionName); + protected: + InstrumentScriptVM* m_vm; + }; + + class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args); + }; + + class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args); + }; + + class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args); + }; + + class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction { + public: + InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {} + VMFnResult* exec(VMFnArgs* args); + }; + class InstrumentScriptVMFunction_event_status : public VMIntResultFunction { public: InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);