/[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 2945 by schoenebeck, Thu Jul 14 00:22:26 2016 UTC revision 3581 by schoenebeck, Fri Aug 30 11:40:25 2019 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 - 2016 Christian Schoenebeck   * Copyright (c) 2014 - 2019 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    
19      class EventGroup;      class EventGroup;
20      class InstrumentScriptVM;      class InstrumentScriptVM;
21    
22      class InstrumentScriptVMFunction_play_note : public VMIntResultFunction {      class InstrumentScriptVMFunction_play_note FINAL : public VMIntResultFunction {
23      public:      public:
24          InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);
25          int minRequiredArgs() const { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
26          int maxAllowedArgs() const { return 4; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
27          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
28          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 4; }
29          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
30            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
31            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
32      protected:      protected:
33          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
34      };      };
35    
36      class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction {      class InstrumentScriptVMFunction_set_controller FINAL : public VMIntResultFunction {
37      public:      public:
38          InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);
39          int minRequiredArgs() const { return 2; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
40          int maxAllowedArgs() const { return 2; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
41          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 2; }
42          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
43          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
44            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
45            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
46      protected:      protected:
47          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
48      };      };
49    
50      class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_ignore_event FINAL : public VMEmptyResultFunction {
51      public:      public:
52          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);
53          int minRequiredArgs() const { return 1; }          vmint minRequiredArgs() const OVERRIDE { return 0; }
54          int maxAllowedArgs() const { return 1; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
55          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
56          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
57          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
58      protected:      protected:
59          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
60      };      };
61    
62      class InstrumentScriptVMFunction_ignore_controller : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_ignore_controller FINAL : public VMEmptyResultFunction {
63      public:      public:
64          InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);
65          int minRequiredArgs() const { return 0; }          vmint minRequiredArgs() const OVERRIDE { return 0; }
66          int maxAllowedArgs() const { return 1; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
67          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
68          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
69          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
70      protected:      protected:
71          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
72      };      };
73    
74      class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_note_off FINAL : public VMEmptyResultFunction {
75      public:      public:
76          InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);
77          int minRequiredArgs() const { return 1; }          vmint minRequiredArgs() const OVERRIDE { return 1; }
78          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
79          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
80          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
81          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
82      protected:      protected:
83          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
84      };      };
85    
86      class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_set_event_mark FINAL : public VMEmptyResultFunction {
87      public:      public:
88          InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);
89          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
90          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
91          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
92          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
93          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
94      protected:      protected:
95          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
96      };      };
97    
98      class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_delete_event_mark FINAL : public VMEmptyResultFunction {
99      public:      public:
100          InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);
101          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
102          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
103          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
104          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
105          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
106      protected:      protected:
107          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
108      };      };
109    
110      class InstrumentScriptVMFunction_by_marks : public VMFunction {      class InstrumentScriptVMFunction_by_marks FINAL : public VMFunction {
111      public:      public:
112          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
113          int minRequiredArgs() const { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
114          int maxAllowedArgs() const { return 1; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
115          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
116          bool modifiesArg(int iArg) const OVERRIDE { return false; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
117          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
118          ExprType_t returnType() { return INT_ARR_EXPR; }          bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
119          VMFnResult* exec(VMFnArgs* args);          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
120            ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_ARR_EXPR; }
121            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
122      protected:      protected:
123          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
124          class Result : public VMFnResult, public VMIntArrayExpr {          class Result : public VMFnResult, public VMIntArrayExpr {
# Line 119  namespace LinuxSampler { Line 126  namespace LinuxSampler {
126              StmtFlags_t flags;              StmtFlags_t flags;
127              EventGroup* eventGroup;              EventGroup* eventGroup;
128    
129              int arraySize() const OVERRIDE;              vmint arraySize() const OVERRIDE;
130              int evalIntElement(uint i) OVERRIDE;              vmint evalIntElement(vmuint i) OVERRIDE;
131              void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment              void assignIntElement(vmuint i, vmint value) OVERRIDE {} // ignore assignment
132                vmfloat unitFactorOfElement(vmuint i) const OVERRIDE { return VM_NO_FACTOR; }
133                void assignElementUnitFactor(vmuint i, vmfloat factor) OVERRIDE {} // ignore assignment
134              VMExpr* resultValue() OVERRIDE { return this; }              VMExpr* resultValue() OVERRIDE { return this; }
135              StmtFlags_t resultFlags() { return flags; }              StmtFlags_t resultFlags() OVERRIDE { return flags; }
136              bool isConstExpr() const OVERRIDE { return false; }              bool isConstExpr() const OVERRIDE { return false; }
137          } m_result;          } m_result;
138    
# Line 131  namespace LinuxSampler { Line 140  namespace LinuxSampler {
140          VMFnResult* successResult(EventGroup* eventGroup);          VMFnResult* successResult(EventGroup* eventGroup);
141      };      };
142    
143      class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_vol FINAL : public VMEmptyResultFunction {
144      public:      public:
145          InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);
146          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
147          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
148          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
149          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
150          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
151            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
152            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
153            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
154      protected:      protected:
155          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
156      };      };
157    
158      class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_tune FINAL : public VMEmptyResultFunction {
159      public:      public:
160          InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);
161          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
162          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
163          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
164          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
165          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
166            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
167            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
168      protected:      protected:
169          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
170      };      };
171    
172      class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_pan FINAL : public VMEmptyResultFunction {
173      public:      public:
174          InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);
175          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
176          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
177          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
178          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
179          VMFnResult* exec(VMFnArgs* args);          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
180            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
181      protected:      protected:
182          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
183      };      };
184    
185      class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_cutoff FINAL : public VMEmptyResultFunction {
186      public:      public:
187          InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);
188          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
189          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
190          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
191          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
192          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
193            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
194            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
195            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
196      protected:      protected:
197          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
198      };      };
199    
200      class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_reso FINAL : public VMEmptyResultFunction {
201      public:      public:
202          InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);
203          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
204          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
205          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
206          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
207          VMFnResult* exec(VMFnArgs* args);          ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
208            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
209        protected:
210            InstrumentScriptVM* m_vm;
211        };
212        
213        class InstrumentScriptVMFunction_change_attack FINAL : public VMEmptyResultFunction {
214        public:
215            InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent);
216            vmint minRequiredArgs() const OVERRIDE { return 2; }
217            vmint maxAllowedArgs() const OVERRIDE { return 2; }
218            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
219            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
220            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
221            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
222            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
223            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
224        protected:
225            InstrumentScriptVM* m_vm;
226        };
227    
228        class InstrumentScriptVMFunction_change_decay FINAL : public VMEmptyResultFunction {
229        public:
230            InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent);
231            vmint minRequiredArgs() const OVERRIDE { return 2; }
232            vmint maxAllowedArgs() const OVERRIDE { return 2; }
233            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
234            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
235            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
236            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
237            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
238            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
239        protected:
240            InstrumentScriptVM* m_vm;
241        };
242        
243        class InstrumentScriptVMFunction_change_release FINAL : public VMEmptyResultFunction {
244        public:
245            InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent);
246            vmint minRequiredArgs() const OVERRIDE { return 2; }
247            vmint maxAllowedArgs() const OVERRIDE { return 2; }
248            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
249            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
250            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
251            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
252            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
253            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
254        protected:
255            InstrumentScriptVM* m_vm;
256        };
257    
258        class VMChangeSynthParamFunction : public VMEmptyResultFunction {
259        public:
260            VMChangeSynthParamFunction(InstrumentScriptVM* parent, bool acceptFinal, StdUnit_t unit, bool acceptUnitPrefix)
261                : m_vm(parent), m_acceptFinal(acceptFinal), m_acceptUnitPrefix(acceptUnitPrefix), m_unit(unit) {}
262            vmint minRequiredArgs() const OVERRIDE { return 2; }
263            vmint maxAllowedArgs() const OVERRIDE { return 2; }
264            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
265            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
266            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
267            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
268            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
269    
270            template<class T_NoteParamType, T_NoteParamType NoteBase::_Override::*T_noteParam,
271                    vmint T_synthParam,
272                    vmint T_minValueNorm, vmint T_maxValueNorm, bool T_normalizeNorm,
273                    vmint T_minValueUnit, vmint T_maxValueUnit,
274                    MetricPrefix_t T_unitPrefix0, MetricPrefix_t ... T_unitPrefixN>
275            VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
276        protected:
277            InstrumentScriptVM* m_vm;
278            const bool m_acceptFinal;
279            const bool m_acceptUnitPrefix;
280            const StdUnit_t m_unit;
281        };
282    
283        class InstrumentScriptVMFunction_change_sustain FINAL : public VMChangeSynthParamFunction {
284        public:
285            InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL,true) {}
286            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
287        };
288    
289        class InstrumentScriptVMFunction_change_cutoff_attack FINAL : public VMChangeSynthParamFunction {
290        public:
291            InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {}
292            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
293        };
294    
295        class InstrumentScriptVMFunction_change_cutoff_decay FINAL : public VMChangeSynthParamFunction {
296        public:
297            InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {}
298            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
299        };
300    
301        class InstrumentScriptVMFunction_change_cutoff_sustain FINAL : public VMChangeSynthParamFunction {
302        public:
303            InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_BEL,true) {}
304            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
305        };
306    
307        class InstrumentScriptVMFunction_change_cutoff_release FINAL : public VMChangeSynthParamFunction {
308        public:
309            InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_SECOND,true) {}
310            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
311        };
312    
313        class InstrumentScriptVMFunction_change_amp_lfo_depth FINAL : public VMChangeSynthParamFunction {
314        public:
315            InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {}
316            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
317        };
318    
319        class InstrumentScriptVMFunction_change_amp_lfo_freq FINAL : public VMChangeSynthParamFunction {
320        public:
321            InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {}
322            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
323        };
324    
325        class InstrumentScriptVMFunction_change_cutoff_lfo_depth FINAL : public VMChangeSynthParamFunction {
326        public:
327            InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {}
328            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
329        };
330    
331        class InstrumentScriptVMFunction_change_cutoff_lfo_freq FINAL : public VMChangeSynthParamFunction {
332        public:
333            InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {}
334            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
335        };
336    
337        class InstrumentScriptVMFunction_change_pitch_lfo_depth FINAL : public VMChangeSynthParamFunction {
338        public:
339            InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_NO_UNIT,false) {}
340            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
341        };
342    
343        class InstrumentScriptVMFunction_change_pitch_lfo_freq FINAL : public VMChangeSynthParamFunction {
344        public:
345            InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,true,VM_HERTZ,true) {}
346            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
347        };
348    
349        class InstrumentScriptVMFunction_change_vol_time FINAL : public VMChangeSynthParamFunction {
350        public:
351            InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {}
352            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
353        };
354    
355        class InstrumentScriptVMFunction_change_tune_time FINAL : public VMChangeSynthParamFunction {
356        public:
357            InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {}
358            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
359        };
360    
361        class InstrumentScriptVMFunction_change_pan_time FINAL : public VMChangeSynthParamFunction {
362        public:
363            InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent,false,VM_SECOND,true) {}
364            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
365        };
366    
367        class VMChangeFadeCurveFunction : public VMEmptyResultFunction {
368        public:
369            VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {}
370            vmint minRequiredArgs() const OVERRIDE { return 2; }
371            vmint maxAllowedArgs() const OVERRIDE { return 2; }
372            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
373            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
374    
375            template<fade_curve_t NoteBase::_Override::*T_noteParam, vmint T_synthParam>
376            VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
377      protected:      protected:
378          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
379      };      };
380    
381      class InstrumentScriptVMFunction_event_status : public VMIntResultFunction {      class InstrumentScriptVMFunction_change_vol_curve FINAL : public VMChangeFadeCurveFunction {
382        public:
383            InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
384            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
385        };
386    
387        class InstrumentScriptVMFunction_change_tune_curve FINAL : public VMChangeFadeCurveFunction {
388        public:
389            InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
390            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
391        };
392    
393        class InstrumentScriptVMFunction_change_pan_curve FINAL : public VMChangeFadeCurveFunction {
394        public:
395            InstrumentScriptVMFunction_change_pan_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
396            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
397        };
398    
399        class InstrumentScriptVMFunction_fade_in FINAL : public VMEmptyResultFunction {
400        public:
401            InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);
402            vmint minRequiredArgs() const OVERRIDE { return 2; }
403            vmint maxAllowedArgs() const OVERRIDE { return 2; }
404            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
405            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
406            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
407            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
408            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
409        protected:
410            InstrumentScriptVM* m_vm;
411        };
412    
413        class InstrumentScriptVMFunction_fade_out FINAL : public VMEmptyResultFunction {
414        public:
415            InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);
416            vmint minRequiredArgs() const OVERRIDE { return 2; }
417            vmint maxAllowedArgs() const OVERRIDE { return 3; }
418            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
419            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
420            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
421            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
422            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
423        protected:
424            InstrumentScriptVM* m_vm;
425        };
426    
427        class InstrumentScriptVMFunction_get_event_par FINAL : public VMIntResultFunction {
428        public:
429            InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent);
430            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
431            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
432            vmint minRequiredArgs() const OVERRIDE { return 2; }
433            vmint maxAllowedArgs() const OVERRIDE { return 2; }
434            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
435            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
436            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
437        protected:
438            InstrumentScriptVM* m_vm;
439        };
440    
441        class InstrumentScriptVMFunction_set_event_par FINAL : public VMEmptyResultFunction {
442        public:
443            InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent);
444            vmint minRequiredArgs() const OVERRIDE { return 3; }
445            vmint maxAllowedArgs() const OVERRIDE { return 3; }
446            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
447            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
448            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
449        protected:
450            InstrumentScriptVM* m_vm;
451        };
452    
453        class InstrumentScriptVMFunction_change_note FINAL : public VMEmptyResultFunction {
454        public:
455            InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent);
456            vmint minRequiredArgs() const OVERRIDE { return 2; }
457            vmint maxAllowedArgs() const OVERRIDE { return 2; }
458            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
459            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
460            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
461        protected:
462            InstrumentScriptVM* m_vm;
463        };
464    
465        class InstrumentScriptVMFunction_change_velo FINAL : public VMEmptyResultFunction {
466        public:
467            InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent);
468            vmint minRequiredArgs() const OVERRIDE { return 2; }
469            vmint maxAllowedArgs() const OVERRIDE { return 2; }
470            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
471            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
472            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
473        protected:
474            InstrumentScriptVM* m_vm;
475        };
476    
477        class InstrumentScriptVMFunction_change_play_pos FINAL : public VMEmptyResultFunction {
478        public:
479            InstrumentScriptVMFunction_change_play_pos(InstrumentScriptVM* parent);
480            vmint minRequiredArgs() const OVERRIDE { return 2; }
481            vmint maxAllowedArgs() const OVERRIDE { return 2; }
482            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
483            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
484            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
485            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
486            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
487        protected:
488            InstrumentScriptVM* m_vm;
489        };
490    
491        class InstrumentScriptVMFunction_event_status FINAL : public VMIntResultFunction {
492      public:      public:
493          InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);
494          int minRequiredArgs() const { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
495          int maxAllowedArgs() const { return 1; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
496          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
497          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
498          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
499            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
500            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
501        protected:
502            InstrumentScriptVM* m_vm;
503        };
504    
505        class InstrumentScriptVMFunction_callback_status FINAL : public VMIntResultFunction {
506        public:
507            InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent);
508            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
509            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
510            vmint minRequiredArgs() const OVERRIDE { return 1; }
511            vmint maxAllowedArgs() const OVERRIDE { return 1; }
512            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
513            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
514            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
515        protected:
516            InstrumentScriptVM* m_vm;
517        };
518    
519        // overrides core wait() implementation
520        class InstrumentScriptVMFunction_wait FINAL : public CoreVMFunction_wait {
521        public:
522            InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent);
523            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
524        };
525    
526        class InstrumentScriptVMFunction_stop_wait FINAL : public VMEmptyResultFunction {
527        public:
528            InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent);
529            vmint minRequiredArgs() const OVERRIDE { return 1; }
530            vmint maxAllowedArgs() const OVERRIDE { return 2; }
531            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
532            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
533            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
534        protected:
535            InstrumentScriptVM* m_vm;
536        };
537    
538        class InstrumentScriptVMFunction_abort FINAL : public VMEmptyResultFunction {
539        public:
540            InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent);
541            vmint minRequiredArgs() const OVERRIDE { return 1; }
542            vmint maxAllowedArgs() const OVERRIDE { return 1; }
543            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
544            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
545            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
546        protected:
547            InstrumentScriptVM* m_vm;
548        };
549    
550        class InstrumentScriptVMFunction_fork FINAL : public VMIntResultFunction {
551        public:
552            InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent);
553            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
554            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
555            vmint minRequiredArgs() const OVERRIDE { return 0; }
556            vmint maxAllowedArgs() const OVERRIDE { return 2; }
557            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
558            ExprType_t argType(vmint iArg) const OVERRIDE { return INT_EXPR; }
559            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
560      protected:      protected:
561          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
562      };      };

Legend:
Removed from v.2945  
changed lines
  Added in v.3581

  ViewVC Help
Powered by ViewVC