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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3293 - (hide annotations) (download) (as text)
Tue Jun 27 22:19:19 2017 UTC (6 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2603 byte(s)
* NKSP: Added built-in script function "fork()".
* NKSP: Added built-in array variable %NKSP_CALLBACK_CHILD_ID[].
* NKSP: Added built-in variable $NKSP_CALLBACK_PARENT_ID.
* NKSP: Fixed potential crash when accessing dynamic built-in
  array variables.
* Bumped version (2.0.0.svn65).

1 schoenebeck 2942 /*
2 schoenebeck 3073 * Copyright (c) 2016 - 2017 Christian Schoenebeck
3 schoenebeck 2942 *
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 schoenebeck 3073 #include "Event.h"
16 schoenebeck 2942
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 schoenebeck 2948 /**
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 schoenebeck 3073 /**
46 schoenebeck 3293 * Implements the built-in array %NKSP_CALLBACK_CHILD_ID[] script variable.
47     */
48     class InstrumentScriptVMDynVar_NKSP_CALLBACK_CHILD_ID : public VMDynIntArrayVar {
49     public:
50     InstrumentScriptVMDynVar_NKSP_CALLBACK_CHILD_ID(InstrumentScriptVM* parent);
51     VMIntArrayExpr* asIntArray() const OVERRIDE;
52     int arraySize() const OVERRIDE;
53     bool isAssignable() const OVERRIDE { return false; }
54     int evalIntElement(uint i) OVERRIDE;
55     void assignIntElement(uint i, int value) OVERRIDE {}
56     protected:
57     InstrumentScriptVM* m_vm;
58     };
59    
60     /**
61 schoenebeck 3073 * Implements the built-in %ALL_EVENTS script array variable.
62     */
63     class InstrumentScriptVMDynVar_ALL_EVENTS : public VMDynIntArrayVar {
64     public:
65     InstrumentScriptVMDynVar_ALL_EVENTS(InstrumentScriptVM* parent);
66     virtual ~InstrumentScriptVMDynVar_ALL_EVENTS();
67     VMIntArrayExpr* asIntArray() const OVERRIDE;
68     int arraySize() const OVERRIDE;
69     bool isAssignable() const OVERRIDE { return false; }
70     int evalIntElement(uint i) OVERRIDE;
71     void assignIntElement(uint i, int value) OVERRIDE {}
72     protected:
73     void updateNoteIDs();
74     private:
75     InstrumentScriptVM* m_vm;
76     note_id_t* m_ids;
77     uint m_numIDs;
78     };
79    
80 schoenebeck 2942 } // namespace LinuxSampler
81    
82     #endif // LS_INSTRSCRIPTVMDYNVARS_H

  ViewVC Help
Powered by ViewVC