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