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

Diff of /linuxsampler/trunk/src/engines/EngineBase.h

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

revision 2884 by schoenebeck, Wed Apr 20 15:22:58 2016 UTC revision 2927 by schoenebeck, Thu Jun 30 16:44:46 2016 UTC
# Line 1787  namespace LinuxSampler { Line 1787  namespace LinuxSampler {
1787                  // if no solo mode (the usual case) or if solo mode and no other key pressed, then release voices on this key if needed                  // if no solo mode (the usual case) or if solo mode and no other key pressed, then release voices on this key if needed
1788                  if (bShouldRelease) {                  if (bShouldRelease) {
1789                      itNoteOffEventOnKeyList->Type = Event::type_release; // transform event type                      itNoteOffEventOnKeyList->Type = Event::type_release; // transform event type
   
1790                      // spawn release triggered voice(s) if needed                      // spawn release triggered voice(s) if needed
1791                      if (pKey->ReleaseTrigger && pChannel->pInstrument) {                      ProcessReleaseTrigger(pChannel, itNoteOffEventOnKeyList, pKey);
                         // assign a new note to this release event  
                         if (LaunchNewNote(pChannel, &*itNoteOffEventOnKeyList)) {  
                             // allocate and trigger new release voice(s)  
                             TriggerReleaseVoices(pChannel, itNoteOffEventOnKeyList);  
                         }  
                         pKey->ReleaseTrigger = false;  
                     }  
1792                  }                  }
1793    
1794                  // if neither a voice was spawned or postponed on this key then remove note off event from key again                  // if neither a voice was spawned or postponed on this key then remove note off event from key again
# Line 1807  namespace LinuxSampler { Line 1799  namespace LinuxSampler {
1799              }              }
1800    
1801              /**              /**
1802                 * Called on sustain pedal up events to check and if required,
1803                 * launch release trigger voices on the respective active key.
1804                 *
1805                 * @param pEngineChannel - engine channel on which this event occurred on
1806                 * @param itEvent - release trigger event (contains note number)
1807                 */
1808                virtual void ProcessReleaseTrigger(EngineChannel* pEngineChannel, RTList<Event>::Iterator& itEvent) OVERRIDE {
1809                    EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
1810    
1811                    const int iKey = itEvent->Param.Note.Key;
1812                    if (iKey < 0 || iKey > 127) return; // ignore event, key outside allowed key range
1813    
1814                    MidiKey* pKey = &pChannel->pMIDIKeyInfo[iKey];
1815    
1816                    ProcessReleaseTrigger(pChannel, itEvent, pKey);
1817                }
1818    
1819                /**
1820                 * Called on note-off and sustain pedal up events to check and if
1821                 * required, launch release trigger voices on the respective active
1822                 * key.
1823                 *
1824                 * @param pEngineChannel - engine channel on which this event occurred on
1825                 * @param itEvent - note off event / release trigger event
1826                 * @param pKey - key on which the release trigger voices shall be spawned
1827                 */
1828                inline void ProcessReleaseTrigger(EngineChannelBase<V, R, I>* pChannel, RTList<Event>::Iterator& itEvent, MidiKey* pKey) {
1829                    // spawn release triggered voice(s) if needed
1830                    if (pKey->ReleaseTrigger && pChannel->pInstrument) {
1831                        // assign a new note to this release event
1832                        if (LaunchNewNote(pChannel, &*itEvent)) {
1833                            // allocate and trigger new release voice(s)
1834                            TriggerReleaseVoices(pChannel, itEvent);
1835                        }
1836                        pKey->ReleaseTrigger = false;
1837                    }
1838                }
1839    
1840                /**
1841               *  Reset all voices and disk thread and clear input event queue and all               *  Reset all voices and disk thread and clear input event queue and all
1842               *  control and status variables. This method is protected by a mutex.               *  control and status variables. This method is protected by a mutex.
1843               */               */

Legend:
Removed from v.2884  
changed lines
  Added in v.2927

  ViewVC Help
Powered by ViewVC