CLAM-Development  1.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
CLAM::AudioCodecs::OggVorbisAudioStream Class Reference

#include <OggVorbisAudioStream.hxx>

List of all members.

Public Member Functions

 OggVorbisAudioStream (const AudioFile &file)
 ~OggVorbisAudioStream ()
void PrepareReading ()
 Open the stream in read mode.
void PrepareWriting ()
 Open the stream in write mode.
void Dispose ()
 Close the stream.
void SeekTo (unsigned long framePosition)
 Moves the current position to framePosition. If such functionality is not supported by the stream it will be ignored.
- Public Member Functions inherited from CLAM::AudioCodecs::Stream
 Stream ()
virtual ~Stream ()
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

void DiskToMemoryTransfer ()
 Move data from the file to mInterleavedData.
void MemoryToDiskTransfer ()
 Move data from mInterleavedData to the file.
- Protected Member Functions inherited from CLAM::AudioCodecs::Stream
void SetChannels (unsigned nChannels)

Protected Attributes

std::string mName
FILE * mFileHandle
OggVorbis_File mNativeFileParams
int mCurrentSection
bool mValidFileParams
vorbis_info mStreamInfo
vorbis_comment mFileComments
ogg_stream_state mOggStreamState
ogg_page mOggPage
ogg_packet mOggPacket
vorbis_dsp_state mDSPState
vorbis_block mVorbisBlock
int mEncodedSampleRate
bool mEncoding
std::vector< TInt16mBlockBuffer
std::vector< std::deque< TData > > mEncodeBuffer
std::deque< TInt16mDecodeBuffer
TSize mLastBytesRead
- Protected Attributes inherited from CLAM::AudioCodecs::Stream
unsigned mChannels
std::vector< TDatamInterleavedData
bool mEOFReached
unsigned mFramesLastRead
unsigned long mFramePosition

Static Protected Attributes

static const unsigned mMaxBlockSize = 4096 / sizeof(TInt16)
static const unsigned mAnalysisWindowSize = 1024

Detailed Description

Definition at line 42 of file OggVorbisAudioStream.hxx.


Constructor & Destructor Documentation

CLAM::AudioCodecs::OggVorbisAudioStream::OggVorbisAudioStream ( const AudioFile file)
CLAM::AudioCodecs::OggVorbisAudioStream::~OggVorbisAudioStream ( )

Definition at line 56 of file OggVorbisAudioStream.cxx.

References Dispose().


Member Function Documentation

void CLAM::AudioCodecs::OggVorbisAudioStream::DiskToMemoryTransfer ( )
protectedvirtual
void CLAM::AudioCodecs::OggVorbisAudioStream::Dispose ( )
virtual
void CLAM::AudioCodecs::OggVorbisAudioStream::MemoryToDiskTransfer ( )
protectedvirtual

Move data from mInterleavedData to the file.

Implements CLAM::AudioCodecs::Stream.

Definition at line 269 of file OggVorbisAudioStream.cxx.

References mAnalysisWindowSize, CLAM::AudioCodecs::Stream::mChannels, mEncodeBuffer, and CLAM::AudioCodecs::Stream::mInterleavedData.

void CLAM::AudioCodecs::OggVorbisAudioStream::PrepareReading ( )
virtual
void CLAM::AudioCodecs::OggVorbisAudioStream::PrepareWriting ( )
virtual

Open the stream in write mode.

Implements CLAM::AudioCodecs::Stream.

Definition at line 96 of file OggVorbisAudioStream.cxx.

References CLAM_ASSERT, mEncoding, mFileHandle, mName, and NULL.

void CLAM::AudioCodecs::OggVorbisAudioStream::SeekTo ( unsigned long  framePosition)
virtual

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

Reimplemented from CLAM::AudioCodecs::Stream.

Definition at line 348 of file OggVorbisAudioStream.cxx.

References CLAM::AudioCodecs::Stream::mFramePosition, and mNativeFileParams.


Member Data Documentation

const unsigned CLAM::AudioCodecs::OggVorbisAudioStream::mAnalysisWindowSize = 1024
staticprotected

