Public Member Functions |
| Player (Player< T > &src, double rate=1) |
| Player (Array< T > &src, double smpRate, double rate=1) |
template<class Char > |
| Player (const Char *pathToSoundFile, double rate=1) |
template<class Char > |
bool | load (const Char *pathToSoundFile) |
| Load a sound file into internal buffer.
|
void | advance () |
| Increment read tap.
|
T | operator() (int channel=0) |
| Returns sample at current position on specified channel and increments phase.
|
T | read (int channel) const |
| Returns sample at current position on specified channel (without incrementing phase)
|
void | buffer (Array< T > &src, double smpRate, int channels) |
| Set sample buffer.
|
void | free () |
| Free sample buffer (if owner)
|
void | max (double v) |
| Set interval max, in frames.
|
void | min (double v) |
| Set interval min, in frames.
|
void | pos (double v) |
| Set current read position, in frames.
|
void | phase (double v) |
| Set current read position [0, 1)
|
void | rate (double v) |
| Set playback rate scalar.
|
void | range (double phs, double period) |
| Set interval start phase and period.
|
void | reset () |
| Reset playback head.
|
double | max () const |
| Get interval max.
|
double | min () const |
| Get interval min.
|
double | period () const |
| Get total period of sample data.
|
double | pos () const |
| Get current read position, in frames.
|
double | posInInterval (double frac) const |
| Get position from fraction within interval.
|
double | rate () const |
| Get playback rate.
|
double | sampleRate () const |
| Get sample rate of sample buffer.
|
int | channels () const |
| Get number of channels.
|
virtual void | onResync (double r) |
| Called by my Sync reference after it changes its value.
|
double | scaleSPU () const |
| Returns ratio of my SPU to my Sync's SPU.
|
void | scaleSPU (double v) |
| Scales samples/unit by factor.
|
double | spu () const |
| Returns local samples/unit.
|
void | spu (double v) |
| Set local samples/unit.
|
double | ups () const |
| Returns local units/sample.
|
void | ups (double v) |
| Set local units/sample.
|
const Sync * | sync () const |
| Returns reference to my Sync.
|
void | sync (Sync &src) |
| Set absolute Sync source.
|
void | scaleUPS (double v) |
| Scales units/sample by factor.
|
void | nodeInsertL (Synced &node) |
| Insert myself to left of node.
|
void | nodeInsertR (Synced &node) |
| Insert myself to right of node.
|
void | nodeRemove () |
| Remove myself from linked list.
|
T & | operator[] (uint32_t i) |
| Get write reference to element.
|
const T & | operator[] (uint32_t i) const |
| Get read-only reference to element.
|
ArrayBase & | assign (const T &v) |
| Sets all elements to value.
|
ArrayBase & | assign (const T &v, uint32_t end, uint32_t stride=1, uint32_t start=0) |
| Sets linear slice of elements to value.
|
T * | elems () |
| Get writable pointer to elements.
|
const T * | elems () const |
| Get read-only pointer to elements.
|
uint32_t | size () const |
| Returns number of elements in array.
|
void | clear () |
| Destroys all elements and frees memory.
|
void | own () |
| Ensures ownership of elements.
|
bool | isSoleOwner () const |
| Returns true if we are the sole owner of data internally allocated.
|
void | resize (uint32_t newSize, const T &c=T()) |
| Resizes number of elements in array.
|
void | source (ArrayBase< T, SizeArray, gam::Allocator< T > > &src) |
| Sets source of array elements to another array.
|
void | source (T *src, uint32_t size) |
| Sets source of array elements to another array.
|
Static Public Member Functions |
static int | references (T *m) |
| Returns number of pointers to memory address being managed.
|
Public Attributes |
Synced * | nodeL |
| Pointer to left node.
|
Synced * | nodeR |
| Pointer to right node.
|
Protected Member Functions |
void | initSynced () |
| To be called from the constructor(s) of derived classes.
|
template<class T = real, template< class > class Si = ipl::Trunc, class St = tap::Clip>
class gam::Player< T, Si, St >
Sample buffer player.
The number of frames in the sample should not exceed 2^32. This equates to 27 hours at 44.1 kHz.
- Template Parameters:
-
T | value (sample) type |
Si | interpolation strategy |
St | read tap strategy |