Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 1, 2009, 6:49:48 PM (15 years ago)
Author:
rgrieder
Message:

Fixed a bug in BaseSound that caused every sound to play immediately when loaded.

Location:
code/branches/presentation2/src/orxonox/sound
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation2/src/orxonox/sound/BaseSound.cc

    r6186 r6188  
    6969        XMLPortParam(BaseSound, "volume", setVolume,  getVolume,  xmlelement, mode);
    7070        XMLPortParam(BaseSound, "loop",   setLooping, getLooping, xmlelement, mode);
    71         XMLPortParam(BaseSound, "play",   play,      isPlaying,  xmlelement, mode);
     71        XMLPortParam(BaseSound, "play",   setPlaying, isPlaying,  xmlelement, mode);
    7272        XMLPortParam(BaseSound, "source", setSource,  getSource,  xmlelement, mode);
    7373    }
  • code/branches/presentation2/src/orxonox/sound/BaseSound.h

    r6186 r6188  
    5959        bool isStopped() { return this->state_ == Stopped; }
    6060
     61        void setPlaying(bool val)
     62            { val ? this->play() : this->stop(); }
     63
    6164        virtual void setSource(const std::string& source);
    6265        virtual const std::string& getSource() const { return this->source_; }
Note: See TracChangeset for help on using the changeset viewer.