/[svn]/linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMFunctions.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2953 by schoenebeck, Sat Jul 16 11:24:39 2016 UTC revision 3188 by schoenebeck, Fri May 19 14:23:12 2017 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 - 2016 Christian Schoenebeck   * Copyright (c) 2014 - 2017 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 12  Line 12 
12    
13  #include "../../common/global.h"  #include "../../common/global.h"
14  #include "../../scriptvm/CoreVMFunctions.h"  #include "../../scriptvm/CoreVMFunctions.h"
15    #include "Note.h"
16    
17  namespace LinuxSampler {  namespace LinuxSampler {
18    
# Line 105  namespace LinuxSampler { Line 106  namespace LinuxSampler {
106      class InstrumentScriptVMFunction_by_marks : public VMFunction {      class InstrumentScriptVMFunction_by_marks : public VMFunction {
107      public:      public:
108          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
109          int minRequiredArgs() const { return 1; }          int minRequiredArgs() const OVERRIDE { return 1; }
110          int maxAllowedArgs() const { return 1; }          int maxAllowedArgs() const OVERRIDE { return 1; }
111          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(int iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
112          bool modifiesArg(int iArg) const OVERRIDE { return false; }          bool modifiesArg(int iArg) const OVERRIDE { return false; }
113          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(int iArg) const OVERRIDE { return INT_EXPR; }
114          ExprType_t returnType() { return INT_ARR_EXPR; }          ExprType_t returnType() OVERRIDE { return INT_ARR_EXPR; }
115          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
116      protected:      protected:
117          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
118          class Result : public VMFnResult, public VMIntArrayExpr {          class Result : public VMFnResult, public VMIntArrayExpr {
# Line 123  namespace LinuxSampler { Line 124  namespace LinuxSampler {
124              int evalIntElement(uint i) OVERRIDE;              int evalIntElement(uint i) OVERRIDE;
125              void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment              void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment
126              VMExpr* resultValue() OVERRIDE { return this; }              VMExpr* resultValue() OVERRIDE { return this; }
127              StmtFlags_t resultFlags() { return flags; }              StmtFlags_t resultFlags() OVERRIDE { return flags; }
128              bool isConstExpr() const OVERRIDE { return false; }              bool isConstExpr() const OVERRIDE { return false; }
129          } m_result;          } m_result;
130    
# Line 223  namespace LinuxSampler { Line 224  namespace LinuxSampler {
224          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(int iArg, ExprType_t type) const;
225          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(int iArg) const { return INT_EXPR; }
226          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args);
227        protected:
228            InstrumentScriptVM* m_vm;
229        };
230    
231        class VMChangeSynthParamFunction : public VMEmptyResultFunction {
232        public:
233            VMChangeSynthParamFunction(InstrumentScriptVM* parent) : m_vm(parent) {}
234            int minRequiredArgs() const { return 2; }
235            int maxAllowedArgs() const { return 2; }
236            bool acceptsArgType(int iArg, ExprType_t type) const;
237            ExprType_t argType(int iArg) const { return INT_EXPR; }
238    
239            template<float NoteBase::_Override::*T_noteParam, int T_synthParam,
240                     bool T_isNormalizedParam, int T_maxValue = 1000000,
241                     int T_minValue = 0>
242            VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
243        protected:
244            InstrumentScriptVM* m_vm;
245        };
246    
247        class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction {
248        public:
249            InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
250            VMFnResult* exec(VMFnArgs* args);
251        };
252    
253        class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction {
254        public:
255            InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
256            VMFnResult* exec(VMFnArgs* args);
257        };
258    
259        class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction {
260        public:
261            InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
262            VMFnResult* exec(VMFnArgs* args);
263        };
264    
265        class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction {
266        public:
267            InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
268            VMFnResult* exec(VMFnArgs* args);
269        };
270    
271        class InstrumentScriptVMFunction_change_vol_time : public VMChangeSynthParamFunction {
272        public:
273            InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
274            VMFnResult* exec(VMFnArgs* args);
275        };
276    
277        class InstrumentScriptVMFunction_change_tune_time : public VMChangeSynthParamFunction {
278        public:
279            InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}
280            VMFnResult* exec(VMFnArgs* args);
281        };
282    
283        class InstrumentScriptVMFunction_fade_in : public VMEmptyResultFunction {
284        public:
285            InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);
286            int minRequiredArgs() const { return 2; }
287            int maxAllowedArgs() const { return 2; }
288            bool acceptsArgType(int iArg, ExprType_t type) const;
289            ExprType_t argType(int iArg) const { return INT_EXPR; }
290            VMFnResult* exec(VMFnArgs* args);
291        protected:
292            InstrumentScriptVM* m_vm;
293        };
294    
295        class InstrumentScriptVMFunction_fade_out : public VMEmptyResultFunction {
296        public:
297            InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);
298            int minRequiredArgs() const { return 2; }
299            int maxAllowedArgs() const { return 3; }
300            bool acceptsArgType(int iArg, ExprType_t type) const;
301            ExprType_t argType(int iArg) const { return INT_EXPR; }
302            VMFnResult* exec(VMFnArgs* args);
303      protected:      protected:
304          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
305      };      };

Legend:
Removed from v.2953  
changed lines
  Added in v.3188

  ViewVC Help
Powered by ViewVC