39 |
} |
} |
40 |
|
|
41 |
long Stream::Read(uint8_t* pBuf, long SamplesToRead) { |
long Stream::Read(uint8_t* pBuf, long SamplesToRead) { |
42 |
Sample* pSample = pRegion->pSample; |
::sfz::Sample* pSample = pRegion->pSample; |
43 |
long total_readsamples = 0, readsamples = 0; |
long total_readsamples = 0, readsamples = 0; |
44 |
bool endofsamplereached; |
bool endofsamplereached; |
45 |
|
|
46 |
// refill the disk stream buffer |
// refill the disk stream buffer |
47 |
if (this->DoLoop) { // honor looping |
if (this->DoLoop) { // honor looping |
48 |
total_readsamples = pSample->ReadAndLoop(pBuf, SamplesToRead, &PlaybackState); |
total_readsamples = pSample->ReadAndLoop(pBuf, SamplesToRead, &PlaybackState, pRegion); |
49 |
endofsamplereached = (this->PlaybackState.position >= pSample->GetTotalFrameCount()); |
endofsamplereached = (this->PlaybackState.position >= pSample->GetTotalFrameCount()); |
50 |
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)); |
51 |
} |
} |