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

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

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

revision 384 by senkov, Sat Jan 1 08:18:07 2005 UTC revision 385 by schoenebeck, Thu Feb 17 02:53:45 2005 UTC
# Line 3  Line 3 
3   *   LinuxSampler - modular, streaming capable sampler                     *   *   LinuxSampler - modular, streaming capable sampler                     *
4   *                                                                         *   *                                                                         *
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 Christian Schoenebeck                              *
7   *                                                                         *   *                                                                         *
8   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
9   *   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 41  namespace LinuxSampler { namespace gig { Line 42  namespace LinuxSampler { namespace gig {
42    
43          // refill the disk stream buffer          // refill the disk stream buffer
44          if (this->DoLoop) { // honor looping          if (this->DoLoop) { // honor looping
45              total_readsamples  = pSample->ReadAndLoop(pBuf, samplestoread, &this->PlaybackState);              total_readsamples  = pSample->ReadAndLoop(pBuf, samplestoread, &this->PlaybackState, pDecompressionBuffer);
46              endofsamplereached = (this->PlaybackState.position >= pSample->SamplesTotal);              endofsamplereached = (this->PlaybackState.position >= pSample->SamplesTotal);
47              dmsg(5,("Refilled stream %d with %d (SamplePos: %d)", this->hThis, total_readsamples, this->PlaybackState.position));              dmsg(5,("Refilled stream %d with %d (SamplePos: %d)", this->hThis, total_readsamples, this->PlaybackState.position));
48          }          }
# Line 50  namespace LinuxSampler { namespace gig { Line 51  namespace LinuxSampler { namespace gig {
51              pSample->SetPos(this->SampleOffset); // recover old position              pSample->SetPos(this->SampleOffset); // recover old position
52    
53              do {              do {
54                  readsamples        = pSample->Read(&pBuf[total_readsamples * pSample->Channels], samplestoread);                  readsamples        = pSample->Read(&pBuf[total_readsamples * pSample->Channels], samplestoread, pDecompressionBuffer);
55                  samplestoread     -= readsamples;                  samplestoread     -= readsamples;
56                  total_readsamples += readsamples;                  total_readsamples += readsamples;
57              } while (samplestoread && readsamples > 0);              } while (samplestoread && readsamples > 0);
# Line 78  namespace LinuxSampler { namespace gig { Line 79  namespace LinuxSampler { namespace gig {
79          pRingBuffer->increment_write_ptr_with_wrap(SilenceSampleWords);          pRingBuffer->increment_write_ptr_with_wrap(SilenceSampleWords);
80      }      }
81    
82      Stream::Stream(uint BufferSize, uint BufferWrapElements) {      Stream::Stream( ::gig::buffer_t* pDecompressionBuffer, uint BufferSize, uint BufferWrapElements) {
83          this->pExportReference               = NULL;          this->pExportReference       = NULL;
84          this->State                          = state_unused;          this->State                  = state_unused;
85          this->hThis                          = 0;          this->hThis                  = 0;
86          this->pSample                        = NULL;          this->pSample                = NULL;
87          this->SampleOffset                   = 0;          this->SampleOffset           = 0;
88          this->PlaybackState.position         = 0;          this->PlaybackState.position = 0;
89          this->PlaybackState.reverse          = false;          this->PlaybackState.reverse  = false;
90          this->pRingBuffer                    = new RingBuffer<sample_t>(BufferSize, BufferWrapElements);          this->pRingBuffer            = new RingBuffer<sample_t>(BufferSize, BufferWrapElements);
91            this->pDecompressionBuffer   = pDecompressionBuffer;
92          UnusedStreams++;          UnusedStreams++;
93          TotalStreams++;          TotalStreams++;
94      }      }

Legend:
Removed from v.384  
changed lines
  Added in v.385

  ViewVC Help
Powered by ViewVC