TDME2  1.9.200
VorbisAudioStream.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
8 
9 using std::string;
10 
14 
15 /**
16  * Vorbis audio stream
17  * @author Andreas Drewke
18  */
20  : public AudioStream
21 {
22  friend class Audio;
23 
24 private:
25  string pathName;
26  string fileName;
28  bool initiated { false };
29 
30 public:
31  // forbid class copy
33 
34  /**
35  * Protected constructor
36  * @param id id
37  * @param pathName path name
38  * @param fileName file name
39  */
40  inline VorbisAudioStream(const string& id, const string& pathName, const string& fileName): AudioStream(id) {
41  this->pathName = pathName;
42  this->fileName = fileName;
43  }
44 
45  /**
46  * Protected destructor
47  */
48  inline ~VorbisAudioStream() {
49  }
50 
51  // overridden methods
52  void rewind() override;
53 
54 protected:
55  // overridden methods
56  bool initialize() override;
57  void dispose() override;
58 
59  // overridden methods
60  void fillBuffer(ByteBuffer* data) override;
61 };
unique_ptr< ByteBuffer > data
Definition: AudioStream.h:34
Interface to audio module.
Definition: Audio.h:29
void rewind() override
Rewinds this audio entity.
void dispose() override
Dispose this entity from OpenAL.
bool initialize() override
Initiates this OpenAL entity to OpenAl.
void fillBuffer(ByteBuffer *data) override
Fill buffer.
~VorbisAudioStream()
Protected destructor.
OGG/Vorbis audio decoder.
Definition: VorbisDecoder.h:31
Byte buffer class.
Definition: ByteBuffer.h:27
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6