2009-06-21 05:24:30 +02:00
|
|
|
#ifndef IDATASOURCE_H
|
|
|
|
#define IDATASOURCE_H
|
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
#include "IRefCounted.h"
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
namespace cAudio
|
2009-06-21 05:24:30 +02:00
|
|
|
{
|
2009-12-07 23:25:08 +01:00
|
|
|
class IDataSource : public IRefCounted
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
IDataSource() { }
|
|
|
|
virtual ~IDataSource() { }
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
//!Returns whether the source is valid (in case of an error, like the file couldn't be found)
|
|
|
|
virtual bool isValid() = 0;
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
//!Get the current location in the data stream
|
|
|
|
virtual int getCurrentPos() = 0;
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
//!Get the total size of the data stream
|
|
|
|
virtual int getSize() = 0;
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
//!Read out a section of the data stream
|
|
|
|
virtual int read(void* output, int size) = 0;
|
2009-06-21 05:24:30 +02:00
|
|
|
|
2009-12-07 23:25:08 +01:00
|
|
|
//!Seek to a position in the data stream
|
|
|
|
virtual bool seek(int amount, bool relative) = 0;
|
|
|
|
};
|
2009-06-21 05:24:30 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //! IDATASOURCE_H
|