Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 1, 2011, 5:10:29 AM (13 years ago)
Author:
rgrieder
Message:

Merged sound5 into sound6 branch.

Location:
code/branches/usability
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/usability

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

    r7858 r8005  
    9292            alSourcePlay(this->audioSource_);
    9393            if (int error = alGetError())
    94                 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;
     94                COUT(2) << "Sound: Error playing sound: " << getALErrorString(error) << std::endl;
    9595        }
    9696    }
     
    145145        alSource3f(this->audioSource_, AL_DIRECTION, 0, 0, 0);
    146146        if (ALint error = alGetError())
    147             COUT(2) << "Sound Warning: Setting source parameters to 0 failed: "
    148                     << SoundManager::getALErrorString(error) << std::endl;
    149         assert(this->soundBuffer_ != NULL);
    150         alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());
     147            COUT(2) << "Sound: Warning: Setting source parameters to 0 failed: " << getALErrorString(error) << std::endl;
     148        if(this->soundBuffer_ != NULL) {
     149            alSourcei(this->audioSource_, AL_BUFFER, this->soundBuffer_->getBuffer());
     150        }
    151151        if (ALuint error = alGetError())
    152             COUT(1) << "Sound Error: Could not set buffer \"" << this->source_ << "\": " << SoundManager::getALErrorString(error) << std::endl;
     152            COUT(1) << "Sound: Error: Could not set buffer \"" << this->source_ << "\": " << getALErrorString(error) << std::endl;
    153153    }
    154154
     
    157157        this->volume_ = clamp(vol, 0.0f, 1.0f);
    158158        if (this->volume_ != vol)
    159             COUT(2) << "Sound warning: volume out of range, clamping value." << std::endl;
     159            COUT(2) << "Sound: Warning: volume out of range, clamping value." << std::endl;
    160160        this->updateVolume();
    161161    }
     
    168168            alSourcef(this->audioSource_, AL_GAIN, volume);
    169169            if (int error = alGetError())
    170                 COUT(2) << "Sound: Error setting volume to " << volume
    171                         << ": " << SoundManager::getALErrorString(error) << std::endl;
     170                COUT(2) << "Sound: Error setting volume to " << volume << ": " << getALErrorString(error) << std::endl;
    172171        }
    173172    }
     
    184183        if (pitch > 2 || pitch < 0.5f)
    185184        {
    186             COUT(2) << "Sound warning: pitch out of range, cropping value." << std::endl;
     185            COUT(2) << "Sound: Warning: pitch out of range, cropping value." << std::endl;
    187186            pitch = pitch > 2.0f ? 2.0f : pitch;
    188187            pitch = pitch < 0.5f ? 0.5f : pitch;
     
    193192            alSourcef(this->audioSource_, AL_PITCH, pitch);
    194193            if (int error = alGetError())
    195                 COUT(2) << "Sound: Error setting pitch: " << SoundManager::getALErrorString(error) << std::endl;
     194                COUT(2) << "Sound: Error setting pitch: " << getALErrorString(error) << std::endl;
    196195        }
    197196    }
     
    238237            if (ALuint error = alGetError())
    239238            {
    240                 COUT(1) << "Sound Error: Could not set buffer \"" << source << "\": " << SoundManager::getALErrorString(error) << std::endl;
     239                COUT(1) << "Sound: Error: Could not set buffer \"" << source << "\": " << getALErrorString(error) << std::endl;
    241240                return;
    242241            }
     
    246245            alSourcePlay(this->audioSource_);
    247246            if (int error = alGetError())
    248                 COUT(2) << "Sound: Error playing sound: " << SoundManager::getALErrorString(error) << std::endl;
     247                COUT(2) << "Sound: Error playing sound: " << getALErrorString(error) << std::endl;
    249248            if (this->isPaused())
    250249                alSourcePause(this->audioSource_);
Note: See TracChangeset for help on using the changeset viewer.