/[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 3246 by schoenebeck, Sun May 28 22:22:56 2017 UTC revision 3743 by schoenebeck, Fri Feb 14 15:35:53 2020 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 - 2017 Christian Schoenebeck   * Copyright (c) 2014 - 2020 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 19  namespace LinuxSampler { Line 19  namespace LinuxSampler {
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            using Super = VMIntResultFunction; // just an alias for the super class
24      public:      public:
25          InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);
26          int minRequiredArgs() const { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
27          int maxAllowedArgs() const { return 4; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
28          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
29          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 4; }
30          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
31            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
32            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
33            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
34                           std::function<void(String)> wrn) OVERRIDE;
35            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
36      protected:      protected:
37          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
38      };      };
39    
40      class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction {      class InstrumentScriptVMFunction_set_controller FINAL : public VMIntResultFunction {
41      public:      public:
42          InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);
43          int minRequiredArgs() const { return 2; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
44          int maxAllowedArgs() const { return 2; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
45          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 2; }
46          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
47          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
48            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
49        protected:
50            InstrumentScriptVM* m_vm;
51        };
52    
53        class InstrumentScriptVMFunction_set_rpn FINAL : public VMIntResultFunction {
54        public:
55            InstrumentScriptVMFunction_set_rpn(InstrumentScriptVM* parent);
56            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
57            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
58            vmint minRequiredArgs() const OVERRIDE { return 2; }
59            vmint maxAllowedArgs() const OVERRIDE { return 2; }
60            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
61            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
62        protected:
63            InstrumentScriptVM* m_vm;
64        };
65    
66        class InstrumentScriptVMFunction_set_nrpn FINAL : public VMIntResultFunction {
67        public:
68            InstrumentScriptVMFunction_set_nrpn(InstrumentScriptVM* parent);
69            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
70            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
71            vmint minRequiredArgs() const OVERRIDE { return 2; }
72            vmint maxAllowedArgs() const OVERRIDE { return 2; }
73            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
74            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
75      protected:      protected:
76          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
77      };      };
78    
79      class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_ignore_event FINAL : public VMEmptyResultFunction {
80      public:      public:
81          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);
82          int minRequiredArgs() const { return 0; }          vmint minRequiredArgs() const OVERRIDE { return 0; }
83          int maxAllowedArgs() const { return 1; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
84          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
85          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
         VMFnResult* exec(VMFnArgs* args);  
86      protected:      protected:
87          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
88      };      };
89    
90      class InstrumentScriptVMFunction_ignore_controller : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_ignore_controller FINAL : public VMEmptyResultFunction {
91      public:      public:
92          InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);
93          int minRequiredArgs() const { return 0; }          vmint minRequiredArgs() const OVERRIDE { return 0; }
94          int maxAllowedArgs() const { return 1; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
95          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;}
96          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
         VMFnResult* exec(VMFnArgs* args);  
