Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SoundData.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_SOUNDDATA_H
19 #define INCLUDED_SOUNDDATA_H
20 
21 #include "lib/config2.h"
22 
23 #if CONFIG2_AUDIO
24 
25 #include "lib/file/vfs/vfs_path.h"
26 #include "ps/CStr.h"
27 
28 #include <map>
29 
30 class CSoundData;
31 typedef std::map<std::wstring, CSoundData*> DataMap;
32 
33 
35 {
36 public:
37  static CSoundData* SoundDataFromFile(const VfsPath& itemPath);
38  static CSoundData* SoundDataFromOgg(const VfsPath& itemPath);
39 
40  static void ReleaseSoundData(CSoundData* theData);
41 
42  CSoundData();
43  virtual ~CSoundData();
44 
46  bool DecrementCount();
47  void InitProperties();
48  virtual bool IsOneShot();
49  virtual bool IsStereo();
50 
51 
52  virtual unsigned int GetBuffer();
53  virtual int GetBufferCount();
54  virtual Path* GetFileName();
55  virtual void SetFileName(const Path& aName);
56 
57  virtual unsigned int* GetBufferPtr();
58 
59 protected:
61 
62  unsigned int m_ALBuffer;
65 
66 };
67 
68 #endif // CONFIG2_AUDIO
69 
70 #endif // INCLUDED_SOUNDDATA_H
71 
std::map< std::wstring, CSoundData * > DataMap
Definition: SoundData.h:30
int m_RetentionCount
Definition: SoundData.h:63
virtual bool IsStereo()
Definition: SoundData.cpp:157
static CSoundData * SoundDataFromFile(const VfsPath &itemPath)
Definition: SoundData.cpp:68
virtual Path * GetFileName()
Definition: SoundData.cpp:122
unsigned int m_ALBuffer
Definition: SoundData.h:62
CSoundData * IncrementCount()
Definition: SoundData.cpp:134
Definition: path.h:75
Path * m_FileName
Definition: SoundData.h:64
virtual int GetBufferCount()
Definition: SoundData.cpp:117
virtual void SetFileName(const Path &aName)
Definition: SoundData.cpp:127
virtual unsigned int * GetBufferPtr()
Definition: SoundData.cpp:152
virtual unsigned int GetBuffer()
Definition: SoundData.cpp:147
virtual bool IsOneShot()
Definition: SoundData.cpp:93
bool DecrementCount()
Definition: SoundData.cpp:140
void InitProperties()
Definition: SoundData.cpp:47
virtual ~CSoundData()
Definition: SoundData.cpp:37
static DataMap sSoundData
Definition: SoundData.h:60
static void ReleaseSoundData(CSoundData *theData)
Definition: SoundData.cpp:54
static CSoundData * SoundDataFromOgg(const VfsPath &itemPath)
Definition: SoundData.cpp:99