63 |
if (endofsamplereached) SetState(state_end); |
if (endofsamplereached) SetState(state_end); |
64 |
else SetState(state_active); |
else SetState(state_active); |
65 |
|
|
66 |
dmsg(5,("Refilled stream with %d (SamplePos: %d)", SampleCount - samplestoread, this->SampleOffset)); |
dmsg(5,("Refilled stream %d with %d (SamplePos: %d)", this->hThis, SampleCount - samplestoread, this->SampleOffset)); |
67 |
return (SampleCount - samplestoread); |
return (SampleCount - samplestoread); |
68 |
} |
} |
69 |
|
|
75 |
Stream::Stream(uint BufferSize, uint BufferWrapElements) { |
Stream::Stream(uint BufferSize, uint BufferWrapElements) { |
76 |
this->pExportReference = NULL; |
this->pExportReference = NULL; |
77 |
this->State = state_unused; |
this->State = state_unused; |
78 |
|
this->hThis = 0; |
79 |
this->pSample = NULL; |
this->pSample = NULL; |
80 |
this->SampleOffset = 0; |
this->SampleOffset = 0; |
81 |
this->pRingBuffer = new RingBuffer<sample_t>(BufferSize, BufferWrapElements); |
this->pRingBuffer = new RingBuffer<sample_t>(BufferSize, BufferWrapElements); |
88 |
} |
} |
89 |
|
|
90 |
/// Called by disk thread to activate the disk stream. |
/// Called by disk thread to activate the disk stream. |
91 |
void Stream::Launch(reference_t* pExportReference, gig::Sample* pSample, unsigned long SampleOffset) { |
void Stream::Launch(Stream::Handle hStream, reference_t* pExportReference, gig::Sample* pSample, unsigned long SampleOffset) { |
92 |
UnusedStreams--; |
UnusedStreams--; |
93 |
this->pExportReference = pExportReference; |
this->pExportReference = pExportReference; |
94 |
|
this->hThis = hStream; |
95 |
this->pSample = pSample; |
this->pSample = pSample; |
96 |
this->SampleOffset = SampleOffset; |
this->SampleOffset = SampleOffset; |
97 |
SetState(state_active); |
SetState(state_active); |