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

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

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

revision 2938 by schoenebeck, Mon Jul 11 17:10:40 2016 UTC revision 2953 by schoenebeck, Sat Jul 16 11:24:39 2016 UTC
# Line 29  Line 29 
29  #include "../../common/RTAVLTree.h"  #include "../../common/RTAVLTree.h"
30  #include "../../common/Pool.h"  #include "../../common/Pool.h"
31  #include "../EngineChannel.h"  #include "../EngineChannel.h"
32    #include "../../scriptvm/common.h"
33    
34  namespace LinuxSampler {  namespace LinuxSampler {
35    
# Line 67  namespace LinuxSampler { Line 68  namespace LinuxSampler {
68              RTList<ScriptEvent>::Iterator popNextScheduledScriptEvent(RTAVLTree<ScriptEvent>& queue, Pool<ScriptEvent>& pool, sched_time_t end);              RTList<ScriptEvent>::Iterator popNextScheduledScriptEvent(RTAVLTree<ScriptEvent>& queue, Pool<ScriptEvent>& pool, sched_time_t end);
69    
70              /**              /**
71                 * Returns the scheduler time for the first sample point of the
72                 * current audio fragment cycle.
73                 */
74                sched_time_t schedTimeAtCurrentFragmentStart() const {
75                    return uiTotalSamplesProcessed;
76                }
77    
78                /**
79               * Returns the scheduler time for the first sample point of the next               * Returns the scheduler time for the first sample point of the next
80               * audio fragment cycle.               * audio fragment cycle.
81               */               */
# Line 124  namespace LinuxSampler { Line 133  namespace LinuxSampler {
133      typedef pool_element_id_t note_id_t;      typedef pool_element_id_t note_id_t;
134    
135      /**      /**
136         * Unique numeric ID of a script callback ID instance which can be used to
137         * retrieve access to the actual @c ScriptEvent object. Once the script
138         * callback instance associated with a certain ID stopped its execution
139         * (that is completely stopped, not just suspended) then this numeric ID
140         * becomes invalid and Pool< ScriptEvent >::fromID() will detect this
141         * circumstance and will return an invalid Iterator, and thus will prevent
142         * you from misusing a script callback instance which no longer "exists".
143         */
144        typedef pool_element_id_t script_callback_id_t;
145    
146        /**
147       * Events are usually caused by a MIDI source or an internal modulation       * Events are usually caused by a MIDI source or an internal modulation
148       * controller like LFO or EG. An event should only be created by an       * controller like LFO or EG. An event should only be created by an
149       * EventGenerator!       * EventGenerator!
# Line 154  namespace LinuxSampler { Line 174  namespace LinuxSampler {
174                  synth_param_pan,                  synth_param_pan,
175                  synth_param_cutoff,                  synth_param_cutoff,
176                  synth_param_resonance,                  synth_param_resonance,
177                    synth_param_attack,
178                    synth_param_decay,
179                    synth_param_release,
180              };              };
181              union {              union {
182                  /// Note-on and note-off event specifics                  /// Note-on and note-off event specifics
# Line 224  namespace LinuxSampler { Line 247  namespace LinuxSampler {
247                  TimeStamp = other.TimeStamp;                  TimeStamp = other.TimeStamp;
248                  iFragmentPos = other.iFragmentPos;                  iFragmentPos = other.iFragmentPos;
249              }              }
250                inline sched_time_t SchedTime() {
251                    return pEventGenerator->schedTimeAtCurrentFragmentStart() + FragmentPos();
252                }
253          protected:          protected:
254              typedef EventGenerator::time_stamp_t time_stamp_t;              typedef EventGenerator::time_stamp_t time_stamp_t;
255              Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time);              Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time);
# Line 242  namespace LinuxSampler { Line 268  namespace LinuxSampler {
268       */       */
269      class SchedulerNode : public RTAVLNode {      class SchedulerNode : public RTAVLNode {
270      public:      public:
271            using RTAVLNode::reset; // make reset() method public
272    
273          sched_time_t scheduleTime; ///< Time ahead in future (in sample points) when this object shall be processed. This value is compared with EventGenerator's uiTotalSamplesProcessed member variable.          sched_time_t scheduleTime; ///< Time ahead in future (in sample points) when this object shall be processed. This value is compared with EventGenerator's uiTotalSamplesProcessed member variable.
274    
275          /// Required operator implementation for RTAVLTree class.          /// Required operator implementation for RTAVLTree class.
# Line 253  namespace LinuxSampler { Line 281  namespace LinuxSampler {
281          inline bool operator<(const SchedulerNode& other) const {          inline bool operator<(const SchedulerNode& other) const {
282              return this->scheduleTime < other.scheduleTime;              return this->scheduleTime < other.scheduleTime;
283          }          }
284    
285            /// This is actually just for code readability.
286            inline RTAVLTreeBase* currentSchedulerQueue() const { return rtavlTree(); }
287      };      };
288    
289      /**      /**
# Line 289  namespace LinuxSampler { Line 320  namespace LinuxSampler {
320          VMExecContext* execCtx; ///< Script's current execution state (polyphonic variables and execution stack).          VMExecContext* execCtx; ///< Script's current execution state (polyphonic variables and execution stack).
321          int currentHandler; ///< Current index in 'handlers' list above.          int currentHandler; ///< Current index in 'handlers' list above.
322          int executionSlices; ///< Amount of times this script event has been executed by the ScriptVM runner class.          int executionSlices; ///< Amount of times this script event has been executed by the ScriptVM runner class.
323            bool ignoreAllWaitCalls; ///< If true: calling any built-in wait*() script function should be ignored (this variable may be set with the 2nd argument of built-in script function stop_wait()).
324            VMEventHandlerType_t handlerType; ///< Native representation of built-in script variable $NI_CALLBACK_TYPE, reflecting the script event type of this script event.
325      };      };
326    
327      /**      /**

Legend:
Removed from v.2938  
changed lines
  Added in v.2953

  ViewVC Help
Powered by ViewVC