/[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 2612 by schoenebeck, Fri May 3 14:26:32 2013 UTC revision 2613 by schoenebeck, Tue Jun 10 15:17:01 2014 UTC
# Line 121  namespace LinuxSampler { Line 121  namespace LinuxSampler {
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())              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        class MidiKeyboardManagerBase {
125        public:
126            Pool<uint>*           pActiveKeys;  ///< Holds all keys in it's allocation list with active voices.
127            bool                  SoloMode;                 ///< in Solo Mode we only play one voice (group) at a time
128            int                   SoloKey;                  ///< Currently 'active' solo key, that is the key to which the currently sounding voice belongs to (only if SoloMode is enabled)
129            bool                  SustainPedal;             ///< true if sustain pedal is down
130            bool                  SostenutoPedal;           ///< true if sostenuto pedal is down
131            int                   SostenutoKeys[128];
132            int                   SostenutoKeyCount;
133            uint32_t              RoundRobinIndexes[128];
134            int8_t                KeyDown[128]; ///< True if the respective key is currently pressed down. Currently only used as built-in instrument script array variable %KEY_DOWN. It is currently not used by the sampler for any other purpose.
135        };
136    
137      template <class V>      template <class V>
138      class MidiKeyboardManager {      class MidiKeyboardManager : public MidiKeyboardManagerBase {
139          public:          public:
140              /** @brief Voice Stealing Algorithms              /** @brief Voice Stealing Algorithms
141               *               *
# Line 204  namespace LinuxSampler { Line 217  namespace LinuxSampler {
217              };              };
218    
219              MidiKey*              pMIDIKeyInfo; ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key              MidiKey*              pMIDIKeyInfo; ///< Contains all active voices sorted by MIDI key number and other informations to the respective MIDI key
             Pool<uint>*           pActiveKeys;  ///< Holds all keys in it's allocation list with active voices.  
             bool                  SoloMode;                 ///< in Solo Mode we only play one voice (group) at a time  
             int                   SoloKey;                  ///< Currently 'active' solo key, that is the key to which the currently sounding voice belongs to (only if SoloMode is enabled)  
             bool                  SustainPedal;             ///< true if sustain pedal is down  
             bool                  SostenutoPedal;           ///< true if sostenuto pedal is down  
             int                   SostenutoKeys[128];  
             int                   SostenutoKeyCount;  
             uint32_t              RoundRobinIndexes[128];  
220    
221              MidiKeyboardManager() {              MidiKeyboardManager() {
222                  pMIDIKeyInfo = new MidiKey[128];                  pMIDIKeyInfo = new MidiKey[128];
# Line 221  namespace LinuxSampler { Line 226  namespace LinuxSampler {
226                  SostenutoPedal = false;                  SostenutoPedal = false;
227                  for (int i = 0 ; i < 128 ; i++) {                  for (int i = 0 ; i < 128 ; i++) {
228                      RoundRobinIndexes[i] = 0;                      RoundRobinIndexes[i] = 0;
229                        KeyDown[i] = false;
230    
231                      // by default use one counter for each key (the                      // by default use one counter for each key (the
232                      // gig engine will change this to one counter per                      // gig engine will change this to one counter per
# Line 239  namespace LinuxSampler { Line 245  namespace LinuxSampler {
245                  SoloKey = -1;    // no solo key active yet                  SoloKey = -1;    // no solo key active yet
246    
247                  // reset key info                  // reset key info
248                  for (uint i = 0; i < 128; i++) pMIDIKeyInfo[i].Reset();                  for (uint i = 0; i < 128; i++) {
249                        pMIDIKeyInfo[i].Reset();
250                        KeyDown[i] = false;
251                    }
252    
253                  // free all active keys                  // free all active keys
254                  pActiveKeys->clear();                  pActiveKeys->clear();

Legend:
Removed from v.2612  
changed lines
  Added in v.2613

  ViewVC Help
Powered by ViewVC