2009-12-22 12:22:32 +00:00
|
|
|
#ifndef MANGLE_STREAM_AUDIERECLIENT_H
|
|
|
|
#define MANGLE_STREAM_AUDIERECLIENT_H
|
|
|
|
|
|
|
|
#include <audiere.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include "iwrapper.h"
|
|
|
|
|
|
|
|
namespace Mangle {
|
|
|
|
namespace Stream {
|
|
|
|
|
|
|
|
/** @brief An Audiere::File that wraps a Mangle::Stream input.
|
|
|
|
|
|
|
|
This lets Audiere read sound files from any generic archive or
|
|
|
|
file manager that supports Mangle streams.
|
|
|
|
*/
|
2009-12-28 13:09:17 +00:00
|
|
|
class AudiereFile : public audiere::RefImplementation<audiere::File>, _SWrapper
|
2009-12-22 12:22:32 +00:00
|
|
|
{
|
|
|
|
public:
|
2009-12-28 13:09:17 +00:00
|
|
|
AudiereFile(Stream *inp, bool autoDel=false)
|
|
|
|
: _SWrapper(inp, autoDel) {}
|
2009-12-22 12:22:32 +00:00
|
|
|
|
|
|
|
/// Read 'count' bytes, return bytes successfully read
|
|
|
|
int read(void *buf, int count)
|
|
|
|
{ return inp->read(buf,count); }
|
|
|
|
|
|
|
|
/// Seek, relative to specified seek mode. Returns true if successful.
|
2009-12-24 10:08:18 +00:00
|
|
|
bool seek(int pos, audiere::File::SeekMode mode);
|
2009-12-22 12:22:32 +00:00
|
|
|
|
|
|
|
/// Get current position
|
|
|
|
int tell()
|
|
|
|
{ assert(inp->hasPosition); return inp->tell(); }
|
|
|
|
};
|
|
|
|
|
|
|
|
}} // namespaces
|
|
|
|
#endif
|