43 #ifndef _audiorawdecoder_cpp
44 #define _audiorawdecoder_cpp
46 #ifdef ENABLE_RAW_ENCODE
48 #include "Audio/rawdecoder.h"
57 BitConfiguration(Config)
61 RawDecoder::~RawDecoder()
68 bool RawDecoder::IsValid()
78 bool RawDecoder::IsSeekingSupported()
85 return this->BitConfiguration;
88 UInt32 RawDecoder::GetFrequency()
const
90 return this->Frequency;
95 return this->RawStream;
98 bool RawDecoder::SetPosition(
Int32 Position,
bool Relative)
104 bool RawDecoder::Seek(
const Real Seconds,
bool Relative)
106 Int32 Pos =
static_cast<Int32>( Seconds *
static_cast<Real>(this->Frequency) * static_cast<Real>( this->GetSampleSize() ) );
107 return this->SetPosition(Pos,Relative);
110 UInt32 RawDecoder::ReadAudioData(
void* Output,
UInt32 Amount)
112 return this->RawStream->Read(Output,Amount);
118 Real RawDecoder::GetTotalTime()
const
120 return static_cast<Real>( this->RawStream->GetSize() ) / ( static_cast<Real>(this->Frequency) *
static_cast<Real>( this->GetSampleSize() ) );
123 Real RawDecoder::GetCurrentTime()
const
125 return static_cast<Real>( this->RawStream->GetStreamPosition() ) / ( static_cast<Real>(this->Frequency) *
static_cast<Real>( this->GetSampleSize() ) );
128 UInt32 RawDecoder::GetTotalSize()
const
130 return this->RawStream->GetSize();
133 UInt32 RawDecoder::GetCompressedSize()
const
135 return this->RawStream->GetSize();
138 UInt32 RawDecoder::GetCurrentPosition()
const
140 return this->RawStream->GetStreamPosition();
143 UInt32 RawDecoder::GetCurrentCompressedPosition()
const
145 return this->RawStream->GetStreamPosition();
150 #endif //ENABLE_RAW_ENCODE