Home   Information   Classes   Download   Usage   Mail List   Requirements   Links   Tutorial


StkFrames Class Reference

#include <Stk.h>

List of all members.


Detailed Description

An STK class to handle vectorized audio data.

This class can hold single- or multi-channel audio data in either interleaved or non-interleaved formats. The data type is always StkFloat.

Possible future improvements in this class could include static 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 - 2004.

Definition at line 177 of file Stk.h.

Public Member Functions

 StkFrames (unsigned int nFrames=0, unsigned int nChannels=1, 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 which initializes the frame data to the specified size with value.

StkFloat & operator[] (size_t n)
 Subscript operator which returns a reference to element n of self.

StkFloat operator[] (size_t n) const
 Subscript operator which returns the value at element n of self.

size_t size () const
 Returns the total number of audio samples represented by the object.

void resize (unsigned int nFrames, unsigned int nChannels=1, StkFloat value=0.0)
 Resize self to represent the specified number of channels and frames.

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.

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.


Member Function Documentation

StkFloat& StkFrames::operator[] size_t  n  )  [inline]
 

Subscript operator which returns a reference to element n of self.

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 n must be between 0 and size less one. No range checking is performed.

Definition at line 194 of file Stk.h.

00194 { return data_[n]; };

StkFloat StkFrames::operator[] size_t  n  )  const [inline]
 

Subscript operator which returns the value at element n of self.

The index n must be between 0 and size less one. No range checking is performed.

Definition at line 201 of file Stk.h.

00201 { return data_[n]; };

void StkFrames::resize unsigned int  nFrames,
unsigned int  nChannels = 1,
StkFloat  value = 0.0
 

Resize self to represent the specified number of channels and frames.

Changes the size of self based on the number of frames and channels, and assigns value to every element.


The documentation for this class was generated from the following file:
The Synthesis ToolKit in C++ (STK)
©1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.