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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2596 - (show annotations) (download) (as text)
Thu Jun 5 19:39:12 2014 UTC (9 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 2021 byte(s)
* ScriptVM (WIP): Implemented execution of script event
  handlers "note" and "release".
* ScriptVM (WIP): Implemented built-in script function
  "play_note()" (only two of the max. four function
  arguments are currently implemented yet though).
* ScriptVM (WIP): Fixed incorrect handling of
  suspended scripts.
* Bumped version (1.0.0.svn43).

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

  ViewVC Help
Powered by ViewVC