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

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

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

revision 325 by senkov, Tue Dec 21 04:54:37 2004 UTC revision 332 by senkov, Sat Jan 1 03:06:06 2005 UTC
# Line 58  namespace LinuxSampler { namespace gig { Line 58  namespace LinuxSampler { namespace gig {
58          pLFO2  = NULL;          pLFO2  = NULL;
59          pLFO3  = NULL;          pLFO3  = NULL;
60          KeyGroup = 0;          KeyGroup = 0;
61            SynthesisMode = 0; //Set all mode bits to 0 first
62    
63          // select synthesis implementation (currently either pure C++ or MMX+SSE(1))          // select synthesis implementation (currently either pure C++ or MMX+SSE(1))
64          SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE());          SYNTHESIS_MODE_SET_IMPLEMENTATION(SynthesisMode, Features::supportsMMX() && Features::supportsSSE());
# Line 694  namespace LinuxSampler { namespace gig { Line 695  namespace LinuxSampler { namespace gig {
695                          }                          }
696                          DiskStreamRef.pStream->IncrementReadPos(pSample->Channels * (int(Pos) - MaxRAMPos));                          DiskStreamRef.pStream->IncrementReadPos(pSample->Channels * (int(Pos) - MaxRAMPos));
697                          Pos -= int(Pos);                          Pos -= int(Pos);
698                            RealSampleWordsLeftToRead = -1; // -1 means no silence has been added yet
699                      }                      }
700    
701                      const int sampleWordsLeftToRead = DiskStreamRef.pStream->GetReadSpace();                      const int sampleWordsLeftToRead = DiskStreamRef.pStream->GetReadSpace();
# Line 702  namespace LinuxSampler { namespace gig { Line 704  namespace LinuxSampler { namespace gig {
704                      if (DiskStreamRef.State == Stream::state_end) {                      if (DiskStreamRef.State == Stream::state_end) {
705                          const int maxSampleWordsPerCycle = (pEngine->MaxSamplesPerCycle << MAX_PITCH) * pSample->Channels + 6; // +6 for the interpolator algorithm                          const int maxSampleWordsPerCycle = (pEngine->MaxSamplesPerCycle << MAX_PITCH) * pSample->Channels + 6; // +6 for the interpolator algorithm
706                          if (sampleWordsLeftToRead <= maxSampleWordsPerCycle) {                          if (sampleWordsLeftToRead <= maxSampleWordsPerCycle) {
707                                // remember how many sample words there are before any silence has been added
708                                if (RealSampleWordsLeftToRead < 0) RealSampleWordsLeftToRead = sampleWordsLeftToRead;
709                              DiskStreamRef.pStream->WriteSilence(maxSampleWordsPerCycle - sampleWordsLeftToRead);                              DiskStreamRef.pStream->WriteSilence(maxSampleWordsPerCycle - sampleWordsLeftToRead);
710                          }                          }
711                      }                      }
# Line 717  namespace LinuxSampler { namespace gig { Line 721  namespace LinuxSampler { namespace gig {
721                      Pos -= iPos; // just keep fractional part of Pos                      Pos -= iPos; // just keep fractional part of Pos
722    
723                      // change state of voice to 'end' if we really reached the end of the sample data                      // change state of voice to 'end' if we really reached the end of the sample data
724                      if (DiskStreamRef.State == Stream::state_end && readSampleWords >= sampleWordsLeftToRead) this->PlaybackState = playback_state_end;                      if (RealSampleWordsLeftToRead >= 0) {
725                            RealSampleWordsLeftToRead -= readSampleWords;
726                            if (RealSampleWordsLeftToRead <= 0) this->PlaybackState = playback_state_end;
727                        }
728                  }                  }
729                  break;                  break;
730    

Legend:
Removed from v.325  
changed lines
  Added in v.332

  ViewVC Help
Powered by ViewVC