Interface for data providers in cAudio.
More...
#include <IDataSource.h>
|
| virtual bool | isValid ()=0 |
| | Returns whether the source is valid.
|
| |
| virtual int | getCurrentPos ()=0 |
| | Returns the current location in the data stream.
|
| |
| virtual int | getSize ()=0 |
| | Returns the total size of the data stream.
|
| |
| virtual int | read (void *output, int size)=0 |
| | Reads out a section of the data stream.
|
| |
| virtual bool | seek (int amount, bool relative)=0 |
| | Seek to a position in the data stream.
|
| |
| virtual void | grab () |
| | Increments the reference count by one.
|
| |
| virtual bool | drop () |
| | Decrements the reference count by one. If it hits zero, this object is deleted.
|
| |
| int | getReferenceCount () const |
| | Returns the current reference count of this object.
|
| |
Interface for data providers in cAudio.
Definition at line 12 of file IDataSource.h.
◆ IDataSource()
| cAudio::IDataSource::IDataSource |
( |
| ) |
|
|
inline |
◆ ~IDataSource()
| virtual cAudio::IDataSource::~IDataSource |
( |
| ) |
|
|
inlinevirtual |
◆ getCurrentPos()
| virtual int cAudio::IDataSource::getCurrentPos |
( |
| ) |
|
|
pure virtual |
◆ getSize()
| virtual int cAudio::IDataSource::getSize |
( |
| ) |
|
|
pure virtual |
◆ isValid()
| virtual bool cAudio::IDataSource::isValid |
( |
| ) |
|
|
pure virtual |
Returns whether the source is valid.
- Returns
- Returns false in case of an error, like the file couldn't be found.
Implemented in cAudio::cMemorySource.
◆ read()
| virtual int cAudio::IDataSource::read |
( |
void * |
output, |
|
|
int |
size |
|
) |
| |
|
pure virtual |
Reads out a section of the data stream.
- Parameters
-
| output | Pointer to a location to put the read data. |
| size | Size in bytes of the data to read. |
- Returns
- Number of bytes actually read. 0 bytes may indicate end of file or stream.
Implemented in cAudio::cMemorySource.
◆ seek()
| virtual bool cAudio::IDataSource::seek |
( |
int |
amount, |
|
|
bool |
relative |
|
) |
| |
|
pure virtual |
Seek to a position in the data stream.
- Parameters
-
| amount | Amount in bytes to seek to. |
| relative | If true the number of bytes in amount is relative to the current position in the stream. |
- Returns
- True if seek was successful, false if not.
Implemented in cAudio::cMemorySource.
The documentation for this class was generated from the following file: