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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2645 by schoenebeck, Wed Jun 18 00:14:57 2014 UTC revision 2871 by schoenebeck, Sun Apr 10 18:22:23 2016 UTC
# Line 1  Line 1 
1  /*  /*
2   * Copyright (c) 2014 Christian Schoenebeck   * Copyright (c) 2014-2016 Christian Schoenebeck
3   *   *
4   * http://www.linuxsampler.org   * http://www.linuxsampler.org
5   *   *
# Line 36  namespace LinuxSampler { Line 36  namespace LinuxSampler {
36          void erase(int eventID);          void erase(int eventID);
37          void setScript(InstrumentScript* pScript) { m_script = pScript; }          void setScript(InstrumentScript* pScript) { m_script = pScript; }
38          inline int size() const { return ConstCapacityArray<int>::size(); }          inline int size() const { return ConstCapacityArray<int>::size(); }
39            inline void clear() { ConstCapacityArray<int>::clear(); }
40          inline int& operator[](uint index) { return ConstCapacityArray<int>::operator[](index); }          inline int& operator[](uint index) { return ConstCapacityArray<int>::operator[](index); }
41          inline const int& operator[](uint index) const { return ConstCapacityArray<int>::operator[](index); }          inline const int& operator[](uint index) const { return ConstCapacityArray<int>::operator[](index); }
42      protected:      protected:
# Line 63  namespace LinuxSampler { Line 64  namespace LinuxSampler {
64          VMEventHandler*       handlerController; ///< VM representation of script's MIDI controller callback or NULL if current script did not define such an event handler.          VMEventHandler*       handlerController; ///< VM representation of script's MIDI controller callback or NULL if current script did not define such an event handler.
65          Pool<ScriptEvent>*    pEvents; ///< Pool of all available script execution instances. ScriptEvents available to be allocated from the Pool are currently unused / not executiong, whereas the ScriptEvents allocated on the list are currently suspended / have not finished execution yet (@see pKeyEvents).          Pool<ScriptEvent>*    pEvents; ///< Pool of all available script execution instances. ScriptEvents available to be allocated from the Pool are currently unused / not executiong, whereas the ScriptEvents allocated on the list are currently suspended / have not finished execution yet (@see pKeyEvents).
66          RTList<ScriptEvent>*  pKeyEvents[128]; ///< Stores previously finished executed "note on" script events for the respective active note/key as long as the key/note is active. This is however only done if there is a "note" script event handler and a "release" script event handler defined in the script and both handlers use (reference) polyphonic variables. If that is not the case, then this list is not used at all. So the purpose of pKeyEvents is only to implement preserving/passing polyphonic variable data from "on note .. end on" script block to the respective "on release .. end on" script block.          RTList<ScriptEvent>*  pKeyEvents[128]; ///< Stores previously finished executed "note on" script events for the respective active note/key as long as the key/note is active. This is however only done if there is a "note" script event handler and a "release" script event handler defined in the script and both handlers use (reference) polyphonic variables. If that is not the case, then this list is not used at all. So the purpose of pKeyEvents is only to implement preserving/passing polyphonic variable data from "on note .. end on" script block to the respective "on release .. end on" script block.
67            RTAVLTree<ScriptEvent> suspendedEvents; ///< Contains pointers to all suspended events, sorted by time when those script events are to be resumed next.
68          AbstractEngineChannel* pEngineChannel;          AbstractEngineChannel* pEngineChannel;
69          String                code; ///< Source code of the instrument script. Used in case the sampler engine is changed, in that case a new ScriptVM object is created for the engine and VMParserContext object for this script needs to be recreated as well. Thus the script is then parsed again by passing the source code to recreate the parser context.          String                code; ///< Source code of the instrument script. Used in case the sampler engine is changed, in that case a new ScriptVM object is created for the engine and VMParserContext object for this script needs to be recreated as well. Thus the script is then parsed again by passing the source code to recreate the parser context.
70          EventGroup            eventGroups[INSTR_SCRIPT_EVENT_GROUPS]; ///< Used for built-in script functions: by_event_marks(), set_event_mark(), delete_event_mark().          EventGroup            eventGroups[INSTR_SCRIPT_EVENT_GROUPS]; ///< Used for built-in script functions: by_event_marks(), set_event_mark(), delete_event_mark().
# Line 73  namespace LinuxSampler { Line 75  namespace LinuxSampler {
75          void load(const String& text);          void load(const String& text);
76          void unload();          void unload();
77          void resetAll();          void resetAll();
78            void resetEvents();
79      };      };
80    
81      /** @brief Real-time instrument script virtual machine.      /** @brief Real-time instrument script virtual machine.

Legend:
Removed from v.2645  
changed lines
  Added in v.2871

  ViewVC Help
Powered by ViewVC