Changeset 7810 in orxonox.OLD for trunk/src/lib/sound
- Timestamp:
- May 24, 2006, 3:57:04 PM (19 years ago)
- Location:
- trunk/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_source.cc
r7729 r7810 122 122 alSourceStop(this->sourceID); 123 123 alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID()); 124 alSourcePlay(this->sourceID); 124 alSourcei (this->sourceID, AL_LOOPING, AL_FALSE ); 125 alSourcePlay(this->sourceID); 125 126 126 127 if (DEBUG_LEVEL >= 3) … … 143 144 } 144 145 145 alSourceStop(this->sourceID); 146 alSourcei (this->sourceID, AL_BUFFER, buffer->getID()); 147 alSourcePlay(this->sourceID); 146 alSourceStop(this->sourceID); 147 alSourcei (this->sourceID, AL_BUFFER, buffer->getID()); 148 alSourcei (this->sourceID, AL_LOOPING, AL_FALSE ); 149 alSourcePlay(this->sourceID); 148 150 149 151 if (unlikely(this->buffer != NULL)) … … 156 158 157 159 158 /** 159 * @brief Stops playback of a SoundSource 160 */ 161 void SoundSource::stop() 160 /** 161 * @brief Plays and loops buffer on this Source 162 * @param buffer the buffer to play back on this Source 163 */ 164 void SoundSource::loop(const SoundBuffer* buffer) 165 { 166 if (this->buffer && this->retrieveSource()) 167 { 168 if (this->bPlay) 169 alSourceStop(this->sourceID); 170 171 alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID()); 172 alSourcei (this->sourceID, AL_LOOPING, AL_TRUE ); 173 alSourcePlay(this->sourceID); 174 175 if (DEBUG_LEVEL >= 3) 176 SoundEngine::checkError("Play LoopSource", __LINE__); 177 this->bPlay = true; 178 } 179 } 180 181 182 /** 183 * @brief Stops playback of a SoundSource 184 */ 185 void SoundSource::stop() 186 { 187 this->bPlay = false; 188 if (this->sourceID != 0) 162 189 { 163 190 this->bPlay = false; … … 173 200 } 174 201 } 175 202 } 176 203 177 204 /** -
trunk/src/lib/sound/sound_source.h
r7460 r7810 29 29 void play(); 30 30 void play(const SoundBuffer* buffer); 31 void loop(); 32 void loop(const SoundBuffer* buffer); 31 33 void stop(); 32 34 void pause();
Note: See TracChangeset
for help on using the changeset viewer.