Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
OggData.h
Go to the documentation of this file.
1/* Copyright (C) 2015 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
30
31class COggData : public CSoundData
32{
33 ALuint m_Format;
35
36public:
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
48protected:
52 ALuint m_Buffer[100];
54
55 bool AddDataBuffer(char* data, long length);
56 void SetFormatAndFreq(int form, ALsizei freq);
57 int GetBufferCount();
58 unsigned int GetBuffer();
59 unsigned int* GetBufferPtr();
60};
61
62#endif // CONFIG2_AUDIO
63#endif // INCLUDED_OGGDATA_H
Definition: OggData.h:32
OggStreamPtr ogg
Definition: OggData.h:49
long m_Frequency
Definition: OggData.h:34
unsigned int * GetBufferPtr()
Definition: OggData.cpp:152
unsigned int GetBuffer()
Definition: OggData.cpp:147
virtual bool IsFileFinished()
Definition: OggData.cpp:104
int m_BuffersUsed
Definition: OggData.h:53
virtual ~COggData()
Definition: OggData.cpp:34
ALuint m_Format
Definition: OggData.h:33
int GetBufferCount()
Definition: OggData.cpp:99
virtual bool InitOggFile(const VfsPath &itemPath)
Definition: OggData.cpp:59
bool m_FileFinished
Definition: OggData.h:50
bool m_OneShot
Definition: OggData.h:51
virtual void ResetFile()
Definition: OggData.cpp:109
void SetFormatAndFreq(int form, ALsizei freq)
Definition: OggData.cpp:48
bool AddDataBuffer(char *data, long length)
virtual bool IsStereo()
Definition: OggData.cpp:54
COggData()
Definition: OggData.cpp:29
virtual bool IsOneShot()
Definition: OggData.cpp:115
ALuint m_Buffer[100]
Definition: OggData.h:52
virtual int FetchDataIntoBuffer(int count, ALuint *buffers)
Definition: OggData.cpp:120
Definition: SoundData.h:35
Definition: path.h:80
std::shared_ptr< OggStream > OggStreamPtr
Definition: ogg.h:43