Colobot
buffer.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
25 #pragma once
26 
27 #include "sound/sound.h"
28 
29 #include <string>
30 #include <vector>
31 #include <array>
32 
33 #include <al.h>
34 
35 class CBuffer
36 {
37 public:
38  CBuffer();
39  ~CBuffer();
40 
41  bool LoadFromFile(std::string, SoundType);
42  bool IsLoaded();
43 
44  SoundType GetSoundType();
45  ALuint GetBuffer();
46  float GetDuration();
47 
48 private:
49  ALuint m_buffer;
50  SoundType m_sound;
51  bool m_loaded;
52  float m_duration;
53 };
54 
Sound plugin interface.
Definition: buffer.h:35
SoundType
Enum representing sound file.
Definition: sound_type.h:34