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

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

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

revision 2120 by persson, Tue Aug 10 12:05:19 2010 UTC revision 2121 by schoenebeck, Tue Sep 14 17:09:08 2010 UTC
# Line 96  namespace LinuxSampler { Line 96  namespace LinuxSampler {
96              virtual void PreProcessSostenutoPedalDown() { }              virtual void PreProcessSostenutoPedalDown() { }
97              virtual void PostProcessSostenutoPedalDown() { }              virtual void PostProcessSostenutoPedalDown() { }
98      };      };
99        
100        /**
101         * This is the base class for class MidiKeyboardManager::MidiKey. It is
102         * not intended to be instantiated directly. Instead it just defines
103         * the part of class MidiKey which is not dependant on a C++ template
104         * parameter.
105         */
106        class MidiKeyBase {
107            public:
108                bool            KeyPressed;     ///< Is true if the respective MIDI key is currently pressed.
109                bool            Active;         ///< If the key contains active voices.
110                bool            ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released
111                Pool<uint>::Iterator itSelf;    ///< hack to allow fast deallocation of the key from the list of active keys
112                RTList<Event>*  pEvents;        ///< Key specific events (only Note-on, Note-off and sustain pedal currently)
113                int             VoiceTheftsQueued; ///< Amount of voices postponed due to shortage of voices.
114                uint32_t*       pRoundRobinIndex; ///< For the round robin dimension: current articulation for this key, will be incremented for each note on
115                uint8_t         Velocity;       ///< Latest Note-on velocity for this key
116                unsigned long   NoteOnTime;     ///< Time for latest Note-on event for this key
117                float           Volume;         ///< Individual volume level for this MIDI key (usually 1.0f unless Roland GS NRPN 0x1Ann was received, nn reflecting the note number, see EngineBase::ProcessHardcodedControllers())
118                float           PanLeft;        ///< Individual volume balance (left channel coefficient) for this MIDI key (usually 1.0f unless Roland GS NRPN 0x1Cnn was received, nn reflecting the note number, see EngineBase::ProcessHardcodedControllers())
119                float           PanRight;       ///< Individual volume balance (right channel coefficient) for this MIDI key (usually 1.0f unless Roland GS NRPN 0x1Cnn was received, nn reflecting the note number, see EngineBase::ProcessHardcodedControllers())
120                optional<float> ReverbSend;     ///< Optional individual reverb send level for this MIDI key (usually not set, unless Roland GS NRPN 0x1Dnn was received, nn reflecting the note number, see EngineBase::ProcessHardcodedControllers())
121                optional<float> ChorusSend;     ///< Optional individual chorus send level for this MIDI key (usually not set, unless Roland GS NRPN 0x1Enn was received, nn reflecting the note number, see EngineBase::ProcessHardcodedControllers())
122        };
123    
124      template <class V>      template <class V>
125      class MidiKeyboardManager {      class MidiKeyboardManager {
# Line 115  namespace LinuxSampler { Line 139  namespace LinuxSampler {
139               *               *
140               * Reflects runtime informations for one MIDI key.               * Reflects runtime informations for one MIDI key.
141               */               */
142              class MidiKey {              class MidiKey : public MidiKeyBase {
143              public:              public:
144                  RTList<V>*      pActiveVoices;  ///< Contains the active voices associated with the MIDI key.                  RTList<V>* pActiveVoices;  ///< Contains the active voices associated with the MIDI key.
                 bool            KeyPressed;     ///< Is true if the respective MIDI key is currently pressed.  
                 bool            Active;         ///< If the key contains active voices.  
                 bool            ReleaseTrigger; ///< If we have to launch release triggered voice(s) when the key is released  
                 Pool<uint>::Iterator itSelf;    ///< hack to allow fast deallocation of the key from the list of active keys  
                 RTList<Event>*  pEvents;        ///< Key specific events (only Note-on, Note-off and sustain pedal currently)  
                 int             VoiceTheftsQueued; ///< Amount of voices postponed due to shortage of voices.  
                 uint32_t*       pRoundRobinIndex; ///< For the round robin dimension: current articulation for this key, will be incremented for each note on  
                 uint8_t         Velocity;       ///< Latest Note-on velocity for this key  
                 unsigned long   NoteOnTime;     ///< Time for latest Note-on event for this key  
145    
146                  MidiKey() {                  MidiKey() {
147                      pActiveVoices  = NULL;                      pActiveVoices  = NULL;
# Line 135  namespace LinuxSampler { Line 150  namespace LinuxSampler {
150                      ReleaseTrigger = false;                      ReleaseTrigger = false;
151                      pEvents        = NULL;                      pEvents        = NULL;
152                      VoiceTheftsQueued = 0;                      VoiceTheftsQueued = 0;
153                        Volume = 1.0f;
154                        PanLeft = 1.0f;
155                        PanRight = 1.0f;
156                  }                  }
157    
158                  void Reset() {                  void Reset() {
# Line 145  namespace LinuxSampler { Line 163  namespace LinuxSampler {
163                      ReleaseTrigger    = false;                      ReleaseTrigger    = false;
164                      itSelf            = Pool<uint>::Iterator();                      itSelf            = Pool<uint>::Iterator();
165                      VoiceTheftsQueued = 0;                      VoiceTheftsQueued = 0;
166                        Volume = 1.0f;
167                        PanLeft = 1.0f;
168                        PanRight = 1.0f;
169                        ReverbSend = optional<float>::nothing;
170                        ChorusSend = optional<float>::nothing;
171                  }                  }
172              };              };
173    

Legend:
Removed from v.2120  
changed lines
  Added in v.2121

  ViewVC Help
Powered by ViewVC