Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jan 17, 2016, 6:41:22 PM (8 years ago)
Author:
landauf
Message:

merged remaining commits from cpp11_v2 to cpp11_v3 (for some reason they were not merged in the first attempt)

Location:
code/branches/cpp11_v3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/cpp11_v3

  • code/branches/cpp11_v3/src/orxonox/sound/BaseSound.cc

    r11054 r11068  
    4949        , volume_(0.7)
    5050        , bLooping_(false)
    51         , state_(Stopped)
     51        , state_(State::Stopped)
    5252        , pitch_ (1.0)
    5353    {
     
    6363    BaseSound::~BaseSound()
    6464    {
    65         if (this->state_ != Stopped)
     65        if (this->state_ != State::Stopped)
    6666            this->stop();
    6767        // Release buffer
     
    8383    void BaseSound::doPlay()
    8484    {
    85         this->state_ = Playing;
     85        this->state_ = State::Playing;
    8686        if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING && this->soundBuffer_ != nullptr)
    8787        {
     
    102102    bool BaseSound::doStop()
    103103    {
    104         this->state_ = Stopped;
     104        this->state_ = State::Stopped;
    105105        if (alIsSource(this->audioSource_))
    106106        {
     
    123123        if (this->isStopped())
    124124            return;
    125         this->state_ = Paused;
     125        this->state_ = State::Paused;
    126126        if (alIsSource(this->audioSource_))
    127127            alSourcePause(this->audioSource_);
     
    256256        else // No source acquired so far, but might be set to playing or paused
    257257        {
    258             State state = static_cast<State>(this->state_); // save
     258            State state = this->state_; // save
    259259            if (this->isPlaying() || this->isPaused())
    260260                doPlay();
    261             if (state == Paused)
    262             {
    263                 this->state_ = Paused;
     261            if (state == State::Paused)
     262            {
     263                this->state_ = State::Paused;
    264264                doPause();
    265265            }
     
    271271        switch (this->state_)
    272272        {
    273             case Playing:
     273            case State::Playing:
    274274                this->play();
    275275                break;
    276             case Paused:
     276            case State::Paused:
    277277                this->pause();
    278278                break;
    279             case Stopped:
     279            case State::Stopped:
    280280            default:
    281281                this->stop();
Note: See TracChangeset for help on using the changeset viewer.