2 |
* * |
* * |
3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003 by Benno Senoner * |
* 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 * |
53 |
}; |
}; |
54 |
|
|
55 |
// Methods |
// Methods |
56 |
Stream(uint BufferSize, uint BufferWrapElements); |
Stream( ::gig::buffer_t* pDecompressionBuffer, uint BufferSize, uint BufferWrapElements); |
57 |
~Stream(); |
~Stream(); |
58 |
int ReadAhead(unsigned long SampleCount); |
int ReadAhead(unsigned long SampleCount); |
59 |
void WriteSilence(unsigned long SilenceSampleWords); |
void WriteSilence(unsigned long SilenceSampleWords); |
60 |
|
|
61 |
inline int GetReadSpace() { |
inline int GetReadSpace() { |
62 |
return (pRingBuffer && State == state_active) ? pRingBuffer->read_space() : 0; |
return (pRingBuffer && State != state_unused) ? pRingBuffer->read_space() : 0; |
63 |
} |
} |
64 |
|
|
65 |
inline int GetWriteSpace() { |
inline int GetWriteSpace() { |
113 |
::gig::playback_state_t PlaybackState; |
::gig::playback_state_t PlaybackState; |
114 |
RingBuffer<sample_t>* pRingBuffer; |
RingBuffer<sample_t>* pRingBuffer; |
115 |
bool DoLoop; |
bool DoLoop; |
116 |
|
::gig::buffer_t* pDecompressionBuffer; |
117 |
|
|
118 |
// Static Attributes |
// Static Attributes |
119 |
static uint UnusedStreams; //< Reflects how many stream objects of all stream instances are currently not in use. |
static uint UnusedStreams; //< Reflects how many stream objects of all stream instances are currently not in use. |
120 |
|
static uint TotalStreams; //< Reflects how many stream objects currently exist. |
121 |
|
|
122 |
// Methods |
// Methods |
123 |
inline void Reset() { |
inline void Reset() { |