[3060] | 1 | /* |
---|
| 2 | * ORXONOX - the hottest 3D action shooter ever to exist |
---|
| 3 | * > www.orxonox.net < |
---|
| 4 | * |
---|
| 5 | * |
---|
| 6 | * License notice: |
---|
| 7 | * |
---|
| 8 | * This program is free software; you can redistribute it and/or |
---|
| 9 | * modify it under the terms of the GNU General Public License |
---|
| 10 | * as published by the Free Software Foundation; either version 2 |
---|
| 11 | * of the License, or (at your option) any later version. |
---|
| 12 | * |
---|
| 13 | * This program is distributed in the hope that it will be useful, |
---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 16 | * GNU General Public License for more details. |
---|
| 17 | * |
---|
| 18 | * You should have received a copy of the GNU General Public License |
---|
| 19 | * along with this program; if not, write to the Free Software |
---|
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
| 21 | * |
---|
| 22 | * Author: |
---|
| 23 | * Erwin 'vaiursch' Herrsche |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
[3133] | 28 | #ifndef _SoundBase_H__ |
---|
| 29 | #define _SoundBase_H__ |
---|
[3060] | 30 | |
---|
[3133] | 31 | #include "OrxonoxPrereqs.h" |
---|
[3060] | 32 | #include <string> |
---|
| 33 | |
---|
[3139] | 34 | // forward declarations |
---|
| 35 | typedef unsigned int ALuint; |
---|
| 36 | typedef int ALint; |
---|
| 37 | |
---|
[3060] | 38 | namespace orxonox |
---|
| 39 | { |
---|
| 40 | /** |
---|
| 41 | * The SoudBase class is the base class for all sound file loader classes. |
---|
| 42 | * It server as main interface to the OpenAL library. |
---|
| 43 | * |
---|
| 44 | */ |
---|
| 45 | class _OrxonoxExport SoundBase |
---|
| 46 | { |
---|
| 47 | public: |
---|
| 48 | SoundBase(WorldEntity* entity = NULL); |
---|
| 49 | ~SoundBase(); |
---|
| 50 | |
---|
| 51 | void attachToEntity(WorldEntity* entity); |
---|
| 52 | void update(); |
---|
| 53 | void play(bool loop = false); |
---|
| 54 | void stop(); |
---|
| 55 | void pause(); |
---|
| 56 | |
---|
| 57 | bool isPlaying(); |
---|
| 58 | bool isPaused(); |
---|
| 59 | bool isStopped(); |
---|
| 60 | |
---|
| 61 | bool loadFile(std::string filename); |
---|
| 62 | |
---|
| 63 | private: |
---|
[3139] | 64 | ALuint loadOggFile(std::string filename); |
---|
| 65 | ALuint source_; |
---|
| 66 | ALuint buffer_; |
---|
[3060] | 67 | WorldEntity* entity_; |
---|
| 68 | |
---|
[3139] | 69 | ALint getSourceState(); |
---|
[3060] | 70 | |
---|
| 71 | static SoundManager* soundmanager_s; |
---|
| 72 | }; // class SoundBase |
---|
| 73 | } // namepsace orxonox |
---|
| 74 | |
---|
[3133] | 75 | #endif /* _SoundBase_H__ */ |
---|