/[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 2962 by schoenebeck, Sun Jul 17 17:54:04 2016 UTC revision 3221 by schoenebeck, Fri May 26 18:30:42 2017 UTC
# Line 5  Line 5 
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-2008 Christian Schoenebeck                         *   *   Copyright (C) 2005-2008 Christian Schoenebeck                         *
7   *   Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev        *   *   Copyright (C) 2009-2012 Christian Schoenebeck and Grigor Iliev        *
8   *   Copyright (C) 2012-2016 Christian Schoenebeck and Andreas Persson     *   *   Copyright (C) 2012-2017 Christian Schoenebeck and Andreas Persson     *
9   *                                                                         *   *                                                                         *
10   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
11   *   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 58  namespace LinuxSampler { Line 58  namespace LinuxSampler {
58              typedef typename RTList<RR*>::Iterator RootRegionIterator;              typedef typename RTList<RR*>::Iterator RootRegionIterator;
59              typedef typename MidiKeyboardManager<V>::MidiKey MidiKey;              typedef typename MidiKeyboardManager<V>::MidiKey MidiKey;
60                            
61              EngineBase() : SuspendedRegions(128), noteIDPool(GLOBAL_MAX_NOTES) {              EngineBase() : noteIDPool(GLOBAL_MAX_NOTES), SuspendedRegions(128) {
62                  pDiskThread          = NULL;                  pDiskThread          = NULL;
63                  pNotePool            = new Pool< Note<V> >(GLOBAL_MAX_NOTES);                  pNotePool            = new Pool< Note<V> >(GLOBAL_MAX_NOTES);
64                  pNotePool->setPoolElementIDsReservedBits(INSTR_SCRIPT_EVENT_ID_RESERVED_BITS);                  pNotePool->setPoolElementIDsReservedBits(INSTR_SCRIPT_EVENT_ID_RESERVED_BITS);
# Line 163  namespace LinuxSampler { Line 163  namespace LinuxSampler {
163                                  dmsg(5,("Engine: Sysex received\n"));                                  dmsg(5,("Engine: Sysex received\n"));
164                                  ProcessSysex(itEvent);                                  ProcessSysex(itEvent);
165                                  break;                                  break;
166                                default: ; // noop
167                          }                          }
168                      }                      }
169                  }                  }
# Line 596  namespace LinuxSampler { Line 597  namespace LinuxSampler {
597              }              }
598    
599              // implementation of abstract method derived from class 'LinuxSampler::RegionPools'              // implementation of abstract method derived from class 'LinuxSampler::RegionPools'
600              virtual Pool<R*>* GetRegionPool(int index) {              virtual Pool<R*>* GetRegionPool(int index) OVERRIDE {
601                  if (index < 0 || index > 1) throw Exception("Index out of bounds");                  if (index < 0 || index > 1) throw Exception("Index out of bounds");
602                  return pRegionPool[index];                  return pRegionPool[index];
603              }              }
# Line 604  namespace LinuxSampler { Line 605  namespace LinuxSampler {
605              // implementation of abstract methods derived from class 'LinuxSampler::NotePool'              // implementation of abstract methods derived from class 'LinuxSampler::NotePool'
606              virtual Pool<V>* GetVoicePool() OVERRIDE { return pVoicePool; }              virtual Pool<V>* GetVoicePool() OVERRIDE { return pVoicePool; }
607              virtual Pool< Note<V> >* GetNotePool() OVERRIDE { return pNotePool; }              virtual Pool< Note<V> >* GetNotePool() OVERRIDE { return pNotePool; }
608              virtual Pool<note_id_t>* GetNodeIDPool() OVERRIDE { return &noteIDPool; }              virtual Pool<note_id_t>* GetNoteIDPool() OVERRIDE { return &noteIDPool; }
609    
610              D* GetDiskThread() { return pDiskThread; }              D* GetDiskThread() { return pDiskThread; }
611    
# Line 675  namespace LinuxSampler { Line 676  namespace LinuxSampler {
676               * @param pNoteOnEvent - event which caused this               * @param pNoteOnEvent - event which caused this
677               * @returns new note's unique ID (or zero on error)               * @returns new note's unique ID (or zero on error)
678               */               */
679              note_id_t LaunchNewNote(LinuxSampler::EngineChannel* pEngineChannel, Event* pNoteOnEvent) OVERRIDE {              note_id_t LaunchNewNote(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) OVERRIDE {
680                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
681                  Pool< Note<V> >* pNotePool = GetNotePool();                  Pool< Note<V> >* pNotePool = GetNotePool();
682    
# Line 690  namespace LinuxSampler { Line 691  namespace LinuxSampler {
691                  const note_id_t newNoteID = pNotePool->getID(itNewNote);                  const note_id_t newNoteID = pNotePool->getID(itNewNote);
692    
693                  // remember the engine's time when this note was triggered exactly                  // remember the engine's time when this note was triggered exactly
694                  itNewNote->triggerSchedTime = pNoteOnEvent->SchedTime();                  itNewNote->triggerSchedTime = itNoteOnEvent->SchedTime();
695    
696                  // usually the new note (and its subsequent voices) will be                  // usually the new note (and its subsequent voices) will be
697                  // allocated on the key provided by the event's note number,                  // allocated on the key provided by the event's note number,
# Line 698  namespace LinuxSampler { Line 699  namespace LinuxSampler {
699                  // note, but rather a child note, then this new note will be                  // note, but rather a child note, then this new note will be
700                  // allocated on the parent note's key instead in order to                  // allocated on the parent note's key instead in order to
701                  // release the child note simultaniously with its parent note                  // release the child note simultaniously with its parent note
702                  itNewNote->hostKey = pNoteOnEvent->Param.Note.Key;                  itNewNote->hostKey = itNoteOnEvent->Param.Note.Key;
703    
704                  // in case this new note was requested to be a child note,                  // in case this new note was requested to be a child note,
705                  // then retrieve its parent note and link them with each other                  // then retrieve its parent note and link them with each other
706                  const note_id_t parentNoteID = pNoteOnEvent->Param.Note.ParentNoteID;                  const note_id_t parentNoteID = itNoteOnEvent->Param.Note.ParentNoteID;
707                  if (parentNoteID) {                  if (parentNoteID) {
708                      NoteIterator itParentNote = pNotePool->fromID(parentNoteID);                                              NoteIterator itParentNote = pNotePool->fromID(parentNoteID);                        
709                      if (itParentNote) {                      if (itParentNote) {
# Line 730  namespace LinuxSampler { Line 731  namespace LinuxSampler {
731                  dmsg(2,("Launched new note on host key %d\n", itNewNote->hostKey));                  dmsg(2,("Launched new note on host key %d\n", itNewNote->hostKey));
732    
733                  // copy event which caused this note                  // copy event which caused this note
734                  itNewNote->cause = *pNoteOnEvent;                  itNewNote->cause = *itNoteOnEvent;
735                  itNewNote->eventID = pEventPool->getID(pNoteOnEvent);                  itNewNote->eventID = pEventPool->getID(itNoteOnEvent);
736                    if (!itNewNote->eventID) {
737                        dmsg(0,("Engine: No valid event ID resolved for note. This is a bug!!!\n"));
738                    }
739    
740                  // move new note to its host key                  // move new note to its host key
741                  MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNewNote->hostKey];                  MidiKey* pKey = &pChannel->pMIDIKeyInfo[itNewNote->hostKey];
742                  itNewNote.moveToEndOf(pKey->pActiveNotes);                  itNewNote.moveToEndOf(pKey->pActiveNotes);
743    
744                  // assign unique note ID of this new note to the original note on event                  // assign unique note ID of this new note to the original note on event
745                  pNoteOnEvent->Param.Note.ID = newNoteID;                  itNoteOnEvent->Param.Note.ID = newNoteID;
746    
747                  return newNoteID; // success                  return newNoteID; // success
748              }              }
# Line 798  namespace LinuxSampler { Line 802  namespace LinuxSampler {
802                              case Event::type_note_pressure:                              case Event::type_note_pressure:
803                                  //TODO: ...                                  //TODO: ...
804                                  break;                                  break;
805    
806                                case Event::type_sysex:
807                                    //TODO: ...
808                                    break;
809    
810                                case Event::type_cancel_release_key:
811                                case Event::type_release_key:
812                                case Event::type_release_note:
813                                case Event::type_play_note:
814                                case Event::type_stop_note:
815                                case Event::type_kill_note:
816                                case Event::type_note_synth_param:
817                                    break; // noop
818                          }                          }
819    
820                          // see HACK comment above                          // see HACK comment above
# Line 868  namespace LinuxSampler { Line 885  namespace LinuxSampler {
885                                  dmsg(5,("Engine: Stop Note received\n"));                                  dmsg(5,("Engine: Stop Note received\n"));
886                                  ProcessNoteOff((EngineChannel*)itEvent->pEngineChannel, itEvent);                                  ProcessNoteOff((EngineChannel*)itEvent->pEngineChannel, itEvent);
887                                  break;                                  break;
888                                case Event::type_kill_note:
889                                    dmsg(5,("Engine: Kill Note received\n"));
890                                    ProcessKillNote((EngineChannel*)itEvent->pEngineChannel, itEvent);
891                                    break;
892                              case Event::type_control_change:                              case Event::type_control_change:
893                                  dmsg(5,("Engine: MIDI CC received\n"));                                  dmsg(5,("Engine: MIDI CC received\n"));
894                                  ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent);                                  ProcessControlChange((EngineChannel*)itEvent->pEngineChannel, itEvent);
# Line 888  namespace LinuxSampler { Line 909  namespace LinuxSampler {
909                                  dmsg(5,("Engine: Note Synth Param received\n"));                                  dmsg(5,("Engine: Note Synth Param received\n"));
910                                  ProcessNoteSynthParam(itEvent->pEngineChannel, itEvent);                                  ProcessNoteSynthParam(itEvent->pEngineChannel, itEvent);
911                                  break;                                  break;
912                                case Event::type_sysex:
913                                    break; // TODO ...
914    
915                                case Event::type_cancel_release_key:
916                                case Event::type_release_key:
917                                case Event::type_release_note:
918                                    break; // noop
919                          }                          }
920                      }                      }
921                  }                  }
# Line 956  namespace LinuxSampler { Line 984  namespace LinuxSampler {
984                      // script event object                      // script event object
985                      RTList<ScriptEvent>::Iterator itScriptEvent =                      RTList<ScriptEvent>::Iterator itScriptEvent =
986                          pChannel->pScript->pEvents->allocAppend();                          pChannel->pScript->pEvents->allocAppend();
987                        // if event handler uses polyphonic variables, reset them
988                        // to zero values before starting to execute the handler
989                        if (pEventHandler->isPolyphonic())
990                            itScriptEvent->execCtx->resetPolyphonicData();
991                      ProcessScriptEvent(                      ProcessScriptEvent(
992                          pChannel, itEvent, pEventHandler, itScriptEvent                          pChannel, itEvent, pEventHandler, itScriptEvent
993                      );                      );
# Line 988  namespace LinuxSampler { Line 1020  namespace LinuxSampler {
1020    
1021                  // initialize/reset other members                  // initialize/reset other members
1022                  itScriptEvent->cause = *itEvent;                  itScriptEvent->cause = *itEvent;
1023                    itScriptEvent->scheduleTime = itEvent->SchedTime();
1024                  itScriptEvent->currentHandler = 0;                  itScriptEvent->currentHandler = 0;
1025                  itScriptEvent->executionSlices = 0;                  itScriptEvent->executionSlices = 0;
1026                  itScriptEvent->ignoreAllWaitCalls = false;                  itScriptEvent->ignoreAllWaitCalls = false;
# Line 1259  namespace LinuxSampler { Line 1292  namespace LinuxSampler {
1292                          // the script's "init" event handler is only executed                          // the script's "init" event handler is only executed
1293                          // once (when the script is loaded or reloaded)                          // once (when the script is loaded or reloaded)
1294                          if (pEngineChannel->pScript && pEngineChannel->pScript->handlerInit) {                          if (pEngineChannel->pScript && pEngineChannel->pScript->handlerInit) {
1295                                dmsg(5,("Engine: exec handlerInit %p\n", pEngineChannel->pScript->handlerInit));
1296                              RTList<ScriptEvent>::Iterator itScriptEvent =                              RTList<ScriptEvent>::Iterator itScriptEvent =
1297                                  pEngineChannel->pScript->pEvents->allocAppend();                                  pEngineChannel->pScript->pEvents->allocAppend();
1298    
1299                              itScriptEvent->cause.pEngineChannel = pEngineChannel;                              itScriptEvent->cause.pEngineChannel = pEngineChannel;
1300                              itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit;                              itScriptEvent->handlers[0] = pEngineChannel->pScript->handlerInit;
1301                              itScriptEvent->handlers[1] = NULL;                              itScriptEvent->handlers[1] = NULL;
1302                                itScriptEvent->currentHandler = 0;
1303                              VMExecStatus_t res = pScriptVM->exec(                              itScriptEvent->executionSlices = 0;
1304                                  pEngineChannel->pScript->parserContext, &*itScriptEvent                              itScriptEvent->ignoreAllWaitCalls = false;
1305                              );                              itScriptEvent->handlerType = VM_EVENT_HANDLER_INIT;
1306    
1307                                VMExecStatus_t res;
1308                                size_t instructionsCount = 0;
1309                                const size_t maxInstructions = 200000; // aiming approx. 1 second max. (based on very roughly 5us / instruction)
1310                                bool bWarningShown = false;
1311                                do {
1312                                    res = pScriptVM->exec(
1313                                        pEngineChannel->pScript->parserContext, &*itScriptEvent
1314                                    );
1315                                    instructionsCount += itScriptEvent->execCtx->instructionsPerformed();
1316                                    if (instructionsCount > maxInstructions && !bWarningShown) {
1317                                        bWarningShown = true;
1318                                        dmsg(0,("[ScriptVM] WARNING: \"init\" event handler of instrument script executing for long time!\n"));
1319                                    }
1320                                } while (res & VM_EXEC_SUSPENDED && !(res & VM_EXEC_ERROR));
1321    
1322                              pEngineChannel->pScript->pEvents->free(itScriptEvent);                              pEngineChannel->pScript->pEvents->free(itScriptEvent);
1323                          }                          }
# Line 1329  namespace LinuxSampler { Line 1378  namespace LinuxSampler {
1378                          // usually there should already be a new Note object                          // usually there should already be a new Note object
1379                          NoteIterator itNote = GetNotePool()->fromID(itVoiceStealEvent->Param.Note.ID);                          NoteIterator itNote = GetNotePool()->fromID(itVoiceStealEvent->Param.Note.ID);
1380                          if (!itNote) { // should not happen, but just to be sure ...                          if (!itNote) { // should not happen, but just to be sure ...
1381                              const note_id_t noteID = LaunchNewNote(pEngineChannel, &*itVoiceStealEvent);                              const note_id_t noteID = LaunchNewNote(pEngineChannel, itVoiceStealEvent);
1382                              if (!noteID) {                              if (!noteID) {
1383                                  dmsg(1,("Engine: Voice stealing failed; No Note object and Note pool empty!\n"));                                  dmsg(1,("Engine: Voice stealing failed; No Note object and Note pool empty!\n"));
1384                                  continue;                                  continue;
# Line 1606  namespace LinuxSampler { Line 1655  namespace LinuxSampler {
1655               *  @param pEngineChannel - engine channel on which this event occurred on               *  @param pEngineChannel - engine channel on which this event occurred on
1656               *  @param itNoteOnEvent - key, velocity and time stamp of the event               *  @param itNoteOnEvent - key, velocity and time stamp of the event
1657               */               */
1658              virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) {              virtual void ProcessNoteOn(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOnEvent) OVERRIDE {
1659                  EngineChannelBase<V, R, I>* pChannel =                  EngineChannelBase<V, R, I>* pChannel =
1660                          static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);                          static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
1661    
# Line 1737  namespace LinuxSampler { Line 1786  namespace LinuxSampler {
1786               *  @param pEngineChannel - engine channel on which this event occurred on               *  @param pEngineChannel - engine channel on which this event occurred on
1787               *  @param itNoteOffEvent - key, velocity and time stamp of the event               *  @param itNoteOffEvent - key, velocity and time stamp of the event
1788               */               */
1789              virtual void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) {              virtual void ProcessNoteOff(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNoteOffEvent) OVERRIDE {
1790                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
1791    
1792                  const int iKey = itNoteOffEvent->Param.Note.Key;                  const int iKey = itNoteOffEvent->Param.Note.Key;
# Line 1806  namespace LinuxSampler { Line 1855  namespace LinuxSampler {
1855                                          itPseudoNoteOnEvent->Param.Note.Key      = i;                                          itPseudoNoteOnEvent->Param.Note.Key      = i;
1856                                          itPseudoNoteOnEvent->Param.Note.Velocity = pOtherKey->Velocity;                                          itPseudoNoteOnEvent->Param.Note.Velocity = pOtherKey->Velocity;
1857                                          // assign a new note to this note-on event                                          // assign a new note to this note-on event
1858                                          if (LaunchNewNote(pChannel, &*itPseudoNoteOnEvent)) {                                          if (LaunchNewNote(pChannel, itPseudoNoteOnEvent)) {
1859                                              // allocate and trigger new voice(s) for the other key                                              // allocate and trigger new voice(s) for the other key
1860                                              TriggerNewVoices(pChannel, itPseudoNoteOnEvent, false);                                              TriggerNewVoices(pChannel, itPseudoNoteOnEvent, false);
1861                                          }                                          }
# Line 1893  namespace LinuxSampler { Line 1942  namespace LinuxSampler {
1942                  // spawn release triggered voice(s) if needed                  // spawn release triggered voice(s) if needed
1943                  if (pKey->ReleaseTrigger && pChannel->pInstrument) {                  if (pKey->ReleaseTrigger && pChannel->pInstrument) {
1944                      // assign a new note to this release event                      // assign a new note to this release event
1945                      if (LaunchNewNote(pChannel, &*itEvent)) {                      if (LaunchNewNote(pChannel, itEvent)) {
1946                          // allocate and trigger new release voice(s)                          // allocate and trigger new release voice(s)
1947                          TriggerReleaseVoices(pChannel, itEvent);                          TriggerReleaseVoices(pChannel, itEvent);
1948                      }                      }
# Line 1902  namespace LinuxSampler { Line 1951  namespace LinuxSampler {
1951              }              }
1952    
1953              /**              /**
1954                 * Called on "kill note" events, which currently only happens on
1955                 * built-in real-time instrument script function fade_out(). This
1956                 * method only fulfills one task: moving the even to the Note's own
1957                 * event list so that its voices can process the kill event sample
1958                 * accurately.
1959                 */
1960                void ProcessKillNote(EngineChannel* pEngineChannel, RTList<Event>::Iterator& itEvent) {
1961                    EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
1962    
1963                    NoteBase* pNote = pChannel->pEngine->NoteByID( itEvent->Param.Note.ID );
1964                    if (!pNote || pNote->hostKey < 0 || pNote->hostKey >= 128) return;
1965    
1966                    // move note kill event to its MIDI key
1967                    MidiKey* pKey = &pChannel->pMIDIKeyInfo[pNote->hostKey];
1968                    itEvent.moveToEndOf(pKey->pEvents);
1969                }
1970    
1971                /**
1972               * Called on note synthesis parameter change events. These are               * Called on note synthesis parameter change events. These are
1973               * internal events caused by calling built-in real-time instrument               * internal events caused by calling built-in real-time instrument
1974               * script functions like change_vol(), change_pitch(), etc.               * script functions like change_vol(), change_tune(), etc.
1975               *               *
1976               * This method performs two tasks:               * This method performs two tasks:
1977               *               *
# Line 1935  namespace LinuxSampler { Line 2002  namespace LinuxSampler {
2002                              pNote->Override.Volume = itEvent->Param.NoteSynthParam.Delta;                              pNote->Override.Volume = itEvent->Param.NoteSynthParam.Delta;
2003                          itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Volume;                          itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Volume;
2004                          break;                          break;
2005                        case Event::synth_param_volume_time:
2006                            pNote->Override.VolumeTime = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2007                            break;
2008                      case Event::synth_param_pitch:                      case Event::synth_param_pitch:
2009                          if (relative)                          if (relative)
2010                              pNote->Override.Pitch *= itEvent->Param.NoteSynthParam.Delta;                              pNote->Override.Pitch *= itEvent->Param.NoteSynthParam.Delta;
# Line 1942  namespace LinuxSampler { Line 2012  namespace LinuxSampler {
2012                              pNote->Override.Pitch = itEvent->Param.NoteSynthParam.Delta;                              pNote->Override.Pitch = itEvent->Param.NoteSynthParam.Delta;
2013                          itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Pitch;                          itEvent->Param.NoteSynthParam.AbsValue = pNote->Override.Pitch;
2014                          break;                          break;
2015                        case Event::synth_param_pitch_time:
2016                            pNote->Override.PitchTime = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2017                            break;
2018                      case Event::synth_param_pan:                      case Event::synth_param_pan:
2019                          if (relative) {                          if (relative) {
2020                              pNote->Override.Pan = RTMath::RelativeSummedAvg(pNote->Override.Pan, itEvent->Param.NoteSynthParam.Delta, ++pNote->Override.PanSources);                              pNote->Override.Pan = RTMath::RelativeSummedAvg(pNote->Override.Pan, itEvent->Param.NoteSynthParam.Delta, ++pNote->Override.PanSources);
# Line 1966  namespace LinuxSampler { Line 2039  namespace LinuxSampler {
2039                      case Event::synth_param_release:                      case Event::synth_param_release:
2040                          pNote->Override.Release = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;                          pNote->Override.Release = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2041                          break;                          break;
2042                        case Event::synth_param_amp_lfo_depth:
2043                            pNote->Override.AmpLFODepth = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2044                            break;
2045                        case Event::synth_param_amp_lfo_freq:
2046                            pNote->Override.AmpLFOFreq = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2047                            break;
2048                        case Event::synth_param_pitch_lfo_depth:
2049                            pNote->Override.PitchLFODepth = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2050                            break;
2051                        case Event::synth_param_pitch_lfo_freq:
2052                            pNote->Override.PitchLFOFreq = itEvent->Param.NoteSynthParam.AbsValue = itEvent->Param.NoteSynthParam.Delta;
2053                            break;
2054                  }                  }
2055    
2056                  // move note parameter event to its MIDI key                  // move note parameter event to its MIDI key
# Line 1977  namespace LinuxSampler { Line 2062  namespace LinuxSampler {
2062               *  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
2063               *  control and status variables. This method is protected by a mutex.               *  control and status variables. This method is protected by a mutex.
2064               */               */
2065              virtual void ResetInternal() {              virtual void ResetInternal() OVERRIDE {
2066                  LockGuard lock(ResetInternalMutex);                  LockGuard lock(ResetInternalMutex);
2067    
2068                  // make sure that the engine does not get any sysex messages                  // make sure that the engine does not get any sysex messages
# Line 2036  namespace LinuxSampler { Line 2121  namespace LinuxSampler {
2121               * @param pEngineChannel - engine channel on which all voices should be killed               * @param pEngineChannel - engine channel on which all voices should be killed
2122               * @param itKillEvent    - event which caused this killing of all voices               * @param itKillEvent    - event which caused this killing of all voices
2123               */               */
2124              virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) {              virtual void KillAllVoices(EngineChannel* pEngineChannel, Pool<Event>::Iterator& itKillEvent) OVERRIDE {
2125                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);                  EngineChannelBase<V, R, I>* pChannel = static_cast<EngineChannelBase<V, R, I>*>(pEngineChannel);
2126                  int count = pChannel->KillAllVoices(itKillEvent);                  int count = pChannel->KillAllVoices(itKillEvent);
2127                  VoiceSpawnsLeft -= count; //FIXME: just a temporary workaround, we should check the cause in StealVoice() instead                  VoiceSpawnsLeft -= count; //FIXME: just a temporary workaround, we should check the cause in StealVoice() instead
# Line 2071  namespace LinuxSampler { Line 2156  namespace LinuxSampler {
2156                  bool                    HandleKeyGroupConflicts                  bool                    HandleKeyGroupConflicts
2157              ) = 0;              ) = 0;
2158    
2159              virtual int GetMinFadeOutSamples() { return MinFadeOutSamples; }              virtual int GetMinFadeOutSamples() OVERRIDE { return MinFadeOutSamples; }
2160    
2161              int InitNewVoice (              int InitNewVoice (
2162                  EngineChannelBase<V, R, I>*  pChannel,                  EngineChannelBase<V, R, I>*  pChannel,

Legend:
Removed from v.2962  
changed lines
  Added in v.3221

  ViewVC Help
Powered by ViewVC