Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2009, 12:18:41 AM (14 years ago)
Author:
rgrieder
Message:

Several small changes in sound:

  • Fixed a bug that caused a sound source to be initialised on pause() even it already existed
  • The XML parameter is now called "looping" instead of "loop" because looping was used really all over the code
  • The "play" XML parameter doesn't exist anymore, use "playOnLoad" for AmbientSound only.
  • Added "pitch" XML parameter
  • Changes in synchronisation policy: Ambient sound should not synchronise the state but instead th new playOnLoad parameter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/AmbientSound.h

    r6370 r6382  
    5050    public:
    5151        AmbientSound(BaseObject* creator);
    52         ~AmbientSound();
    5352
    5453        void XMLPort(Element& xmlelement, XMLPort::Mode mode);
     
    6160
    6261        void setAmbientSource(const std::string& source);
    63         const std::string& getAmbientSource() const { return this->ambientSource_; }
    64         inline void ambientSourceChanged(){ this->setAmbientSource(this->ambientSource_); }
     62        inline const std::string& getAmbientSource() const
     63            { return this->ambientSource_; }
     64
     65        void setPlayOnLoad(bool val);
     66        bool getPlayOnLoad() const
     67            { return this->bPlayOnLoad_; }
     68
     69    protected:
     70        ~AmbientSound() { }
    6571
    6672    private:
    67         virtual void preDestroy();
    68         void doPlay();
    69         void doStop();
    70         void doPause();
     73        void preDestroy();
    7174        void registerVariables();
    7275        float getRealVolume();
     76        inline void ambientSourceChanged()
     77            { this->setAmbientSource(this->ambientSource_); }
     78        inline void playOnLoadChanged()
     79            { this->setPlayOnLoad(this->bPlayOnLoad_); }
    7380
    7481        std::string ambientSource_; //!< Analogous to source_, but mood independent
     82        bool        bPlayOnLoad_;   //!< Play the sound immediately when loaded
    7583    };
    7684}
Note: See TracChangeset for help on using the changeset viewer.