/[svn]/linuxsampler/trunk/src/engines/gig/EGADSR.cpp
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/gig/EGADSR.cpp

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

revision 285 by schoenebeck, Thu Oct 14 21:31:26 2004 UTC revision 396 by persson, Sun Feb 20 20:32:24 2005 UTC
# Line 61  namespace LinuxSampler { namespace gig { Line 61  namespace LinuxSampler { namespace gig {
61          int Samples = (itKillEvent) ? RTMath::Min(itKillEvent->FragmentPos(), pEngine->MaxFadeOutPos) : (int) TotalSamples;          int Samples = (itKillEvent) ? RTMath::Min(itKillEvent->FragmentPos(), pEngine->MaxFadeOutPos) : (int) TotalSamples;
62    
63          int iSample = TriggerDelay;          int iSample = TriggerDelay;
64    
65            #if DEVMODE
66            if (TriggerDelay > TotalSamples) { // FIXME: should be removed before the final release (purpose: just a sanity check for debugging)
67                dmsg(1,("EGADSR: ERROR, TriggerDelay > Totalsamples\n"));
68                int* i = NULL;
69                (*i)++; // force a segfault
70            }
71            #endif // DEVMODE
72    
73          while (iSample < TotalSamples) {          while (iSample < TotalSamples) {
74    
75              // if the voice was killed in this fragment and we already processed the time before this kill event              // if the voice was killed in this fragment and we already processed the time before this kill event
# Line 76  namespace LinuxSampler { namespace gig { Line 85  namespace LinuxSampler { namespace gig {
85                          Level += AttackCoeff;                          Level += AttackCoeff;
86                          pEngine->pSynthesisParameters[ModulationDestination][iSample++] *= Level;                          pEngine->pSynthesisParameters[ModulationDestination][iSample++] *= Level;
87                      }                      }
88                      if (iSample == TotalSamples) { // postpone last transition event for the next audio fragment                      if (iSample == TotalSamples && itTransitionEvent) { // postpone last transition event for the next audio fragment
89                          RTList<Event>::Iterator itLastEvent = pEvents->last();                          RTList<Event>::Iterator itLastEvent = pEvents->last();
90                          if (itLastEvent) ReleasePostponed = (itLastEvent->Type == Event::type_release);                          if (itLastEvent) ReleasePostponed = (itLastEvent->Type == Event::type_release);
91                      }                      }
# Line 182  namespace LinuxSampler { namespace gig { Line 191  namespace LinuxSampler { namespace gig {
191              }              }
192          }          }
193    
194          if (itKillEvent && Stage != stage_end) {          #if DEVMODE
195              dmsg(1,("EGADSR: VOICE KILLING NOT COMPLETED !!!\n"));          if (itKillEvent && Stage != stage_end) { // FIXME: should be removed before the final release (purpose: just a sanity check for debugging)
196                dmsg(1,("EGADSR: ERROR, voice killing not completed !!!\n"));
197              dmsg(1,("EGADSR: Stage=%d,iSample=%d,Samples=%d, TotalSamples=%d, MaxFadoutPos=%d\n",Stage,iSample,Samples,TotalSamples,pEngine->MaxFadeOutPos));              dmsg(1,("EGADSR: Stage=%d,iSample=%d,Samples=%d, TotalSamples=%d, MaxFadoutPos=%d\n",Stage,iSample,Samples,TotalSamples,pEngine->MaxFadeOutPos));
198          }          }
199            #endif // DEVMODE
200      }      }
201    
202      /**      /**

Legend:
Removed from v.285  
changed lines
  Added in v.396

  ViewVC Help
Powered by ViewVC