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

Contents of /linuxsampler/trunk/src/engines/common/InstrumentScriptVMDynVars.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3073 - (show annotations) (download) (as text)
Thu Jan 5 16:04:00 2017 UTC (7 years, 3 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2007 byte(s)
* NKSP: Implemented built-in script array variable "%ALL_EVENTS".
* Bumped version (2.0.0.svn35).

1 /*
2 * Copyright (c) 2016 - 2017 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_INSTRSCRIPTVMDYNVARS_H
11 #define LS_INSTRSCRIPTVMDYNVARS_H
12
13 #include "../../common/global.h"
14 #include "../../scriptvm/CoreVMDynVars.h"
15 #include "Event.h"
16
17 namespace LinuxSampler {
18
19 class InstrumentScriptVM;
20
21 /**
22 * Implements the built-in $ENGINE_UPTIME script variable.
23 */
24 class InstrumentScriptVMDynVar_ENGINE_UPTIME : public VMDynIntVar {
25 public:
26 InstrumentScriptVMDynVar_ENGINE_UPTIME(InstrumentScriptVM* parent) : m_vm(parent) {}
27 bool isAssignable() const OVERRIDE { return false; }
28 int evalInt() OVERRIDE;
29 protected:
30 InstrumentScriptVM* m_vm;
31 };
32
33 /**
34 * Implements the built-in $NI_CALLBACK_ID script variable.
35 */
36 class InstrumentScriptVMDynVar_NI_CALLBACK_ID : public VMDynIntVar {
37 public:
38 InstrumentScriptVMDynVar_NI_CALLBACK_ID(InstrumentScriptVM* parent) : m_vm(parent) {}
39 bool isAssignable() const OVERRIDE { return false; }
40 int evalInt() OVERRIDE;
41 protected:
42 InstrumentScriptVM* m_vm;
43 };
44
45 /**
46 * Implements the built-in %ALL_EVENTS script array variable.
47 */
48 class InstrumentScriptVMDynVar_ALL_EVENTS : public VMDynIntArrayVar {
49 public:
50 InstrumentScriptVMDynVar_ALL_EVENTS(InstrumentScriptVM* parent);
51 virtual ~InstrumentScriptVMDynVar_ALL_EVENTS();
52 VMIntArrayExpr* asIntArray() const OVERRIDE;
53 int arraySize() const OVERRIDE;
54 bool isAssignable() const OVERRIDE { return false; }
55 int evalIntElement(uint i) OVERRIDE;
56 void assignIntElement(uint i, int value) OVERRIDE {}
57 protected:
58 void updateNoteIDs();
59 private:
60 InstrumentScriptVM* m_vm;
61 note_id_t* m_ids;
62 uint m_numIDs;
63 };
64
65 } // namespace LinuxSampler
66
67 #endif // LS_INSTRSCRIPTVMDYNVARS_H

  ViewVC Help
Powered by ViewVC