Changeset 5896 for code/branches/core5/src/orxonox/sound/BaseSound.h
- Timestamp:
- Oct 6, 2009, 11:12:01 PM (15 years ago)
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/sound/BaseSound.h
r5891 r5896 21 21 * 22 22 * Author: 23 * 23 * Erwin 'vaiursch' Herrsche 24 24 * Co-authors: 25 * ...25 * Reto Grieder 26 26 * 27 27 */ 28 #ifndef _ SoundBase_H__29 #define _ SoundBase_H__28 #ifndef _BaseSound_H__ 29 #define _BaseSound_H__ 30 30 31 31 #include "OrxonoxPrereqs.h" 32 #include <cstring> // define NULL 32 33 #include <string> 34 #include "core/OrxonoxClass.h" 33 35 34 36 namespace orxonox 35 37 { 36 38 /** 37 * The SoundBaseclass is the base class for all sound file loader classes.39 * The BaseSound class is the base class for all sound file loader classes. 38 40 * It server as main interface to the OpenAL library. 39 41 * 40 42 */ 41 class _OrxonoxExport SoundBase43 class _OrxonoxExport BaseSound : virtual public OrxonoxClass 42 44 { 43 45 public: 44 SoundBase(WorldEntity* entity = NULL);45 ~SoundBase();46 BaseSound(); 47 virtual ~BaseSound(); 46 48 47 void attachToEntity(WorldEntity* entity); 48 void update(); 49 void play(bool loop = false); 49 void play(); 50 50 void stop(); 51 51 void pause(); … … 55 55 bool isStopped(); 56 56 57 bool loadFile(const std::string& filename); 57 void setSoundFile(const std::string& soundFile); 58 const std::string& getSoundFile() { return this->soundFile_; } 59 60 bool getPlayOnLoad() { return this->bPlayOnLoad_; } 61 void setPlayOnLoad(bool val); 62 63 bool getLoop() { return this->bLoop_; } 64 void setLoop(bool val) { this->bLoop_ = val; } 65 66 protected: 67 //ALuint loadOggFile(const std::string& filename); 68 ALint getSourceState(); 69 70 ALuint source_; 71 ALuint buffer_; 58 72 59 73 private: 60 ALuint loadOggFile(const std::string& filename); 61 ALuint source_; 62 ALuint buffer_; 63 WorldEntity* entity_; 74 std::string soundFile_; 75 bool bPlayOnLoad_; 76 bool bLoop_; 77 }; 78 } 64 79 65 ALint getSourceState(); 66 }; // class SoundBase 67 } // namepsace orxonox 68 69 #endif /* _SoundBase_H__ */ 80 #endif /* _BaseSound_H__ */
Note: See TracChangeset
for help on using the changeset viewer.