![Joshua Jones](/assets/img/avatar_default.png)
Changed the 3d tutorial to use the move convenience function in order to have proper doppler effects. Added relative seek ability to cAudio source. Updated decoders to have a flag if the data they are working with is valid for their decoder (isValid). Added reference counting to IAudio, IAudioDecoder, and IDataSource Added better error checking in cAudio sources and they will do a better job of detecting if they are invalid. Fixed the spelling on cWavAudioDecoderFactory.h Ogg decoder support for the isValid check. Time seek ability added to cRawDecoder Rewrote cWavDecoder. It will now read slightly malformed wav files (and conforms to the wav spec), no longer has a bug where 8 bit mono audio samples will play twice as fast as 16 bit mono samples, proper bounds checking to make sure only the audio data is sent to the audio source, and time seeking abilities. The decoder does not support channels over 2, compressed wavs, wavs with more than 1 data or fmt block, or any other blocks that may be present in a wav file. All unsupported blocks will be ignored.
32 lines
743 B
C++
32 lines
743 B
C++
#ifndef IDATASOURCE_H
|
|
#define IDATASOURCE_H
|
|
|
|
#include "IRefCounted.h"
|
|
|
|
namespace cAudio
|
|
{
|
|
class IDataSource : public IRefCounted
|
|
{
|
|
public:
|
|
IDataSource() { }
|
|
virtual ~IDataSource() { }
|
|
|
|
//!Returns whether the source is valid (in case of an error, like the file couldn't be found)
|
|
virtual bool isValid() = 0;
|
|
|
|
//!Get the current location in the data stream
|
|
virtual int getCurrentPos() = 0;
|
|
|
|
//!Get the total size of the data stream
|
|
virtual int getSize() = 0;
|
|
|
|
//!Read out a section of the data stream
|
|
virtual int read(void* output, int size) = 0;
|
|
|
|
//!Seek to a position in the data stream
|
|
virtual bool seek(int amount, bool relative) = 0;
|
|
};
|
|
};
|
|
|
|
#endif //! IDATASOURCE_H
|