Changeset 5896 for code/branches/core5/src/orxonox/sound/AmbientSound.h
- Timestamp:
- Oct 6, 2009, 11:12:01 PM (15 years ago)
- File:
-
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/orxonox/sound/AmbientSound.h
r5891 r5896 21 21 * 22 22 * Author: 23 * Erwin 'vaiursch' Herrsche23 * Reto Grieder 24 24 * Co-authors: 25 25 * ... 26 26 * 27 27 */ 28 #ifndef _ SoundBase_H__29 #define _ SoundBase_H__28 #ifndef _AmbientSound_H__ 29 #define _AmbientSound_H__ 30 30 31 31 #include "OrxonoxPrereqs.h" 32 #include <cstring> // define NULL 32 33 #include "core/BaseObject.h" 34 #include "sound/BaseSound.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 AmbientSound 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 AmbientSound : public BaseSound, public BaseObject 42 44 { 43 45 public: 44 SoundBase(WorldEntity* entity = NULL);45 ~SoundBase();46 AmbientSound(BaseObject* creator); 47 virtual ~AmbientSound(); 46 48 47 void attachToEntity(WorldEntity* entity); 48 void update(); 49 void play(bool loop = false); 50 void stop(); 51 void pause(); 52 53 bool isPlaying(); 54 bool isPaused(); 55 bool isStopped(); 56 57 bool loadFile(const std::string& filename); 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 58 51 59 52 private: 60 ALuint loadOggFile(const std::string& filename); 61 ALuint source_; 62 ALuint buffer_; 63 WorldEntity* entity_; 53 }; 54 } 64 55 65 ALint getSourceState(); 66 }; // class SoundBase 67 } // namepsace orxonox 68 69 #endif /* _SoundBase_H__ */ 56 #endif /* _AmbientSound_H__ */
Note: See TracChangeset
for help on using the changeset viewer.