cAudio  2.3.0
3d Audio Engine
 All Classes Namespaces Functions Variables Enumerations Pages
cMemorySource.h
1 // Copyright (c) 2008-2011 Raynaldo (Wildicv) Rivera, Joshua (Dark_Kilauea) Jones, Murat (wolfmanfx) Sari
2 // This file is part of the "cAudio Engine"
3 // For conditions of distribution and use, see copyright notice in cAudio.h
4 
5 #pragma once
6 
7 #include "IDataSource.h"
8 #include "cMemoryOverride.h"
9 
10 namespace cAudio
11 {
13  class cMemorySource : public IDataSource, public cMemoryOverride
14  {
15  public:
21  cMemorySource(const void* data, int size, bool copy);
22  ~cMemorySource();
23 
24  virtual bool isValid();
25  virtual int getCurrentPos();
26  virtual int getSize();
27  virtual int read(void* output, int size);
28  virtual bool seek(int amount, bool relative);
29  protected:
30  char* Data;
31  int Size;
32  bool Valid;
33  int Pos;
34  };
35 };
virtual bool seek(int amount, bool relative)
Seek to a position in the data stream.
cMemorySource(const void *data, int size, bool copy)
virtual int read(void *output, int size)
Reads out a section of the data stream.
Interface for data providers in cAudio.
Definition: IDataSource.h:12
virtual bool isValid()
Returns whether the source is valid.
virtual int getSize()
Returns the total size of the data stream.
Class used to read from a memory buffer.
Definition: cMemorySource.h:13
virtual int getCurrentPos()
Returns the current location in the data stream.
Overrides the memory allocations for classes derived from it and makes them use the cAudio memory sys...