97      protected:      protected:
98          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
99      };      };
100    
101      class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_note_off FINAL : public VMEmptyResultFunction {
102            using Super = VMEmptyResultFunction; // just an alias for the super class
103      public:      public:
104          InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);
105          int minRequiredArgs() const { return 1; }          vmint minRequiredArgs() const OVERRIDE { return 1; }
106          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
107          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
108          ExprType_t argType(int iArg) const { return INT_EXPR; }          void checkArgs(VMFnArgs* args, std::function<void(String)> err,
109          VMFnResult* exec(VMFnArgs* args);                         std::function<void(String)> wrn) OVERRIDE;
110            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
111      protected:      protected:
112          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
113      };      };
114    
115      class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_set_event_mark FINAL : public VMEmptyResultFunction {
116            using Super = VMEmptyResultFunction; // just an alias for the super class
117      public:      public:
118          InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);
119          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
120          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
121          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;}
122          ExprType_t argType(int iArg) const { return INT_EXPR; }          void checkArgs(VMFnArgs* args, std::function<void(String)> err,
123          VMFnResult* exec(VMFnArgs* args);                         std::function<void(String)> wrn) OVERRIDE;
124            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
125      protected:      protected:
126          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
127      };      };
128    
129      class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_delete_event_mark FINAL : public VMEmptyResultFunction {
130            using Super = VMEmptyResultFunction; // just an alias for the super class
131      public:      public:
132          InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);
133          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
134          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
135          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;}
136          ExprType_t argType(int iArg) const { return INT_EXPR; }          void checkArgs(VMFnArgs* args, std::function<void(String)> err,
137          VMFnResult* exec(VMFnArgs* args);                         std::function<void(String)> wrn) OVERRIDE;
138            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
139      protected:      protected:
140          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
141      };      };
142    
143      class InstrumentScriptVMFunction_by_marks : public VMFunction {      class InstrumentScriptVMFunction_by_marks FINAL : public VMFunction {
144            using Super = VMFunction; // just an alias for the super class
145      public:      public:
146          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
147          int minRequiredArgs() const OVERRIDE { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
148          int maxAllowedArgs() const OVERRIDE { return 1; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
149          bool acceptsArgType(int iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
150          bool modifiesArg(int iArg) const OVERRIDE { return false; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
151          ExprType_t argType(int iArg) const OVERRIDE { return INT_EXPR; }          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
152          ExprType_t returnType() OVERRIDE { return INT_ARR_EXPR; }          bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
153            ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_ARR_EXPR; }
154            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
155                           std::function<void(String)> wrn) OVERRIDE;
156          VMFnResult* exec(VMFnArgs* args) OVERRIDE;          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
157      protected:      protected:
158          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
# Line 120  namespace LinuxSampler { Line 161  namespace LinuxSampler {
161              StmtFlags_t flags;              StmtFlags_t flags;
162              EventGroup* eventGroup;              EventGroup* eventGroup;
163    
164              int arraySize() const OVERRIDE;              vmint arraySize() const OVERRIDE;
165              int evalIntElement(uint i) OVERRIDE;              vmint evalIntElement(vmuint i) OVERRIDE;
166              void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment              void assignIntElement(vmuint i, vmint value) OVERRIDE {} // ignore assignment
167                vmfloat unitFactorOfElement(vmuint i) const OVERRIDE { return VM_NO_FACTOR; }
168                void assignElementUnitFactor(vmuint i, vmfloat factor) OVERRIDE {} // ignore assignment
169              VMExpr* resultValue() OVERRIDE { return this; }              VMExpr* resultValue() OVERRIDE { return this; }
170              StmtFlags_t resultFlags() OVERRIDE { return flags; }              StmtFlags_t resultFlags() OVERRIDE { return flags; }
171              bool isConstExpr() const OVERRIDE { return false; }              bool isConstExpr() const OVERRIDE { return false; }
# Line 132  namespace LinuxSampler { Line 175  namespace LinuxSampler {
175          VMFnResult* successResult(EventGroup* eventGroup);          VMFnResult* successResult(EventGroup* eventGroup);
176      };      };
177    
178      class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_vol FINAL : public VMEmptyResultFunction {
179      public:      public:
180          InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);
181          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
182          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
183          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
184          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
185          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
186            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
187            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
188      protected:      protected:
189          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
190      };      };
191    
192      class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_tune FINAL : public VMEmptyResultFunction {
193      public:      public:
194          InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);
195          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
196          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
197          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
198          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
199          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
200            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
201      protected:      protected:
202          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
203      };      };
204    
205      class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_pan FINAL : public VMEmptyResultFunction {
206      public:      public:
207          InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);
208          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
209          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
210          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
211          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
212          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
213      protected:      protected:
214          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
215      };      };
216    
217      class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_cutoff FINAL : public VMEmptyResultFunction {
218            using Super = VMEmptyResultFunction; // just an alias for the super class
219      public:      public:
220          InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);
221          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
222          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
223          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
224          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
225          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
226            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
227            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
228                           std::function<void(String)> wrn) OVERRIDE;
229            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
230      protected:      protected:
231          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
232      };      };
233    
234      class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_reso FINAL : public VMEmptyResultFunction {
235      public:      public:
236          InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);
237          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
238          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
239          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
240          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgFinal(vmint iArg) const OVERRIDE;
241          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
242      protected:      protected:
243          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
244      };      };
245        
246      class InstrumentScriptVMFunction_change_attack : public VMEmptyResultFunction {      //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_attack() implementation below already does).
247        class InstrumentScriptVMFunction_change_attack FINAL : public VMEmptyResultFunction {
248            using Super = VMEmptyResultFunction; // just an alias for the super class
249      public:      public:
250          InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent);
251          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
252          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
253          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
254          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
255          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
256            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
257            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
258                           std::function<void(String)> wrn) OVERRIDE;
259            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
260      protected:      protected:
261          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
262      };      };
263    
264      class InstrumentScriptVMFunction_change_decay : public VMEmptyResultFunction {      //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_decay() implementation below already does).
265        class InstrumentScriptVMFunction_change_decay FINAL : public VMEmptyResultFunction {
266            using Super = VMEmptyResultFunction; // just an alias for the super class
267      public:      public:
268          InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent);
269          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
270          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
271          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
272          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
273          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
274            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
275            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
276                           std::function<void(String)> wrn) OVERRIDE;
277            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
278      protected:      protected:
279          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
280      };      };
281        
282      class InstrumentScriptVMFunction_change_release : public VMEmptyResultFunction {      //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_release() implementation below already does).
283        class InstrumentScriptVMFunction_change_release FINAL : public VMEmptyResultFunction {
284            using Super = VMEmptyResultFunction; // just an alias for the super class
285      public:      public:
286          InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent);
287          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
288          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
289          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
290          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
291          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
292            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
293            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
294                           std::function<void(String)> wrn) OVERRIDE;
295            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
296      protected:      protected:
297          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
298      };      };
299    
300      class VMChangeSynthParamFunction : public VMEmptyResultFunction {      class VMChangeSynthParamFunction : public VMEmptyResultFunction {
301            using Super = VMEmptyResultFunction; // just an alias for the super class
302      public:      public:
303          VMChangeSynthParamFunction(InstrumentScriptVM* parent) : m_vm(parent) {}          struct Opt_t {
304          int minRequiredArgs() const { return 2; }              InstrumentScriptVM* vm = NULL; ///< Parent object owning the built-in function implementation object.
305          int maxAllowedArgs() const { return 2; }              bool acceptFinal = false; ///< Whether built-in function allows 'final' operator for its 2nd function argument.
306          bool acceptsArgType(int iArg, ExprType_t type) const;              StdUnit_t unit = VM_NO_UNIT; ///< Whether built-in functions accepts a unit type for its 2nd function argument and if yes which one.
307          ExprType_t argType(int iArg) const { return INT_EXPR; }              bool acceptUnitPrefix = false; ///< Whether built-in function accepts metric unit prefix(es) for its 2nd function argument.
308                bool acceptReal = false; ///< Whether the built-in function accepts both int and real number as data type for its 2nd function argument (otherwise its int only if false).
309          template<float NoteBase::_Override::*T_noteParam, int T_synthParam,          };
310                   bool T_isNormalizedParam, int T_maxValue, int T_minValue>          VMChangeSynthParamFunction(const Opt_t& opt)
311                : m_vm(opt.vm), m_acceptReal(opt.acceptReal),
312                  m_acceptFinal(opt.acceptFinal),
313                  m_acceptUnitPrefix(opt.acceptUnitPrefix), m_unit(opt.unit) {}
314            vmint minRequiredArgs() const OVERRIDE { return 2; }
315            vmint maxAllowedArgs() const OVERRIDE { return 2; }
316            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
317            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
318            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
319            bool acceptsArgFinal(vmint iArg) const OVERRIDE;
320            void checkArgs(VMFnArgs* args, std::function<void(String)> err,
321                           std::function<void(String)> wrn) OVERRIDE;
322    
323            template<class T_NoteParamType, T_NoteParamType NoteBase::_Override::*T_noteParam,
324                    vmint T_synthParam,
325                    vmint T_minValueNorm, vmint T_maxValueNorm, bool T_normalizeNorm,
326                    vmint T_minValueUnit, vmint T_maxValueUnit,
327                    MetricPrefix_t T_unitPrefix0, MetricPrefix_t ... T_unitPrefixN>
328          VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);          VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
329      protected:      protected:
330          InstrumentScriptVM* m_vm;          InstrumentScriptVM* const m_vm;
331            const bool m_acceptReal;
332            const bool m_acceptFinal;
333            const bool m_acceptUnitPrefix;
334            const StdUnit_t m_unit;
335        };
336    
337        class InstrumentScriptVMFunction_change_sustain FINAL : public VMChangeSynthParamFunction {
338        public:
339            InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
340                .vm = parent,
341                .acceptFinal = true,
342                .unit = VM_BEL,
343                .acceptUnitPrefix = true,
344                .acceptReal = true,
345            }) {}
346            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
347        };
348    
349        class InstrumentScriptVMFunction_change_cutoff_attack FINAL : public VMChangeSynthParamFunction {
350        public:
351            InstrumentScriptVMFunction_change_cutoff_attack(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
352                .vm = parent,
353                .acceptFinal = true,
354                .unit = VM_SECOND,
355                .acceptUnitPrefix = true,
356                .acceptReal = true,
357            }) {}
358            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
359        };
360    
361        class InstrumentScriptVMFunction_change_cutoff_decay FINAL : public VMChangeSynthParamFunction {
362        public:
363            InstrumentScriptVMFunction_change_cutoff_decay(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
364                .vm = parent,
365                .acceptFinal = true,
366                .unit = VM_SECOND,
367                .acceptUnitPrefix = true,
368                .acceptReal = true,
369            }) {}
370            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
371      };      };
372    
373      class InstrumentScriptVMFunction_change_amp_lfo_depth : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_cutoff_sustain FINAL : public VMChangeSynthParamFunction {
374      public:      public:
375          InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
376          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
377                .acceptFinal = true,
378                .unit = VM_BEL,
379                .acceptUnitPrefix = true,
380                .acceptReal = true,
381            }) {}
382            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
383      };      };
384    
385      class InstrumentScriptVMFunction_change_amp_lfo_freq : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_cutoff_release FINAL : public VMChangeSynthParamFunction {
386      public:      public:
387          InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
388          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
389                .acceptFinal = true,
390                .unit = VM_SECOND,
391                .acceptUnitPrefix = true,
392                .acceptReal = true,
393            }) {}
394            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
395      };      };
396    
397      class InstrumentScriptVMFunction_change_pitch_lfo_depth : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_amp_lfo_depth FINAL : public VMChangeSynthParamFunction {
398      public:      public:
399          InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
400          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
401                .acceptFinal = true,
402                .unit = VM_NO_UNIT,
403                .acceptUnitPrefix = false,
404                .acceptReal = false,
405            }) {}
406            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
407      };      };
408    
409      class InstrumentScriptVMFunction_change_pitch_lfo_freq : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_amp_lfo_freq FINAL : public VMChangeSynthParamFunction {
410      public:      public:
411          InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
412          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
413                .acceptFinal = true,
414                .unit = VM_HERTZ,
415                .acceptUnitPrefix = true,
416                .acceptReal = true,
417            }) {}
418            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
419      };      };
420    
421      class InstrumentScriptVMFunction_change_vol_time : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_cutoff_lfo_depth FINAL : public VMChangeSynthParamFunction {
422      public:      public:
423          InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
424          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
425                .acceptFinal = true,
426                .unit = VM_NO_UNIT,
427                .acceptUnitPrefix = false,
428                .acceptReal = false,
429            }) {}
430            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
431      };      };
432    
433      class InstrumentScriptVMFunction_change_tune_time : public VMChangeSynthParamFunction {      class InstrumentScriptVMFunction_change_cutoff_lfo_freq FINAL : public VMChangeSynthParamFunction {
434      public:      public:
435          InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction(parent) {}          InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
436          VMFnResult* exec(VMFnArgs* args);              .vm = parent,
437                .acceptFinal = true,
438                .unit = VM_HERTZ,
439                .acceptUnitPrefix = true,
440                .acceptReal = true,
441            }) {}
442            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
443        };
444    
445        class InstrumentScriptVMFunction_change_pitch_lfo_depth FINAL : public VMChangeSynthParamFunction {
446        public:
447            InstrumentScriptVMFunction_change_pitch_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
448                .vm = parent,
449                .acceptFinal = true,
450                .unit = VM_NO_UNIT,
451                .acceptUnitPrefix = false,
452                .acceptReal = false,
453            }) {}
454            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
455        };
456    
457        class InstrumentScriptVMFunction_change_pitch_lfo_freq FINAL : public VMChangeSynthParamFunction {
458        public:
459            InstrumentScriptVMFunction_change_pitch_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
460                .vm = parent,
461                .acceptFinal = true,
462                .unit = VM_HERTZ,
463                .acceptUnitPrefix = true,
464                .acceptReal = true,
465            }) {}
466            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
467        };
468    
469        class InstrumentScriptVMFunction_change_vol_time FINAL : public VMChangeSynthParamFunction {
470        public:
471            InstrumentScriptVMFunction_change_vol_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
472                .vm = parent,
473                .acceptFinal = false,
474                .unit = VM_SECOND,
475                .acceptUnitPrefix = true,
476                .acceptReal = true,
477            }) {}
478            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
479        };
480    
481        class InstrumentScriptVMFunction_change_tune_time FINAL : public VMChangeSynthParamFunction {
482        public:
483            InstrumentScriptVMFunction_change_tune_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
484                .vm = parent,
485                .acceptFinal = false,
486                .unit = VM_SECOND,
487                .acceptUnitPrefix = true,
488                .acceptReal = true,
489            }) {}
490            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
491        };
492    
493        class InstrumentScriptVMFunction_change_pan_time FINAL : public VMChangeSynthParamFunction {
494        public:
495            InstrumentScriptVMFunction_change_pan_time(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
496                .vm = parent,
497                .acceptFinal = false,
498                .unit = VM_SECOND,
499                .acceptUnitPrefix = true,
500                .acceptReal = true,
501            }) {}
502            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
503      };      };
504    
505      class VMChangeFadeCurveFunction : public VMEmptyResultFunction {      class VMChangeFadeCurveFunction : public VMEmptyResultFunction {
506      public:      public:
507          VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {}          VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {}
508          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
509          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
510          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
         ExprType_t argType(int iArg) const { return INT_EXPR; }  
511    
512          template<fade_curve_t NoteBase::_Override::*T_noteParam, int T_synthParam>          template<fade_curve_t NoteBase::_Override::*T_noteParam, vmint T_synthParam>
513          VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);          VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
514      protected:      protected:
515          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
516      };      };
517    
518      class InstrumentScriptVMFunction_change_vol_curve : public VMChangeFadeCurveFunction {      class InstrumentScriptVMFunction_change_vol_curve FINAL : public VMChangeFadeCurveFunction {
519      public:      public:
520          InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}          InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
521          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
522      };      };
523    
524      class InstrumentScriptVMFunction_change_tune_curve : public VMChangeFadeCurveFunction {      class InstrumentScriptVMFunction_change_tune_curve FINAL : public VMChangeFadeCurveFunction {
525      public:      public:
526          InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}          InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
527          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
528      };      };
529    
530      class InstrumentScriptVMFunction_fade_in : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_pan_curve FINAL : public VMChangeFadeCurveFunction {
531        public:
532            InstrumentScriptVMFunction_change_pan_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
533            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
534        };
535    
536        class InstrumentScriptVMFunction_fade_in FINAL : public VMEmptyResultFunction {
537      public:      public:
538          InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);
539          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
540          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
541          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
542          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
543          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
544            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
545      protected:      protected:
546          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
547      };      };
548    
549      class InstrumentScriptVMFunction_fade_out : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_fade_out FINAL : public VMEmptyResultFunction {
550      public:      public:
551          InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);
552          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
553          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
554          bool acceptsArgType(int iArg, ExprType_t type) const;          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
555          ExprType_t argType(int iArg) const { return INT_EXPR; }          bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
556          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
557            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
558      protected:      protected:
559          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
560      };      };
561    
562      class InstrumentScriptVMFunction_get_event_par : public VMIntResultFunction {      class InstrumentScriptVMFunction_get_event_par FINAL : public VMIntResultFunction {
563      public:      public:
564          InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent);
565          int minRequiredArgs() const { return 2; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
566          int maxAllowedArgs() const { return 2; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
567          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 2; }
568          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
569          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
570            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
571      protected:      protected:
572          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
573      };      };
574    
575      class InstrumentScriptVMFunction_set_event_par : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_set_event_par FINAL : public VMEmptyResultFunction {
576      public:      public:
577          InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent);
578          int minRequiredArgs() const { return 3; }          vmint minRequiredArgs() const OVERRIDE { return 3; }
579          int maxAllowedArgs() const { return 3; }          vmint maxAllowedArgs() const OVERRIDE { return 3; }
580          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;}
581          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
         VMFnResult* exec(VMFnArgs* args);  
582      protected:      protected:
583          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
584      };      };
585    
586      class InstrumentScriptVMFunction_change_note : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_note FINAL : public VMEmptyResultFunction {
587      public:      public:
588          InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent);
589          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
590          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
591          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;}
592          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
         VMFnResult* exec(VMFnArgs* args);  
593      protected:      protected:
594          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
595      };      };
596    
597      class InstrumentScriptVMFunction_change_velo : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_change_velo FINAL : public VMEmptyResultFunction {
598      public:      public:
599          InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent);
600          int minRequiredArgs() const { return 2; }          vmint minRequiredArgs() const OVERRIDE { return 2; }
601          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
602          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;}
603          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
604          VMFnResult* exec(VMFnArgs* args);      protected:
605            InstrumentScriptVM* m_vm;
606        };
607    
608        class InstrumentScriptVMFunction_change_play_pos FINAL : public VMEmptyResultFunction {
609        public:
610            InstrumentScriptVMFunction_change_play_pos(InstrumentScriptVM* parent);
611            vmint minRequiredArgs() const OVERRIDE { return 2; }
612            vmint maxAllowedArgs() const OVERRIDE { return 2; }
613            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
614            bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
615            bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
616            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
617      protected:      protected:
618          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
619      };      };
620    
621      class InstrumentScriptVMFunction_event_status : public VMIntResultFunction {      class InstrumentScriptVMFunction_event_status FINAL : public VMIntResultFunction {
622      public:      public:
623          InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);
624          int minRequiredArgs() const { return 1; }          StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
625          int maxAllowedArgs() const { return 1; }          bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
626          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          vmint minRequiredArgs() const OVERRIDE { return 1; }
627          ExprType_t argType(int iArg) const { return INT_EXPR; }          vmint maxAllowedArgs() const OVERRIDE { return 1; }
628          VMFnResult* exec(VMFnArgs* args);          bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
629            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
630        protected:
631            InstrumentScriptVM* m_vm;
632        };
633    
634        class InstrumentScriptVMFunction_callback_status FINAL : public VMIntResultFunction {
635        public:
636            InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent);
637            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
638            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
639            vmint minRequiredArgs() const OVERRIDE { return 1; }
640            vmint maxAllowedArgs() const OVERRIDE { return 1; }
641            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
642            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
643      protected:      protected:
644          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
645      };      };
646    
647      // overrides core wait() implementation      // overrides core wait() implementation
648      class InstrumentScriptVMFunction_wait : public CoreVMFunction_wait {      class InstrumentScriptVMFunction_wait FINAL : public CoreVMFunction_wait {
649      public:      public:
650          InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent);
651          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
652      };      };
653    
654      class InstrumentScriptVMFunction_stop_wait : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_stop_wait FINAL : public VMEmptyResultFunction {
655      public:      public:
656          InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent);
657          int minRequiredArgs() const { return 1; }          vmint minRequiredArgs() const OVERRIDE { return 1; }
658          int maxAllowedArgs() const { return 2; }          vmint maxAllowedArgs() const OVERRIDE { return 2; }
659          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;}
660          ExprType_t argType(int iArg) const { return INT_EXPR; }          VMFnResult* exec(VMFnArgs* args) OVERRIDE;
661          VMFnResult* exec(VMFnArgs* args);      protected:
662            InstrumentScriptVM* m_vm;
663        };
664    
665        class InstrumentScriptVMFunction_abort FINAL : public VMEmptyResultFunction {
666        public:
667            InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent);
668            vmint minRequiredArgs() const OVERRIDE { return 1; }
669            vmint maxAllowedArgs() const OVERRIDE { return 1; }
670            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR; }
671            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
672        protected:
673            InstrumentScriptVM* m_vm;
674        };
675    
676        class InstrumentScriptVMFunction_fork FINAL : public VMIntResultFunction {
677        public:
678            InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent);
679            StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
680            bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
681            vmint minRequiredArgs() const OVERRIDE { return 0; }
682            vmint maxAllowedArgs() const OVERRIDE { return 2; }
683            bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
684            VMFnResult* exec(VMFnArgs* args) OVERRIDE;
685      protected:      protected:
686          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
687      };      };

Legend:
Removed from v.3246  
changed lines
  Added in v.3743

  ViewVC Help
Powered by ViewVC