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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3743 - (hide annotations) (download) (as text)
Fri Feb 14 15:35:53 2020 UTC (4 years, 2 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 32425 byte(s)
- Just added some TODO comments.

- Minor white space cleanup.

1 schoenebeck 2596 /*
2 schoenebeck 3691 * Copyright (c) 2014 - 2020 Christian Schoenebeck
3 schoenebeck 2596 *
4     * http://www.linuxsampler.org
5     *
6     * This file is part of LinuxSampler and released under the same terms.
7     * See README file for details.
8     */
9    
10     #ifndef LS_INSTRSCRIPTVMFUNCTIONS_H
11     #define LS_INSTRSCRIPTVMFUNCTIONS_H
12    
13     #include "../../common/global.h"
14     #include "../../scriptvm/CoreVMFunctions.h"
15 schoenebeck 3118 #include "Note.h"
16 schoenebeck 2596
17     namespace LinuxSampler {
18    
19 schoenebeck 2630 class EventGroup;
20 schoenebeck 2596 class InstrumentScriptVM;
21    
22 schoenebeck 3581 class InstrumentScriptVMFunction_play_note FINAL : public VMIntResultFunction {
23 schoenebeck 3588 using Super = VMIntResultFunction; // just an alias for the super class
24 schoenebeck 2596 public:
25     InstrumentScriptVMFunction_play_note(InstrumentScriptVM* parent);
26 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
27     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
28 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
29     vmint maxAllowedArgs() const OVERRIDE { return 4; }
30 schoenebeck 3587 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 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
34     std::function<void(String)> wrn) OVERRIDE;
35 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
36 schoenebeck 2596 protected:
37     InstrumentScriptVM* m_vm;
38     };
39    
40 schoenebeck 3581 class InstrumentScriptVMFunction_set_controller FINAL : public VMIntResultFunction {
41 schoenebeck 2600 public:
42     InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);
43 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
44     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
45 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
46     vmint maxAllowedArgs() const OVERRIDE { return 2; }
47     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
48     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
49 schoenebeck 2600 protected:
50     InstrumentScriptVM* m_vm;
51     };
52    
53 schoenebeck 3691 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:
76     InstrumentScriptVM* m_vm;
77     };
78    
79 schoenebeck 3581 class InstrumentScriptVMFunction_ignore_event FINAL : public VMEmptyResultFunction {
80 schoenebeck 2598 public:
81     InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);
82 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 0; }
83     vmint maxAllowedArgs() const OVERRIDE { return 1; }
84     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
85     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
86 schoenebeck 2598 protected:
87     InstrumentScriptVM* m_vm;
88     };
89    
90 schoenebeck 3581 class InstrumentScriptVMFunction_ignore_controller FINAL : public VMEmptyResultFunction {
91 schoenebeck 2598 public:
92     InstrumentScriptVMFunction_ignore_controller(InstrumentScriptVM* parent);
93 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 0; }
94     vmint maxAllowedArgs() const OVERRIDE { return 1; }
95     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
96     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
97 schoenebeck 2598 protected:
98     InstrumentScriptVM* m_vm;
99     };
100    
101 schoenebeck 3581 class InstrumentScriptVMFunction_note_off FINAL : public VMEmptyResultFunction {
102 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
103 schoenebeck 2629 public:
104     InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);
105 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
106     vmint maxAllowedArgs() const OVERRIDE { return 2; }
107     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
108 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
109     std::function<void(String)> wrn) OVERRIDE;
110 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
111 schoenebeck 2630 protected:
112     InstrumentScriptVM* m_vm;
113     };
114    
115 schoenebeck 3581 class InstrumentScriptVMFunction_set_event_mark FINAL : public VMEmptyResultFunction {
116 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
117 schoenebeck 2630 public:
118     InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);
119 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
120     vmint maxAllowedArgs() const OVERRIDE { return 2; }
121     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
122 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
123     std::function<void(String)> wrn) OVERRIDE;
124 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
125 schoenebeck 2629 protected:
126     InstrumentScriptVM* m_vm;
127     };
128    
129 schoenebeck 3581 class InstrumentScriptVMFunction_delete_event_mark FINAL : public VMEmptyResultFunction {
130 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
131 schoenebeck 2630 public:
132     InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);
133 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
134     vmint maxAllowedArgs() const OVERRIDE { return 2; }
135     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
136 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
137     std::function<void(String)> wrn) OVERRIDE;
138 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
139 schoenebeck 2630 protected:
140     InstrumentScriptVM* m_vm;
141     };
142    
143 schoenebeck 3581 class InstrumentScriptVMFunction_by_marks FINAL : public VMFunction {
144 schoenebeck 3588 using Super = VMFunction; // just an alias for the super class
145 schoenebeck 2630 public:
146     InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
147 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
148     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
149 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
150     vmint maxAllowedArgs() const OVERRIDE { return 1; }
151     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
152     bool modifiesArg(vmint iArg) const OVERRIDE { return false; }
153 schoenebeck 3577 ExprType_t returnType(VMFnArgs* args) OVERRIDE { return INT_ARR_EXPR; }
154 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
155     std::function<void(String)> wrn) OVERRIDE;
156 schoenebeck 3054 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
157 schoenebeck 2630 protected:
158     InstrumentScriptVM* m_vm;
159     class Result : public VMFnResult, public VMIntArrayExpr {
160     public:
161     StmtFlags_t flags;
162     EventGroup* eventGroup;
163    
164 schoenebeck 3557 vmint arraySize() const OVERRIDE;
165     vmint evalIntElement(vmuint i) OVERRIDE;
166     void assignIntElement(vmuint i, vmint value) OVERRIDE {} // ignore assignment
167 schoenebeck 3581 vmfloat unitFactorOfElement(vmuint i) const OVERRIDE { return VM_NO_FACTOR; }
168     void assignElementUnitFactor(vmuint i, vmfloat factor) OVERRIDE {} // ignore assignment
169 schoenebeck 2630 VMExpr* resultValue() OVERRIDE { return this; }
170 schoenebeck 3054 StmtFlags_t resultFlags() OVERRIDE { return flags; }
171 schoenebeck 2945 bool isConstExpr() const OVERRIDE { return false; }
172 schoenebeck 2630 } m_result;
173    
174     VMFnResult* errorResult();
175     VMFnResult* successResult(EventGroup* eventGroup);
176     };
177    
178 schoenebeck 3581 class InstrumentScriptVMFunction_change_vol FINAL : public VMEmptyResultFunction {
179 schoenebeck 2931 public:
180     InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);
181 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
182     vmint maxAllowedArgs() const OVERRIDE { return 3; }
183     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
184 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
185 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
186 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
187 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
188 schoenebeck 2931 protected:
189     InstrumentScriptVM* m_vm;
190     };
191    
192 schoenebeck 3581 class InstrumentScriptVMFunction_change_tune FINAL : public VMEmptyResultFunction {
193 schoenebeck 2931 public:
194     InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);
195 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
196     vmint maxAllowedArgs() const OVERRIDE { return 3; }
197     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
198 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
199 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
200 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
201 schoenebeck 2931 protected:
202     InstrumentScriptVM* m_vm;
203     };
204    
205 schoenebeck 3581 class InstrumentScriptVMFunction_change_pan FINAL : public VMEmptyResultFunction {
206 schoenebeck 2931 public:
207     InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);
208 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
209     vmint maxAllowedArgs() const OVERRIDE { return 3; }
210     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
211 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
212 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
213 schoenebeck 2931 protected:
214     InstrumentScriptVM* m_vm;
215     };
216    
217 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff FINAL : public VMEmptyResultFunction {
218 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
219 schoenebeck 2935 public:
220     InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);
221 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
222     vmint maxAllowedArgs() const OVERRIDE { return 2; }
223     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
224 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
225 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
226 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
227 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
228     std::function<void(String)> wrn) OVERRIDE;
229 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
230 schoenebeck 2935 protected:
231     InstrumentScriptVM* m_vm;
232     };
233    
234 schoenebeck 3581 class InstrumentScriptVMFunction_change_reso FINAL : public VMEmptyResultFunction {
235 schoenebeck 2935 public:
236     InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);
237 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
238     vmint maxAllowedArgs() const OVERRIDE { return 2; }
239     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
240 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
241 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
242 schoenebeck 2935 protected:
243     InstrumentScriptVM* m_vm;
244     };
245 schoenebeck 3743
246     //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_attack() implementation below already does).
247 schoenebeck 3581 class InstrumentScriptVMFunction_change_attack FINAL : public VMEmptyResultFunction {
248 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
249 schoenebeck 2953 public:
250     InstrumentScriptVMFunction_change_attack(InstrumentScriptVM* parent);
251 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
252     vmint maxAllowedArgs() const OVERRIDE { return 2; }
253     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
254 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
255 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
256 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
257 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
258     std::function<void(String)> wrn) OVERRIDE;
259 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
260 schoenebeck 2953 protected:
261     InstrumentScriptVM* m_vm;
262     };
263 schoenebeck 2935
264 schoenebeck 3743 //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_decay() implementation below already does).
265 schoenebeck 3581 class InstrumentScriptVMFunction_change_decay FINAL : public VMEmptyResultFunction {
266 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
267 schoenebeck 2953 public:
268     InstrumentScriptVMFunction_change_decay(InstrumentScriptVM* parent);
269 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
270     vmint maxAllowedArgs() const OVERRIDE { return 2; }
271     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
272 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
273 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
274 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
275 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
276     std::function<void(String)> wrn) OVERRIDE;
277 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
278 schoenebeck 2953 protected:
279     InstrumentScriptVM* m_vm;
280     };
281 schoenebeck 3743
282     //TODO: Derive from generalized, shared template class VMChangeSynthParamFunction instead (like e.g. change_cutoff_release() implementation below already does).
283 schoenebeck 3581 class InstrumentScriptVMFunction_change_release FINAL : public VMEmptyResultFunction {
284 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
285 schoenebeck 2953 public:
286     InstrumentScriptVMFunction_change_release(InstrumentScriptVM* parent);
287 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
288     vmint maxAllowedArgs() const OVERRIDE { return 2; }
289     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
290 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
291 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
292 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
293 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
294     std::function<void(String)> wrn) OVERRIDE;
295 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
296 schoenebeck 2953 protected:
297     InstrumentScriptVM* m_vm;
298     };
299    
300 schoenebeck 3118 class VMChangeSynthParamFunction : public VMEmptyResultFunction {
301 schoenebeck 3588 using Super = VMEmptyResultFunction; // just an alias for the super class
302 schoenebeck 3118 public:
303 schoenebeck 3587 struct Opt_t {
304     InstrumentScriptVM* vm = NULL; ///< Parent object owning the built-in function implementation object.
305     bool acceptFinal = false; ///< Whether built-in function allows 'final' operator for its 2nd function argument.
306     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     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     };
310     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 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
315     vmint maxAllowedArgs() const OVERRIDE { return 2; }
316     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
317 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
318 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
319 schoenebeck 3561 bool acceptsArgFinal(vmint iArg) const OVERRIDE;
320 schoenebeck 3588 void checkArgs(VMFnArgs* args, std::function<void(String)> err,
321     std::function<void(String)> wrn) OVERRIDE;
322 schoenebeck 3118
323 schoenebeck 3561 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 schoenebeck 3118 VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
329     protected:
330 schoenebeck 3587 InstrumentScriptVM* const m_vm;
331     const bool m_acceptReal;
332 schoenebeck 3561 const bool m_acceptFinal;
333 schoenebeck 3564 const bool m_acceptUnitPrefix;
334 schoenebeck 3561 const StdUnit_t m_unit;
335 schoenebeck 3118 };
336    
337 schoenebeck 3581 class InstrumentScriptVMFunction_change_sustain FINAL : public VMChangeSynthParamFunction {
338 schoenebeck 3316 public:
339 schoenebeck 3587 InstrumentScriptVMFunction_change_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
340     .vm = parent,
341     .acceptFinal = true,
342     .unit = VM_BEL,
343     .acceptUnitPrefix = true,
344     .acceptReal = true,
345     }) {}
346 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
347 schoenebeck 3316 };
348    
349 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_attack FINAL : public VMChangeSynthParamFunction {
350 schoenebeck 3360 public:
351 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
359 schoenebeck 3360 };
360    
361 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_decay FINAL : public VMChangeSynthParamFunction {
362 schoenebeck 3360 public:
363 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
371 schoenebeck 3360 };
372    
373 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_sustain FINAL : public VMChangeSynthParamFunction {
374 schoenebeck 3360 public:
375 schoenebeck 3587 InstrumentScriptVMFunction_change_cutoff_sustain(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
376     .vm = parent,
377     .acceptFinal = true,
378     .unit = VM_BEL,
379     .acceptUnitPrefix = true,
380     .acceptReal = true,
381     }) {}
382 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
383 schoenebeck 3360 };
384    
385 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_release FINAL : public VMChangeSynthParamFunction {
386 schoenebeck 3360 public:
387 schoenebeck 3587 InstrumentScriptVMFunction_change_cutoff_release(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
388     .vm = parent,
389     .acceptFinal = true,
390     .unit = VM_SECOND,
391     .acceptUnitPrefix = true,
392     .acceptReal = true,
393     }) {}
394 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
395 schoenebeck 3360 };
396    
397 schoenebeck 3581 class InstrumentScriptVMFunction_change_amp_lfo_depth FINAL : public VMChangeSynthParamFunction {
398 schoenebeck 3118 public:
399 schoenebeck 3587 InstrumentScriptVMFunction_change_amp_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
400     .vm = parent,
401     .acceptFinal = true,
402     .unit = VM_NO_UNIT,
403     .acceptUnitPrefix = false,
404     .acceptReal = false,
405     }) {}
406 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
407 schoenebeck 3118 };
408    
409 schoenebeck 3581 class InstrumentScriptVMFunction_change_amp_lfo_freq FINAL : public VMChangeSynthParamFunction {
410 schoenebeck 3118 public:
411 schoenebeck 3587 InstrumentScriptVMFunction_change_amp_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
412     .vm = parent,
413     .acceptFinal = true,
414     .unit = VM_HERTZ,
415     .acceptUnitPrefix = true,
416     .acceptReal = true,
417     }) {}
418 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
419 schoenebeck 3118 };
420    
421 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_lfo_depth FINAL : public VMChangeSynthParamFunction {
422 schoenebeck 3360 public:
423 schoenebeck 3587 InstrumentScriptVMFunction_change_cutoff_lfo_depth(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
424     .vm = parent,
425     .acceptFinal = true,
426     .unit = VM_NO_UNIT,
427     .acceptUnitPrefix = false,
428     .acceptReal = false,
429     }) {}
430 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
431 schoenebeck 3360 };
432    
433 schoenebeck 3581 class InstrumentScriptVMFunction_change_cutoff_lfo_freq FINAL : public VMChangeSynthParamFunction {
434 schoenebeck 3360 public:
435 schoenebeck 3587 InstrumentScriptVMFunction_change_cutoff_lfo_freq(InstrumentScriptVM* parent) : VMChangeSynthParamFunction({
436     .vm = parent,
437     .acceptFinal = true,
438     .unit = VM_HERTZ,
439     .acceptUnitPrefix = true,
440     .acceptReal = true,
441     }) {}
442 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
443 schoenebeck 3360 };
444    
445 schoenebeck 3581 class InstrumentScriptVMFunction_change_pitch_lfo_depth FINAL : public VMChangeSynthParamFunction {
446 schoenebeck 3118 public:
447 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
455 schoenebeck 3118 };
456    
457 schoenebeck 3581 class InstrumentScriptVMFunction_change_pitch_lfo_freq FINAL : public VMChangeSynthParamFunction {
458 schoenebeck 3118 public:
459 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
467 schoenebeck 3118 };
468    
469 schoenebeck 3581 class InstrumentScriptVMFunction_change_vol_time FINAL : public VMChangeSynthParamFunction {
470 schoenebeck 3188 public:
471 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
479 schoenebeck 3188 };
480    
481 schoenebeck 3581 class InstrumentScriptVMFunction_change_tune_time FINAL : public VMChangeSynthParamFunction {
482 schoenebeck 3188 public:
483 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
491 schoenebeck 3188 };
492    
493 schoenebeck 3581 class InstrumentScriptVMFunction_change_pan_time FINAL : public VMChangeSynthParamFunction {
494 schoenebeck 3335 public:
495 schoenebeck 3587 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 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
503 schoenebeck 3335 };
504    
505 schoenebeck 3246 class VMChangeFadeCurveFunction : public VMEmptyResultFunction {
506     public:
507     VMChangeFadeCurveFunction(InstrumentScriptVM* parent) : m_vm(parent) {}
508 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
509     vmint maxAllowedArgs() const OVERRIDE { return 2; }
510     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
511 schoenebeck 3246
512 schoenebeck 3557 template<fade_curve_t NoteBase::_Override::*T_noteParam, vmint T_synthParam>
513 schoenebeck 3246 VMFnResult* execTemplate(VMFnArgs* args, const char* functionName);
514     protected:
515     InstrumentScriptVM* m_vm;
516     };
517    
518 schoenebeck 3581 class InstrumentScriptVMFunction_change_vol_curve FINAL : public VMChangeFadeCurveFunction {
519 schoenebeck 3246 public:
520     InstrumentScriptVMFunction_change_vol_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
521 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
522 schoenebeck 3246 };
523    
524 schoenebeck 3581 class InstrumentScriptVMFunction_change_tune_curve FINAL : public VMChangeFadeCurveFunction {
525 schoenebeck 3246 public:
526     InstrumentScriptVMFunction_change_tune_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
527 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
528 schoenebeck 3246 };
529    
530 schoenebeck 3581 class InstrumentScriptVMFunction_change_pan_curve FINAL : public VMChangeFadeCurveFunction {
531 schoenebeck 3335 public:
532     InstrumentScriptVMFunction_change_pan_curve(InstrumentScriptVM* parent) : VMChangeFadeCurveFunction(parent) {}
533 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
534 schoenebeck 3335 };
535    
536 schoenebeck 3581 class InstrumentScriptVMFunction_fade_in FINAL : public VMEmptyResultFunction {
537 schoenebeck 3188 public:
538     InstrumentScriptVMFunction_fade_in(InstrumentScriptVM* parent);
539 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
540     vmint maxAllowedArgs() const OVERRIDE { return 2; }
541     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
542 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
543 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
544 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
545 schoenebeck 3188 protected:
546     InstrumentScriptVM* m_vm;
547     };
548    
549 schoenebeck 3581 class InstrumentScriptVMFunction_fade_out FINAL : public VMEmptyResultFunction {
550 schoenebeck 3188 public:
551     InstrumentScriptVMFunction_fade_out(InstrumentScriptVM* parent);
552 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
553     vmint maxAllowedArgs() const OVERRIDE { return 3; }
554     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
555 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
556 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
557 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
558 schoenebeck 3188 protected:
559     InstrumentScriptVM* m_vm;
560     };
561    
562 schoenebeck 3581 class InstrumentScriptVMFunction_get_event_par FINAL : public VMIntResultFunction {
563 schoenebeck 3193 public:
564     InstrumentScriptVMFunction_get_event_par(InstrumentScriptVM* parent);
565 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
566     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
567 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
568     vmint maxAllowedArgs() const OVERRIDE { return 2; }
569     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
570     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
571 schoenebeck 3193 protected:
572     InstrumentScriptVM* m_vm;
573     };
574    
575 schoenebeck 3581 class InstrumentScriptVMFunction_set_event_par FINAL : public VMEmptyResultFunction {
576 schoenebeck 3193 public:
577     InstrumentScriptVMFunction_set_event_par(InstrumentScriptVM* parent);
578 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 3; }
579     vmint maxAllowedArgs() const OVERRIDE { return 3; }
580     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
581     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
582 schoenebeck 3193 protected:
583     InstrumentScriptVM* m_vm;
584     };
585    
586 schoenebeck 3581 class InstrumentScriptVMFunction_change_note FINAL : public VMEmptyResultFunction {
587 schoenebeck 3214 public:
588     InstrumentScriptVMFunction_change_note(InstrumentScriptVM* parent);
589 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
590     vmint maxAllowedArgs() const OVERRIDE { return 2; }
591     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
592     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
593 schoenebeck 3214 protected:
594     InstrumentScriptVM* m_vm;
595     };
596    
597 schoenebeck 3581 class InstrumentScriptVMFunction_change_velo FINAL : public VMEmptyResultFunction {
598 schoenebeck 3214 public:
599     InstrumentScriptVMFunction_change_velo(InstrumentScriptVM* parent);
600 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
601     vmint maxAllowedArgs() const OVERRIDE { return 2; }
602     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
603     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
604 schoenebeck 3214 protected:
605     InstrumentScriptVM* m_vm;
606     };
607    
608 schoenebeck 3581 class InstrumentScriptVMFunction_change_play_pos FINAL : public VMEmptyResultFunction {
609 schoenebeck 3255 public:
610     InstrumentScriptVMFunction_change_play_pos(InstrumentScriptVM* parent);
611 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 2; }
612     vmint maxAllowedArgs() const OVERRIDE { return 2; }
613 schoenebeck 3587 bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
614 schoenebeck 3561 bool acceptsArgUnitType(vmint iArg, StdUnit_t type) const OVERRIDE;
615 schoenebeck 3564 bool acceptsArgUnitPrefix(vmint iArg, StdUnit_t type) const OVERRIDE;
616 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
617 schoenebeck 3255 protected:
618     InstrumentScriptVM* m_vm;
619     };
620    
621 schoenebeck 3581 class InstrumentScriptVMFunction_event_status FINAL : public VMIntResultFunction {
622 schoenebeck 2935 public:
623     InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);
624 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
625     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
626 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
627     vmint maxAllowedArgs() const OVERRIDE { return 1; }
628     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
629     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
630 schoenebeck 2935 protected:
631     InstrumentScriptVM* m_vm;
632     };
633    
634 schoenebeck 3581 class InstrumentScriptVMFunction_callback_status FINAL : public VMIntResultFunction {
635 schoenebeck 3296 public:
636     InstrumentScriptVMFunction_callback_status(InstrumentScriptVM* parent);
637 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
638     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
639 schoenebeck 3557 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 schoenebeck 3296 protected:
644     InstrumentScriptVM* m_vm;
645     };
646    
647 schoenebeck 2948 // overrides core wait() implementation
648 schoenebeck 3581 class InstrumentScriptVMFunction_wait FINAL : public CoreVMFunction_wait {
649 schoenebeck 2948 public:
650     InstrumentScriptVMFunction_wait(InstrumentScriptVM* parent);
651 schoenebeck 3557 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
652 schoenebeck 2948 };
653    
654 schoenebeck 3581 class InstrumentScriptVMFunction_stop_wait FINAL : public VMEmptyResultFunction {
655 schoenebeck 2948 public:
656     InstrumentScriptVMFunction_stop_wait(InstrumentScriptVM* parent);
657 schoenebeck 3557 vmint minRequiredArgs() const OVERRIDE { return 1; }
658     vmint maxAllowedArgs() const OVERRIDE { return 2; }
659     bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return type == INT_EXPR;}
660     VMFnResult* exec(VMFnArgs* args) OVERRIDE;
661 schoenebeck 2948 protected:
662     InstrumentScriptVM* m_vm;
663     };
664    
665 schoenebeck 3581 class InstrumentScriptVMFunction_abort FINAL : public VMEmptyResultFunction {
666 schoenebeck 3277 public:
667     InstrumentScriptVMFunction_abort(InstrumentScriptVM* parent);
668 schoenebeck 3557 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 schoenebeck 3277 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
672     protected:
673     InstrumentScriptVM* m_vm;
674     };
675    
676 schoenebeck 3581 class InstrumentScriptVMFunction_fork FINAL : public VMIntResultFunction {
677 schoenebeck 3293 public:
678     InstrumentScriptVMFunction_fork(InstrumentScriptVM* parent);
679 schoenebeck 3581 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
680     bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
681 schoenebeck 3557 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 schoenebeck 3293 protected:
686     InstrumentScriptVM* m_vm;
687     };
688    
689 schoenebeck 2596 } // namespace LinuxSampler
690    
691     #endif // LS_INSTRSCRIPTVMFUNCTIONS_H

  ViewVC Help
Powered by ViewVC