#include <OggVorbisAudioStream.hxx>
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. | |
Protected Member Functions | |
void | DiskToMemoryTransfer () |
Move data from the file to mInterleavedData. | |
void | MemoryToDiskTransfer () |
Move data from mInterleavedData to the file. | |
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< TInt16 > | mBlockBuffer |
std::vector< std::deque< TData > > | mEncodeBuffer |
std::deque< TInt16 > | mDecodeBuffer |
TSize | mLastBytesRead |
Static Protected Attributes | |
static const unsigned | mMaxBlockSize = 4096 / sizeof(TInt16) |
static const unsigned | mAnalysisWindowSize = 1024 |
Definition at line 42 of file OggVorbisAudioStream.hxx.
CLAM::AudioCodecs::OggVorbisAudioStream::OggVorbisAudioStream | ( | const AudioFile & | file | ) |
Definition at line 45 of file OggVorbisAudioStream.cxx.
References CLAM::AudioFile::GetHeader(), CLAM::AudioFile::GetLocation(), mBlockBuffer, CLAM::AudioCodecs::Stream::mChannels, mEncodeBuffer, mEncodedSampleRate, mMaxBlockSize, and mName.
CLAM::AudioCodecs::OggVorbisAudioStream::~OggVorbisAudioStream | ( | ) |
Definition at line 56 of file OggVorbisAudioStream.cxx.
References Dispose().
void CLAM::AudioCodecs::OggVorbisAudioStream::DiskToMemoryTransfer | ( | ) | [protected, virtual] |
Move data from the file to mInterleavedData.
Implements CLAM::AudioCodecs::Stream.
Definition at line 227 of file OggVorbisAudioStream.cxx.
References CLAM_ASSERT, HOST_ENDIANESS, mBlockBuffer, CLAM::AudioCodecs::Stream::mChannels, mCurrentSection, mDecodeBuffer, CLAM::AudioCodecs::Stream::mEOFReached, CLAM::AudioCodecs::Stream::mFramesLastRead, CLAM::AudioCodecs::Stream::mInterleavedData, mLastBytesRead, mMaxBlockSize, and mNativeFileParams.
void CLAM::AudioCodecs::OggVorbisAudioStream::Dispose | ( | ) | [virtual] |
Close the stream.
Implements CLAM::AudioCodecs::Stream.
Definition at line 169 of file OggVorbisAudioStream.cxx.
References mDSPState, mEncodeBuffer, mEncoding, mFileComments, mFileHandle, mNativeFileParams, mOggStreamState, mStreamInfo, mVorbisBlock, and NULL.
Referenced by ~OggVorbisAudioStream().
void CLAM::AudioCodecs::OggVorbisAudioStream::MemoryToDiskTransfer | ( | ) | [protected, virtual] |
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] |
Open the stream in read mode.
Implements CLAM::AudioCodecs::Stream.
Definition at line 61 of file OggVorbisAudioStream.cxx.
References CLAM_ASSERT, CLAM::AudioCodecs::Stream::mChannels, mCurrentSection, mFileHandle, CLAM::AudioCodecs::Stream::mFramePosition, mName, mNativeFileParams, and NULL.
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.
const unsigned CLAM::AudioCodecs::OggVorbisAudioStream::mAnalysisWindowSize = 1024 [static, protected] |
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().
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().
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().
Definition at line 92 of file OggVorbisAudioStream.hxx.
Referenced by DiskToMemoryTransfer().
const unsigned CLAM::AudioCodecs::OggVorbisAudioStream::mMaxBlockSize = 4096 / sizeof(TInt16) [static, protected] |
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().