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 PrepareReading ()=0
 Open the stream in read mode.
virtual void PrepareWriting ()=0
 Open the stream in write mode.
virtual void Dispose ()=0
 Close the stream.
virtual void SeekTo (unsigned long framePosition)
 Moves the current position to framePosition. If such functionality is not supported by the stream it will be ignored.
virtual unsigned long GetFramePosition () const
 Returns the current frame position.
bool ReadData (int channel, TData *buffer, unsigned nFrames)
 Read a picked channel.
bool ReadData (TData **buffers, unsigned nFrames)
 Read all the channels.
bool ReadData (int *channels, int nchannels, TData **buffers, unsigned nFrames)
 Read many picked channels.
void WriteData (int channel, const TData *buffer, unsigned nFrames)
 Read a picked channel (Do it has sense?).
void WriteData (TData **const buffers, unsigned nFrames)
 Read all the channels.
void WriteData (int *channels, int nchannels, TData **const buffers, unsigned nFrames)
 Read many picked channels (Do it has sense?).

Protected Member Functions

virtual void DiskToMemoryTransfer ()=0
 Move data from the file to mInterleavedData.
virtual void MemoryToDiskTransfer ()=0
 Move data from mInterleavedData to the file.
void SetChannels (unsigned nChannels)

Protected Attributes

unsigned mChannels
std::vector< TDatamInterleavedData
bool mEOFReached
unsigned mFramesLastRead
unsigned long mFramePosition

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 43 of file AudioCodecs_Stream.hxx.


Constructor & Destructor Documentation

CLAM::AudioCodecs::Stream::Stream (  ) 

Definition at line 24 of file AudioCodecs_Stream.cxx.

CLAM::AudioCodecs::Stream::~Stream (  )  [virtual]

Definition at line 30 of file AudioCodecs_Stream.cxx.


Member Function Documentation

virtual void CLAM::AudioCodecs::Stream::DiskToMemoryTransfer (  )  [protected, pure virtual]

Move data from the file to mInterleavedData.

Implemented in CLAM::AudioCodecs::MpegAudioStream, CLAM::AudioCodecs::OggVorbisAudioStream, and CLAM::AudioCodecs::PCMAudioStream.

virtual void CLAM::AudioCodecs::Stream::Dispose (  )  [pure virtual]
virtual unsigned long CLAM::AudioCodecs::Stream::GetFramePosition (  )  const [inline, virtual]

Returns the current frame position.

Definition at line 58 of file AudioCodecs_Stream.hxx.

References mFramePosition.

virtual void CLAM::AudioCodecs::Stream::MemoryToDiskTransfer (  )  [protected, pure virtual]

Move data from mInterleavedData to the file.

Implemented in CLAM::AudioCodecs::MpegAudioStream, CLAM::AudioCodecs::OggVorbisAudioStream, and CLAM::AudioCodecs::PCMAudioStream.

virtual void CLAM::AudioCodecs::Stream::PrepareReading (  )  [pure virtual]
virtual void CLAM::AudioCodecs::Stream::PrepareWriting (  )  [pure virtual]
bool CLAM::AudioCodecs::Stream::ReadData ( int channels,
int  nchannels,
TData **  buffers,
unsigned  nFrames 
)

Read many picked channels.

Definition at line 63 of file AudioCodecs_Stream.cxx.

bool CLAM::AudioCodecs::Stream::ReadData ( TData **  buffers,
unsigned  nFrames 
)

Read all the channels.

Definition at line 49 of file AudioCodecs_Stream.cxx.

bool CLAM::AudioCodecs::Stream::ReadData ( int  channel,
TData buffer,
unsigned  nFrames 
)

Read a picked channel.

Definition at line 34 of file AudioCodecs_Stream.cxx.

virtual void CLAM::AudioCodecs::Stream::SeekTo ( unsigned long  framePosition  )  [inline, virtual]

Moves the current position to framePosition. If such functionality is not supported by the stream it will be ignored.

Reimplemented in CLAM::AudioCodecs::MpegAudioStream, and CLAM::AudioCodecs::OggVorbisAudioStream.

Definition at line 56 of file AudioCodecs_Stream.hxx.

void CLAM::AudioCodecs::Stream::SetChannels ( unsigned  nChannels  )  [protected]
void CLAM::AudioCodecs::Stream::WriteData ( int channels,
int  nchannels,
TData **const   buffers,
unsigned  nFrames 
)

Read many picked channels (Do it has sense?).

Definition at line 118 of file AudioCodecs_Stream.cxx.

void CLAM::AudioCodecs::Stream::WriteData ( TData **const   buffers,
unsigned  nFrames 
)

Read all the channels.

Definition at line 106 of file AudioCodecs_Stream.cxx.

void CLAM::AudioCodecs::Stream::WriteData ( int  channel,
const TData buffer,
unsigned  nFrames 
)

Read a picked channel (Do it has sense?).

Definition at line 95 of file AudioCodecs_Stream.cxx.

Referenced by CLAM::MonoAudioFileWriter::ConcreteConfigure().


Member Data Documentation


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.3