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

Contents of /linuxsampler/trunk/src/engines/gig/InstrumentScriptVMFunctions.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3585 - (show annotations) (download) (as text)
Fri Aug 30 17:51:24 2019 UTC (4 years, 7 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 1821 byte(s)
NKSP: Cleanup regarding multiple data types for built-in function args.

* NKSP VM API cleanup: Get rid of legacy method
  VMFunction::argType(vmint iArg) which was already superseded by its new
  replacement VMFunction::acceptsArgType(vmint iArg, ExprType_t type).

* NKSP parser: if wrong argument type was passed to a built-in function and
  that built-in function accepts more than one data type for the argument,
  then show all supported data types as parser error message.

* Bumped version (2.1.1.svn10).

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_GIG_INSTRSCRIPTVMFUNCTIONS_H
11 #define LS_GIG_INSTRSCRIPTVMFUNCTIONS_H
12
13 #include "../common/InstrumentScriptVMFunctions.h"
14
15 namespace LinuxSampler { namespace gig {
16
17 class InstrumentScriptVM;
18
19 /**
20 * Built-in script function:
21 *
22 * gig_set_dim_zone(event_id, dimension, zone)
23 */
24 class InstrumentScriptVMFunction_gig_set_dim_zone FINAL : public VMEmptyResultFunction {
25 public:
26 InstrumentScriptVMFunction_gig_set_dim_zone(InstrumentScriptVM* parent);
27 vmint minRequiredArgs() const OVERRIDE { return 3; }
28 vmint maxAllowedArgs() const OVERRIDE { return 3; }
29 bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE;
30 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
31 protected:
32 InstrumentScriptVM* m_vm;
33 };
34
35 /**
36 * Built-in script function:
37 *
38 * same_region(key1, key2)
39 */
40 class InstrumentScriptVMFunction_same_region FINAL : public VMIntResultFunction {
41 public:
42 InstrumentScriptVMFunction_same_region(InstrumentScriptVM* parent);
43 StdUnit_t returnUnitType(VMFnArgs* args) OVERRIDE { return VM_NO_UNIT; }
44 bool returnsFinal(VMFnArgs* args) OVERRIDE { return false; }
45 vmint minRequiredArgs() const OVERRIDE { return 2; }
46 vmint maxAllowedArgs() const OVERRIDE { return 2; }
47 bool acceptsArgType(vmint iArg, ExprType_t type) const OVERRIDE { return INT_EXPR; }
48 VMFnResult* exec(VMFnArgs* args) OVERRIDE;
49 protected:
50 InstrumentScriptVM* m_vm;
51 };
52
53 }} // namespace LinuxSampler::gig
54
55 #endif // LS_GIG_INSTRSCRIPTVMFUNCTIONS_H

  ViewVC Help
Powered by ViewVC