Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
OpenALStreamingSound.h
Go to the documentation of this file.
1 //
2 // C++ Interface: Audio::OpenALSimpleSound
3 //
4 #ifndef __AUDIO_OPENALSTREAMINGSOUND_H__INCLUDED__
5 #define __AUDIO_OPENALSTREAMINGSOUND_H__INCLUDED__
6 
7 #include "../../Exceptions.h"
8 #include "../../Types.h"
9 #include "../../Format.h"
10 #include "../../SimpleSound.h"
11 #include "../../SoundBuffer.h"
12 
13 #include "al.h"
14 
15 namespace Audio {
16 
17  class OpenALRenderableSource;
18 
35  {
36  ALBufferHandle bufferHandles[2];
37  Timestamp bufferStarts[2];
38 
39  SoundBuffer buffer;
40 
41  Format targetFormat;
42 
43  size_t bufferSamples;
44 
45  unsigned char readBufferIndex;
46  unsigned char playBufferIndex;
47 
48  public:
57  unsigned int bufferSamples = 0) throw();
58 
59  public:
60  virtual ~OpenALStreamingSound();
61 
62  // The following section contains supporting methods for accessing the stream.
63  // Subclasses need not bother with actual stream management, they need only worry
64  // about sending the samples to where they're needed.
65  protected:
67  virtual void loadImpl(bool wait) throw(Exception);
68 
70  virtual void unloadImpl() throw();
71 
72  // The following section contains package-private methods.
73  // Only OpenAL renderer classes should access them, NOT YOU
74  public:
89 
96  void unqueueBuffer(ALBufferHandle buffer) throw(Exception);
97 
99  void flushBuffers() throw();
100 
105  Timestamp getTimeBase() const throw();
106 
111  void seek(double position) throw(Exception);
112  };
113 
114 };
115 
116 #endif//__AUDIO_OPENALSTREAMINGSOUND_H__INCLUDED__