Changeset 5896 for code/branches/core5/src/orxonox/sound/WorldSound.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/WorldSound.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 _WorldSound_H__ 29 #define _WorldSound_H__ 30 30 31 31 #include "OrxonoxPrereqs.h" 32 #include <cstring> // define NULL 32 33 #include "tools/interfaces/Tickable.h" 34 #include "sound/BaseSound.h" 35 #include "worldentities/StaticEntity.h" 33 36 34 37 namespace orxonox 35 38 { 36 /** 37 * The SoundBase class is the base class for all sound file loader classes. 38 * It server as main interface to the OpenAL library. 39 * 40 */ 41 class _OrxonoxExport SoundBase 39 /* 40 @brief 41 The WorldSound class is to be used for sounds with position and orientation. 42 */ 43 class _OrxonoxExport WorldSound : public StaticEntity, public BaseSound, public Tickable 42 44 { 43 45 public: 44 SoundBase(WorldEntity* entity = NULL);45 ~SoundBase();46 WorldSound(BaseObject* creator); 47 virtual ~WorldSound(); 46 48 47 void attachToEntity(WorldEntity* entity); 48 void update(); 49 void play(bool loop = false); 50 void stop(); 51 void pause(); 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 52 51 53 bool isPlaying(); 54 bool isPaused(); 55 bool isStopped(); 52 virtual void tick(float dt); 56 53 57 bool loadFile(const std::string& filename);54 virtual void processEvent(Event& event); 58 55 59 56 private: 60 ALuint loadOggFile(const std::string& filename); 61 ALuint source_; 62 ALuint buffer_; 63 WorldEntity* entity_; 57 }; 58 } 64 59 65 ALint getSourceState(); 66 }; // class SoundBase 67 } // namepsace orxonox 68 69 #endif /* _SoundBase_H__ */ 60 #endif /* _WorldSound_H__ */
Note: See TracChangeset
for help on using the changeset viewer.