/[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 738 by schoenebeck, Tue Aug 16 17:14:25 2005 UTC revision 2317 by persson, Sun Feb 19 12:13:19 2012 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
5   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *   *   Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck   *
6   *   Copyright (C) 2005 Christian Schoenebeck                              *   *   Copyright (C) 2005 - 2012 Christian Schoenebeck                       *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 26  Line 26 
26    
27  #include "../../common/global.h"  #include "../../common/global.h"
28  #include "../../common/RTMath.h"  #include "../../common/RTMath.h"
29  #include "EngineChannel.h"  #include "../EngineChannel.h"
30    
31  namespace LinuxSampler {  namespace LinuxSampler {
32    
# Line 42  namespace LinuxSampler { Line 42  namespace LinuxSampler {
42              EventGenerator(uint SampleRate);              EventGenerator(uint SampleRate);
43              void UpdateFragmentTime(uint SamplesToProcess);              void UpdateFragmentTime(uint SamplesToProcess);
44              Event CreateEvent();              Event CreateEvent();
45                Event CreateEvent(int32_t FragmentPos);
46          protected:          protected:
47              typedef RTMath::time_stamp_t time_stamp_t;              typedef RTMath::time_stamp_t time_stamp_t;
48              inline int32_t ToFragmentPos(time_stamp_t TimeStamp) {              inline int32_t ToFragmentPos(time_stamp_t TimeStamp) {
# Line 60  namespace LinuxSampler { Line 61  namespace LinuxSampler {
61    
62      /**      /**
63       * Events are usually caused by a MIDI source or an internal modulation       * Events are usually caused by a MIDI source or an internal modulation
64       * controller like LFO or EG. An event can only be created by an       * controller like LFO or EG. An event should only be created by an
65       * EventGenerator.       * EventGenerator!
66       *       *
67       * @see EventGenerator       * @see EventGenerator
68       */       */
# Line 82  namespace LinuxSampler { Line 83  namespace LinuxSampler {
83                  struct _Note {                  struct _Note {
84                      uint8_t Key;         ///< MIDI key number of note-on / note-off event.                      uint8_t Key;         ///< MIDI key number of note-on / note-off event.
85                      uint8_t Velocity;    ///< Trigger or release velocity of note-on / note-off event.                      uint8_t Velocity;    ///< Trigger or release velocity of note-on / note-off event.
86                        uint8_t Channel;     ///< MIDI channel (0..15)
87                      int8_t  Layer;       ///< Layer index (usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices).                      int8_t  Layer;       ///< Layer index (usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices).
88                      int8_t  ReleaseTrigger; ///< If new voice should be a release triggered voice (actually boolean field and usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices).                      int8_t  ReleaseTrigger; ///< If new voice should be a release triggered voice (actually boolean field and usually only used if a note-on event has to be postponed, e.g. due to shortage of free voices).
89                        void*   pRegion;     ///< Engine specific pointer to instrument region
90                  } Note;                  } Note;
91                  /// Control change event specifics                  /// Control change event specifics
92                  struct _CC {                  struct _CC {
93                      uint8_t Controller;  ///< MIDI controller number of control change event.                      uint8_t Controller;  ///< MIDI controller number of control change event.
94                      uint8_t Value;       ///< Controller Value of control change event.                      uint8_t Value;       ///< Controller Value of control change event.
95                        uint8_t Channel;     ///< MIDI channel (0..15)
96                  } CC;                  } CC;
97                  /// Pitchbend event specifics                  /// Pitchbend event specifics
98                  struct _Pitch {                  struct _Pitch {
99                      int16_t Pitch;       ///< Pitch value of pitchbend event.                      int16_t Pitch;       ///< Pitch value of pitchbend event.
100                        uint8_t Channel;     ///< MIDI channel (0..15)
101                  } Pitch;                  } Pitch;
102                  /// MIDI system exclusive event specifics                  /// MIDI system exclusive event specifics
103                  struct _Sysex {                  struct _Sysex {
# Line 100  namespace LinuxSampler { Line 105  namespace LinuxSampler {
105                  } Sysex;                  } Sysex;
106              } Param;              } Param;
107              EngineChannel* pEngineChannel; ///< Pointer to the EngineChannel where this event occured on, NULL means Engine global event (e.g. SysEx message).              EngineChannel* pEngineChannel; ///< Pointer to the EngineChannel where this event occured on, NULL means Engine global event (e.g. SysEx message).
108                MidiInputPort* pMidiInputPort; ///< Pointer to the MIDI input port on which this event occured (NOTE: currently only for global events, that is SysEx messages)
109    
110              inline int32_t FragmentPos() {              inline int32_t FragmentPos() {
111                  if (iFragmentPos >= 0) return iFragmentPos;                  if (iFragmentPos >= 0) return iFragmentPos;
# Line 113  namespace LinuxSampler { Line 119  namespace LinuxSampler {
119          protected:          protected:
120              typedef EventGenerator::time_stamp_t time_stamp_t;              typedef EventGenerator::time_stamp_t time_stamp_t;
121              Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time);              Event(EventGenerator* pGenerator, EventGenerator::time_stamp_t Time);
122                Event(EventGenerator* pGenerator, int32_t FragmentPos);
123              friend class EventGenerator;              friend class EventGenerator;
124          private:          private:
125              EventGenerator* pEventGenerator; ///< Creator of the event.              EventGenerator* pEventGenerator; ///< Creator of the event.

Legend:
Removed from v.738  
changed lines
  Added in v.2317

  ViewVC Help
Powered by ViewVC