Changeset 6412 for code/branches/pickup2/src/orxonox/sound/AmbientSound.h
- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/orxonox/sound/AmbientSound.h
r5929 r6412 22 22 * Author: 23 23 * Reto Grieder 24 * Kevin Young 24 25 * Co-authors: 25 26 * ... 26 27 * 27 28 */ 29 28 30 #ifndef _AmbientSound_H__ 29 31 #define _AmbientSound_H__ … … 32 34 33 35 #include "core/BaseObject.h" 34 #include "sound/BaseSound.h" 36 #include "network/synchronisable/Synchronisable.h" 37 #include "BaseSound.h" 38 #include "MoodManager.h" 35 39 36 40 namespace orxonox … … 41 45 * 42 46 */ 43 class _OrxonoxExport AmbientSound : public BaseSound, public BaseObject 47 class _OrxonoxExport AmbientSound : public BaseSound, public BaseObject, public Synchronisable, public MoodListener 44 48 { 49 friend class SoundManager; 50 45 51 public: 46 52 AmbientSound(BaseObject* creator); 47 virtual ~AmbientSound();48 53 49 virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); 50 virtual void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 54 void XMLPort(Element& xmlelement, XMLPort::Mode mode); 55 void XMLEventPort(Element& xmlelement, XMLPort::Mode mode); 56 void changedActivity(); 57 58 void play(); 59 void stop(); 60 void pause(); 61 62 void setAmbientSource(const std::string& source); 63 inline const std::string& getAmbientSource() const 64 { return this->ambientSource_; } 65 66 void setPlayOnLoad(bool val); 67 bool getPlayOnLoad() const 68 { return this->bPlayOnLoad_; } 69 70 protected: 71 ~AmbientSound() { } 51 72 52 73 private: 74 void preDestroy(); 75 void registerVariables(); 76 float getRealVolume(); 77 void moodChanged(const std::string& mood); 78 inline void ambientSourceChanged() 79 { this->setAmbientSource(this->ambientSource_); } 80 inline void playOnLoadChanged() 81 { this->setPlayOnLoad(this->bPlayOnLoad_); } 82 83 std::string ambientSource_; //!< Analogous to source_, but mood independent 84 bool bPlayOnLoad_; //!< Play the sound immediately when loaded 53 85 }; 54 86 }
Note: See TracChangeset
for help on using the changeset viewer.