2009-06-21 05:24:30 +02:00
|
|
|
#ifndef IAUDIODECODER_H
|
|
|
|
#define IAUDIODECODER_H
|
|
|
|
|
|
|
|
#include "IDataSource.h"
|
2009-08-11 19:57:20 +02:00
|
|
|
#include "eAudioFormats.h"
|
2009-06-21 05:24:30 +02:00
|
|
|
|
|
|
|
namespace cAudio
|
|
|
|
{
|
|
|
|
|
|
|
|
class IAudioDecoder
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IAudioDecoder(IDataSource* stream) : Stream(stream) {}
|
|
|
|
virtual ~IAudioDecoder() { delete Stream; }
|
|
|
|
|
|
|
|
//!Returns the format of the audio data
|
|
|
|
virtual AudioFormats getFormat() = 0;
|
|
|
|
|
|
|
|
//!Returns the frequency of the audio data
|
|
|
|
virtual int getFrequency() = 0;
|
|
|
|
|
|
|
|
//!Returns whether seeking is supported
|
|
|
|
virtual bool isSeekingSupported() = 0;
|
|
|
|
|
|
|
|
//!Reads a section of data out of the audio stream
|
|
|
|
virtual int readAudioData(void* output, int amount) = 0;
|
|
|
|
|
|
|
|
//!Sets the position to read data out of
|
|
|
|
virtual bool setPosition(int position, bool relative) = 0;
|
|
|
|
|
|
|
|
//!If seeking is supported, will seek the stream to seconds
|
2009-08-08 07:51:32 +02:00
|
|
|
virtual bool seek(float seconds, bool relative) = 0;
|
2009-06-21 05:24:30 +02:00
|
|
|
protected:
|
|
|
|
IDataSource* Stream;
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //! IAUDIODECODER_H
|