Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OggData.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_OGGDATA_H
19 #define INCLUDED_OGGDATA_H
20 
21 #include "lib/config2.h"
22 
23 #if CONFIG2_AUDIO
24 
25 #include "ogg.h"
26 #include "SoundData.h"
27 
29 #include "lib/file/vfs/vfs_path.h"
30 
31 class COggData : public CSoundData
32 {
33  ALuint m_Format;
35 
36 public:
37  COggData();
38  virtual ~COggData();
39 
40  virtual bool InitOggFile(const VfsPath& itemPath);
41  virtual bool IsFileFinished();
42  virtual bool IsOneShot();
43  virtual bool IsStereo();
44 
45  virtual int FetchDataIntoBuffer(int count, ALuint* buffers);
46  virtual void ResetFile();
47 
48 protected:
50 // int m_current_section;
52  bool m_OneShot;
53  ALuint m_Buffer[100];
55 
56  bool AddDataBuffer(char* data, long length);
57  void SetFormatAndFreq(int form, ALsizei freq);
58  int GetBufferCount();
59  unsigned int GetBuffer();
60  unsigned int* GetBufferPtr();
61 };
62 
63 #endif // CONFIG2_AUDIO
64 #endif // INCLUDED_OGGDATA_H
virtual bool IsFileFinished()
Definition: OggData.cpp:108
virtual void ResetFile()
Definition: OggData.cpp:113
ALuint m_Buffer[100]
Definition: OggData.h:53
unsigned int GetBuffer()
Definition: OggData.cpp:151
virtual bool IsStereo()
Definition: OggData.cpp:57
OggStreamPtr ogg
Definition: OggData.h:49
unsigned int * GetBufferPtr()
Definition: OggData.cpp:156
bool m_FileFinished
Definition: OggData.h:51
long m_Frequency
Definition: OggData.h:34
Definition: path.h:75
ALuint m_Format
Definition: OggData.h:33
shared_ptr< OggStream > OggStreamPtr
Definition: ogg.h:43
virtual bool IsOneShot()
Definition: OggData.cpp:119
int GetBufferCount()
Definition: OggData.cpp:103
COggData()
Definition: OggData.cpp:30
virtual bool InitOggFile(const VfsPath &itemPath)
Definition: OggData.cpp:62
virtual ~COggData()
Definition: OggData.cpp:38
bool AddDataBuffer(char *data, long length)
int m_BuffersUsed
Definition: OggData.h:54
virtual int FetchDataIntoBuffer(int count, ALuint *buffers)
Definition: OggData.cpp:124
void SetFormatAndFreq(int form, ALsizei freq)
Definition: OggData.cpp:51
bool m_OneShot
Definition: OggData.h:52