1 |
schoenebeck |
2594 |
/* |
2 |
|
|
* Copyright (c) 2014 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_INSTRUMENT_SCRIPT_VM_H |
11 |
|
|
#define LS_INSTRUMENT_SCRIPT_VM_H |
12 |
|
|
|
13 |
|
|
#include "../../common/global.h" |
14 |
|
|
#include "../../scriptvm/ScriptVM.h" |
15 |
|
|
#include "Event.h" |
16 |
|
|
|
17 |
|
|
namespace LinuxSampler { |
18 |
|
|
|
19 |
|
|
/** @brief Real-time instrument script virtual machine. |
20 |
|
|
* |
21 |
|
|
* Extends the core ScriptVM implementation with MIDI specific built-in |
22 |
|
|
* script functions and MIDI specific built-in script variables required |
23 |
|
|
* for MIDI processing by instrument script for all sampler engine |
24 |
|
|
* implementations (sampler formats) of this sampler. |
25 |
|
|
* |
26 |
|
|
* Note that this class is currently re-entrant safe, but @b not thread |
27 |
|
|
* safe! See also comments of base class ScriptVM regarding this issue. |
28 |
|
|
*/ |
29 |
|
|
class InstrumentScriptVM : public ScriptVM { |
30 |
|
|
public: |
31 |
|
|
InstrumentScriptVM(); |
32 |
|
|
VMExecStatus_t exec(VMParserContext* parserCtx, ScriptEvent* event); |
33 |
|
|
std::map<String,VMIntRelPtr*> builtInIntVariables() OVERRIDE; |
34 |
|
|
std::map<String,VMInt8Array*> builtInIntArrayVariables() OVERRIDE; |
35 |
|
|
std::map<String,int> builtInConstIntVariables() OVERRIDE; |
36 |
|
|
protected: |
37 |
|
|
ScriptEvent* m_event; ///< The event currently executed by exec(). |
38 |
|
|
|
39 |
|
|
Event* m_cause; |
40 |
|
|
|
41 |
|
|
// buil-in script variables |
42 |
|
|
VMInt8Array m_CC; |
43 |
|
|
VMInt8RelPtr m_CC_NUM; |
44 |
|
|
VMInt8RelPtr m_EVENT_NOTE; |
45 |
|
|
VMInt8RelPtr m_EVENT_VELOCITY; |
46 |
|
|
//VMIntArray m_KEY_DOWN; //TODO: ... |
47 |
|
|
//VMIntArray m_POLY_AT; //TODO: ... |
48 |
|
|
//int m_POLY_AT_NUM; //TODO: ... |
49 |
|
|
}; |
50 |
|
|
|
51 |
|
|
} // namespace LinuxSampler |
52 |
|
|
|
53 |
|
|
#endif // LS_INSTRUMENT_SCRIPT_VM_H |