--- linuxsampler/trunk/src/engines/gig/Stream.cpp 2005/01/01 08:18:07 333 +++ linuxsampler/trunk/src/engines/gig/Stream.cpp 2005/02/17 02:53:45 385 @@ -3,6 +3,7 @@ * LinuxSampler - modular, streaming capable sampler * * * * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * + * Copyright (C) 2005 Christian Schoenebeck * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,7 +42,7 @@ // refill the disk stream buffer if (this->DoLoop) { // honor looping - total_readsamples = pSample->ReadAndLoop(pBuf, samplestoread, &this->PlaybackState); + total_readsamples = pSample->ReadAndLoop(pBuf, samplestoread, &this->PlaybackState, pDecompressionBuffer); endofsamplereached = (this->PlaybackState.position >= pSample->SamplesTotal); dmsg(5,("Refilled stream %d with %d (SamplePos: %d)", this->hThis, total_readsamples, this->PlaybackState.position)); } @@ -50,7 +51,7 @@ pSample->SetPos(this->SampleOffset); // recover old position do { - readsamples = pSample->Read(&pBuf[total_readsamples * pSample->Channels], samplestoread); + readsamples = pSample->Read(&pBuf[total_readsamples * pSample->Channels], samplestoread, pDecompressionBuffer); samplestoread -= readsamples; total_readsamples += readsamples; } while (samplestoread && readsamples > 0); @@ -78,15 +79,16 @@ pRingBuffer->increment_write_ptr_with_wrap(SilenceSampleWords); } - Stream::Stream(uint BufferSize, uint BufferWrapElements) { - this->pExportReference = NULL; - this->State = state_unused; - this->hThis = 0; - this->pSample = NULL; - this->SampleOffset = 0; - this->PlaybackState.position = 0; - this->PlaybackState.reverse = false; - this->pRingBuffer = new RingBuffer(BufferSize, BufferWrapElements); + Stream::Stream( ::gig::buffer_t* pDecompressionBuffer, uint BufferSize, uint BufferWrapElements) { + this->pExportReference = NULL; + this->State = state_unused; + this->hThis = 0; + this->pSample = NULL; + this->SampleOffset = 0; + this->PlaybackState.position = 0; + this->PlaybackState.reverse = false; + this->pRingBuffer = new RingBuffer(BufferSize, BufferWrapElements); + this->pDecompressionBuffer = pDecompressionBuffer; UnusedStreams++; TotalStreams++; }