/[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 2598 by schoenebeck, Fri Jun 6 12:38:54 2014 UTC revision 2945 by schoenebeck, Thu Jul 14 00:22:26 2016 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 Christian Schoenebeck   * Copyright (c) 2014 - 2016 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 15  Line 15 
15    
16  namespace LinuxSampler {  namespace LinuxSampler {
17    
18        class EventGroup;
19      class InstrumentScriptVM;      class InstrumentScriptVM;
20    
21      class InstrumentScriptVMFunction_play_note : public VMIntResultFunction {      class InstrumentScriptVMFunction_play_note : public VMIntResultFunction {
# Line 29  namespace LinuxSampler { Line 30  namespace LinuxSampler {
30          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;
31      };      };
32    
33        class InstrumentScriptVMFunction_set_controller : public VMIntResultFunction {
34        public:
35            InstrumentScriptVMFunction_set_controller(InstrumentScriptVM* parent);
36            int minRequiredArgs() const { return 2; }
37            int maxAllowedArgs() const { return 2; }
38            bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
39            ExprType_t argType(int iArg) const { return INT_EXPR; }
40            VMFnResult* exec(VMFnArgs* args);
41        protected:
42            InstrumentScriptVM* m_vm;
43        };
44    
45      class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction {      class InstrumentScriptVMFunction_ignore_event : public VMEmptyResultFunction {
46      public:      public:
47          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);          InstrumentScriptVMFunction_ignore_event(InstrumentScriptVM* parent);
48          int minRequiredArgs() const { return 1; }          int minRequiredArgs() const { return 1; }
49          int maxAllowedArgs() const { return 1; }          int maxAllowedArgs() const { return 1; }
50          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(int iArg, ExprType_t type) const;
51          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(int iArg) const { return INT_EXPR; }
52          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args);
53      protected:      protected:
# Line 48  namespace LinuxSampler { Line 61  namespace LinuxSampler {
61          int maxAllowedArgs() const { return 1; }          int maxAllowedArgs() const { return 1; }
62          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}          bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
63          ExprType_t argType(int iArg) const { return INT_EXPR; }          ExprType_t argType(int iArg) const { return INT_EXPR; }
64            VMFnResult* exec(VMFnArgs* args);
65        protected:
66            InstrumentScriptVM* m_vm;
67        };
68    
69        class InstrumentScriptVMFunction_note_off : public VMEmptyResultFunction {
70        public:
71            InstrumentScriptVMFunction_note_off(InstrumentScriptVM* parent);
72            int minRequiredArgs() const { return 1; }
73            int maxAllowedArgs() const { return 2; }
74            bool acceptsArgType(int iArg, ExprType_t type) const;
75            ExprType_t argType(int iArg) const { return INT_EXPR; }
76            VMFnResult* exec(VMFnArgs* args);
77        protected:
78            InstrumentScriptVM* m_vm;
79        };
80    
81        class InstrumentScriptVMFunction_set_event_mark : public VMEmptyResultFunction {
82        public:
83            InstrumentScriptVMFunction_set_event_mark(InstrumentScriptVM* parent);
84            int minRequiredArgs() const { return 2; }
85            int maxAllowedArgs() const { return 2; }
86            bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
87            ExprType_t argType(int iArg) const { return INT_EXPR; }
88            VMFnResult* exec(VMFnArgs* args);
89        protected:
90            InstrumentScriptVM* m_vm;
91        };
92    
93        class InstrumentScriptVMFunction_delete_event_mark : public VMEmptyResultFunction {
94        public:
95            InstrumentScriptVMFunction_delete_event_mark(InstrumentScriptVM* parent);
96            int minRequiredArgs() const { return 2; }
97            int maxAllowedArgs() const { return 2; }
98            bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
99            ExprType_t argType(int iArg) const { return INT_EXPR; }
100            VMFnResult* exec(VMFnArgs* args);
101        protected:
102            InstrumentScriptVM* m_vm;
103        };
104    
105        class InstrumentScriptVMFunction_by_marks : public VMFunction {
106        public:
107            InstrumentScriptVMFunction_by_marks(InstrumentScriptVM* parent);
108            int minRequiredArgs() const { return 1; }
109            int maxAllowedArgs() const { return 1; }
110            bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
111            bool modifiesArg(int iArg) const OVERRIDE { return false; }
112            ExprType_t argType(int iArg) const { return INT_EXPR; }
113            ExprType_t returnType() { return INT_ARR_EXPR; }
114            VMFnResult* exec(VMFnArgs* args);
115        protected:
116            InstrumentScriptVM* m_vm;
117            class Result : public VMFnResult, public VMIntArrayExpr {
118            public:
119                StmtFlags_t flags;
120                EventGroup* eventGroup;
121    
122                int arraySize() const OVERRIDE;
123                int evalIntElement(uint i) OVERRIDE;
124                void assignIntElement(uint i, int value) OVERRIDE {} // ignore assignment
125                VMExpr* resultValue() OVERRIDE { return this; }
126                StmtFlags_t resultFlags() { return flags; }
127                bool isConstExpr() const OVERRIDE { return false; }
128            } m_result;
129    
130            VMFnResult* errorResult();
131            VMFnResult* successResult(EventGroup* eventGroup);
132        };
133    
134        class InstrumentScriptVMFunction_change_vol : public VMEmptyResultFunction {
135        public:
136            InstrumentScriptVMFunction_change_vol(InstrumentScriptVM* parent);
137            int minRequiredArgs() const { return 2; }
138            int maxAllowedArgs() const { return 3; }
139            bool acceptsArgType(int iArg, ExprType_t type) const;
140            ExprType_t argType(int iArg) const { return INT_EXPR; }
141            VMFnResult* exec(VMFnArgs* args);
142        protected:
143            InstrumentScriptVM* m_vm;
144        };
145    
146        class InstrumentScriptVMFunction_change_tune : public VMEmptyResultFunction {
147        public:
148            InstrumentScriptVMFunction_change_tune(InstrumentScriptVM* parent);
149            int minRequiredArgs() const { return 2; }
150            int maxAllowedArgs() const { return 3; }
151            bool acceptsArgType(int iArg, ExprType_t type) const;
152            ExprType_t argType(int iArg) const { return INT_EXPR; }
153            VMFnResult* exec(VMFnArgs* args);
154        protected:
155            InstrumentScriptVM* m_vm;
156        };
157    
158        class InstrumentScriptVMFunction_change_pan : public VMEmptyResultFunction {
159        public:
160            InstrumentScriptVMFunction_change_pan(InstrumentScriptVM* parent);
161            int minRequiredArgs() const { return 2; }
162            int maxAllowedArgs() const { return 3; }
163            bool acceptsArgType(int iArg, ExprType_t type) const;
164            ExprType_t argType(int iArg) const { return INT_EXPR; }
165            VMFnResult* exec(VMFnArgs* args);
166        protected:
167            InstrumentScriptVM* m_vm;
168        };
169    
170        class InstrumentScriptVMFunction_change_cutoff : public VMEmptyResultFunction {
171        public:
172            InstrumentScriptVMFunction_change_cutoff(InstrumentScriptVM* parent);
173            int minRequiredArgs() const { return 2; }
174            int maxAllowedArgs() const { return 2; }
175            bool acceptsArgType(int iArg, ExprType_t type) const;
176            ExprType_t argType(int iArg) const { return INT_EXPR; }
177            VMFnResult* exec(VMFnArgs* args);
178        protected:
179            InstrumentScriptVM* m_vm;
180        };
181    
182        class InstrumentScriptVMFunction_change_reso : public VMEmptyResultFunction {
183        public:
184            InstrumentScriptVMFunction_change_reso(InstrumentScriptVM* parent);
185            int minRequiredArgs() const { return 2; }
186            int maxAllowedArgs() const { return 2; }
187            bool acceptsArgType(int iArg, ExprType_t type) const;
188            ExprType_t argType(int iArg) const { return INT_EXPR; }
189            VMFnResult* exec(VMFnArgs* args);
190        protected:
191            InstrumentScriptVM* m_vm;
192        };
193    
194        class InstrumentScriptVMFunction_event_status : public VMIntResultFunction {
195        public:
196            InstrumentScriptVMFunction_event_status(InstrumentScriptVM* parent);
197            int minRequiredArgs() const { return 1; }
198            int maxAllowedArgs() const { return 1; }
199            bool acceptsArgType(int iArg, ExprType_t type) const { return type == INT_EXPR;}
200            ExprType_t argType(int iArg) const { return INT_EXPR; }
201          VMFnResult* exec(VMFnArgs* args);          VMFnResult* exec(VMFnArgs* args);
202      protected:      protected:
203          InstrumentScriptVM* m_vm;          InstrumentScriptVM* m_vm;

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

  ViewVC Help
Powered by ViewVC