Home Information Classes Download Usage Mail List Requirements Links FAQ Tutorial
#include <Stk.h>
This class can hold single- or multi-channel audio data in either interleaved or non-interleaved formats. The data type is always StkFloat. In an effort to maintain efficiency, no out-of-bounds checks are performed in this class.
Possible future improvements in this class could include functions to inter- or de-interleave the data and to convert to and return other data types.
by Perry R. Cook and Gary P. Scavone, 1995 - 2007.
Public Member Functions | |
StkFrames (unsigned int nFrames=0, unsigned int nChannels=0, bool interleaved=true) | |
The default constructor initializes the frame data structure to size zero. | |
StkFrames (const StkFloat &value, unsigned int nFrames, unsigned int nChannels, bool interleaved=true) | |
Overloaded constructor that initializes the frame data to the specified size with value . | |
~StkFrames () | |
The destructor. | |
StkFloat & | operator[] (size_t n) |
Subscript operator which returns a reference to element n of self. | |
StkFloat | operator[] (size_t n) const |
Subscript operator that returns the value at element n of self. | |
StkFloat & | operator() (size_t frame, unsigned int channel) |
Channel / frame subscript operator that returns a reference. | |
StkFloat | operator() (size_t frame, unsigned int channel) const |
Channel / frame subscript operator that returns a value. | |
StkFloat | interpolate (StkFloat frame, unsigned int channel=0) const |
Return an interpolated value at the fractional frame index and channel. | |
size_t | size () const |
Returns the total number of audio samples represented by the object. | |
bool | empty () const |
Returns true if the object size is zero and false otherwise. | |
void | resize (size_t nFrames, unsigned int nChannels=1) |
Resize self to represent the specified number of channels and frames. | |
void | resize (size_t nFrames, unsigned int nChannels, StkFloat value) |
Resize self to represent the specified number of channels and frames and perform element initialization. | |
unsigned int | channels (void) const |
Return the number of channels represented by the data. | |
unsigned int | frames (void) const |
Return the number of sample frames represented by the data. | |
void | setDataRate (StkFloat rate) |
Set the sample rate associated with the StkFrames data. | |
StkFloat | dataRate (void) const |
Return the sample rate associated with the StkFrames data. | |
bool | interleaved (void) const |
Returns true if the data is in interleaved format, false if the data is non-interleaved. | |
void | setInterleaved (bool isInterleaved) |
Set the flag to indicate whether the internal data is in interleaved (true ) or non-interleaved (false ) format. |
|
Subscript operator which returns a reference to element
The result can be used as an lvalue . This reference is valid until the resize function is called or the array is destroyed. The index |
|
Subscript operator that returns the value at element
The index |
|
Channel / frame subscript operator that returns a reference.
The result can be used as an lvalue. This reference is valid until the resize function is called or the array is destroyed. The |
|
Channel / frame subscript operator that returns a value.
The |
|
Return an interpolated value at the fractional frame index and channel.
This function performs linear interpolation. The |
|
Resize self to represent the specified number of channels and frames. Changes the size of self based on the number of frames and channels. No element assignment is performed. No memory deallocation occurs if the new size is smaller than the previous size. Further, no new memory is allocated when the new size is smaller or equal to a previously allocated size. |
|
Resize self to represent the specified number of channels and frames and perform element initialization.
Changes the size of self based on the number of frames and channels, and assigns |
|
Set the sample rate associated with the StkFrames data. By default, this value is set equal to the current STK sample rate at the time of instantiation. |
|
Return the sample rate associated with the StkFrames data. By default, this value is set equal to the current STK sample rate at the time of instantiation. |
|
Set the flag to indicate whether the internal data is in interleaved ( Note that this function does not modify the internal data order with respect to the argument value. It simply changes the indicator flag value. |
The Synthesis ToolKit in C++ (STK) |
©1995-2007 Perry R. Cook and Gary P. Scavone. All Rights Reserved. |