Definition at line 87 of file OggVorbisAudioStream.hxx.

Referenced by MemoryToDiskTransfer().

std::vector<TInt16> CLAM::AudioCodecs::OggVorbisAudioStream::mBlockBuffer
protected

Definition at line 88 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer(), and OggVorbisAudioStream().

int CLAM::AudioCodecs::OggVorbisAudioStream::mCurrentSection
protected

Definition at line 70 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer(), and PrepareReading().

std::deque<TInt16> CLAM::AudioCodecs::OggVorbisAudioStream::mDecodeBuffer
protected

Definition at line 90 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer().

vorbis_dsp_state CLAM::AudioCodecs::OggVorbisAudioStream::mDSPState
protected

Definition at line 80 of file OggVorbisAudioStream.hxx.

Referenced by Dispose().

std::vector<std::deque<TData> > CLAM::AudioCodecs::OggVorbisAudioStream::mEncodeBuffer
protected

Definition at line 89 of file OggVorbisAudioStream.hxx.

Referenced by Dispose(), MemoryToDiskTransfer(), and OggVorbisAudioStream().

int CLAM::AudioCodecs::OggVorbisAudioStream::mEncodedSampleRate
protected

Definition at line 83 of file OggVorbisAudioStream.hxx.

Referenced by OggVorbisAudioStream().

bool CLAM::AudioCodecs::OggVorbisAudioStream::mEncoding
protected

Definition at line 84 of file OggVorbisAudioStream.hxx.

Referenced by Dispose(), and PrepareWriting().

vorbis_comment CLAM::AudioCodecs::OggVorbisAudioStream::mFileComments
protected

Definition at line 75 of file OggVorbisAudioStream.hxx.

Referenced by Dispose().

FILE* CLAM::AudioCodecs::OggVorbisAudioStream::mFileHandle
protected

Definition at line 68 of file OggVorbisAudioStream.hxx.

Referenced by Dispose(), PrepareReading(), and PrepareWriting().

TSize CLAM::AudioCodecs::OggVorbisAudioStream::mLastBytesRead
protected

Definition at line 92 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer().

const unsigned CLAM::AudioCodecs::OggVorbisAudioStream::mMaxBlockSize = 4096 / sizeof(TInt16)
staticprotected

Definition at line 86 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer(), and OggVorbisAudioStream().

std::string CLAM::AudioCodecs::OggVorbisAudioStream::mName
protected

Definition at line 67 of file OggVorbisAudioStream.hxx.

Referenced by OggVorbisAudioStream(), PrepareReading(), and PrepareWriting().

OggVorbis_File CLAM::AudioCodecs::OggVorbisAudioStream::mNativeFileParams
protected

Definition at line 69 of file OggVorbisAudioStream.hxx.

Referenced by DiskToMemoryTransfer(), Dispose(), PrepareReading(), and SeekTo().

ogg_packet CLAM::AudioCodecs::OggVorbisAudioStream::mOggPacket
protected

Definition at line 79 of file OggVorbisAudioStream.hxx.

ogg_page CLAM::AudioCodecs::OggVorbisAudioStream::mOggPage
protected

Definition at line 78 of file OggVorbisAudioStream.hxx.

ogg_stream_state CLAM::AudioCodecs::OggVorbisAudioStream::mOggStreamState
protected

Definition at line 77 of file OggVorbisAudioStream.hxx.

Referenced by Dispose().

vorbis_info CLAM::AudioCodecs::OggVorbisAudioStream::mStreamInfo
protected

Definition at line 74 of file OggVorbisAudioStream.hxx.

Referenced by Dispose().

bool CLAM::AudioCodecs::OggVorbisAudioStream::mValidFileParams
protected

Definition at line 71 of file OggVorbisAudioStream.hxx.

vorbis_block CLAM::AudioCodecs::OggVorbisAudioStream::mVorbisBlock
protected

Definition at line 81 of file OggVorbisAudioStream.hxx.

Referenced by Dispose().


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