Changeset 6255 for code/branches/presentation2/src/orxonox/sound
- Timestamp:
- Dec 6, 2009, 5:02:56 PM (15 years ago)
- Location:
- code/branches/presentation2/src/orxonox/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2/src/orxonox/sound/BaseSound.cc
r6254 r6255 76 76 void BaseSound::play() 77 77 { 78 if (!this->isPlaying() && GameMode::showsGraphics())79 {80 this->state_ = Playing;78 this->state_ = Playing; 79 if (GameMode::playsSound() && this->getSourceState() != AL_PLAYING) 80 { 81 81 alSourcePlay(this->audioSource_); 82 82 … … 100 100 if (GameMode::playsSound()) 101 101 alSourcePause(this->audioSource_); 102 } 103 104 ALint BaseSound::getSourceState() const 105 { 106 if (GameMode::playsSound()) 107 { 108 ALint state; 109 alGetSourcei(this->audioSource_, AL_SOURCE_STATE, &state); 110 return state; 111 } 112 else 113 return AL_INITIAL; 102 114 } 103 115 -
code/branches/presentation2/src/orxonox/sound/BaseSound.h
r6254 r6255 84 84 85 85 protected: 86 AL uint loadOggFile();86 ALint getSourceState() const; 87 87 88 88 ALuint audioSource_;
Note: See TracChangeset
for help on using the changeset viewer.