/[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 2594 - (show annotations) (download) (as text)
Thu Jun 5 00:16:25 2014 UTC (9 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 1759 byte(s)
* ScriptVM (WIP): started to integrate real-time instrument script
  support into the sampler engine implementations. The code is
  shared among all sampler engines, however currently only the gig
  file format supports storing instrument scripts (as LinuxSampler
  extension to the original GigaStudio 4 file format).
* gig engine: Added support for loading instrument scripts from .gig
  files.
* ScriptVM (WIP): Implemented built-in script variables %CC, $CC_NUM,
  $EVENT_NOTE, $EVENT_VELOCITY, $VCC_MONO_AT, $VCC_PITCH_BEND.
* ScriptVM (WIP): Implemented execution of script event handler "init".
* ScriptVM (WIP): Implemented execution of script event handler
  "controller".
* Bumped version (1.0.0.svn42).

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
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

  ViewVC Help
Powered by ViewVC