CLAM-Development  1.1
Public Member Functions | Protected Member Functions | Protected Attributes
CLAM::AudioCodecs::Stream Class Reference

Streams provide I/O to and from an audio file of a given format. More...

#include <AudioCodecs_Stream.hxx>

List of all members.

Public Member Functions

 Stream ()
virtual ~Stream ()
virtual void SetFOI (const AudioFile &)=0
virtual void PrepareReading ()=0
virtual void PrepareWriting ()=0
virtual void PrepareReadWrite ()=0
virtual void Dispose ()=0
void DeactivateStrictStreaming ()
void ActivateStrictStreaming ()
bool StrictStreaming () const
bool ReadData (int channel, TData *ptr, TSize howmany)
bool ReadData (int *channels, int nchannels, TData **samples, TSize howmany)
void WriteData (int channel, const TData *ptr, TSize howmany)
void WriteData (int *channels, int nchannels, TData **const samples, TSize howmany)
bool WasSomethingRead () const

Protected Member Functions

virtual void DiskToMemoryTransfer ()=0
virtual void MemoryToDiskTransfer ()=0
bool AllChannelsConsumed ()
void ResetConsumedChannels ()
void MarkAllChannelsAsConsumed ()
bool AllChannelsProduced ()
void ResetProducedChannels ()
void MarkAllChannelsAsProduced ()
void SetChannels (TSize nChannels)

Protected Attributes

TSize mChannels
std::vector< bool > mChannelsConsumed
std::vector< bool > mChannelsProduced
bool mStrictStreaming
DataArray mInterleavedData
DataArray mInterleavedDataOut
bool mEOFReached
TSize mFramesToRead
TSize mFramesToWrite
TSize mFramesLastRead

Detailed Description

Streams provide I/O to and from an audio file of a given format.

You can get a stream by using a Codec. To add support for a different format you must subclass both the Codec and the Stream.

Todo:
Document Stream methods

Definition at line 44 of file AudioCodecs_Stream.hxx.


Constructor & Destructor Documentation

Definition at line 29 of file AudioCodecs_Stream.cxx.

Definition at line 34 of file AudioCodecs_Stream.cxx.


Member Function Documentation

Definition at line 113 of file AudioCodecs_Stream.hxx.

References mStrictStreaming.

Definition at line 67 of file AudioCodecs_Stream.cxx.

References mChannelsConsumed.

Definition at line 38 of file AudioCodecs_Stream.cxx.

References mChannelsProduced.

Referenced by WriteData().

virtual void CLAM::AudioCodecs::Stream::DiskToMemoryTransfer ( ) [protected, pure virtual]
virtual void CLAM::AudioCodecs::Stream::Dispose ( ) [pure virtual]
virtual void CLAM::AudioCodecs::Stream::MemoryToDiskTransfer ( ) [protected, pure virtual]
virtual void CLAM::AudioCodecs::Stream::PrepareReading ( ) [pure virtual]
virtual void CLAM::AudioCodecs::Stream::PrepareReadWrite ( ) [pure virtual]
virtual void CLAM::AudioCodecs::Stream::PrepareWriting ( ) [pure virtual]
bool CLAM::AudioCodecs::Stream::ReadData ( int  channel,
TData ptr,
TSize  howmany 
)
bool CLAM::AudioCodecs::Stream::ReadData ( int channels,
int  nchannels,
TData **  samples,
TSize  howmany 
)

Definition at line 86 of file AudioCodecs_Stream.cxx.

References mChannelsConsumed.

Definition at line 59 of file AudioCodecs_Stream.cxx.

References mChannelsProduced.

void CLAM::AudioCodecs::Stream::SetChannels ( TSize  nChannels) [protected]
virtual void CLAM::AudioCodecs::Stream::SetFOI ( const AudioFile ) [pure virtual]

Definition at line 123 of file AudioCodecs_Stream.hxx.

References mStrictStreaming.

Definition at line 107 of file AudioCodecs_Stream.hxx.

References mFramesLastRead.

void CLAM::AudioCodecs::Stream::WriteData ( int  channel,
const TData ptr,
TSize  howmany 
)
void CLAM::AudioCodecs::Stream::WriteData ( int channels,
int  nchannels,
TData **const  samples,
TSize  howmany 
)

Member Data Documentation

Definition at line 87 of file AudioCodecs_Stream.hxx.

Referenced by ReadData(), SetChannels(), and WriteData().

std::vector<bool> CLAM::AudioCodecs::Stream::mChannelsConsumed [protected]
std::vector<bool> CLAM::AudioCodecs::Stream::mChannelsProduced [protected]

The documentation for this class was generated from the following files: