Changeset 7646 in orxonox.OLD for branches/atmospheric_engine/src/lib/sound
- Timestamp:
- May 17, 2006, 12:41:35 PM (19 years ago)
- Location:
- branches/atmospheric_engine/src/lib/sound
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/atmospheric_engine/src/lib/sound/sound_source.cc
r7326 r7646 122 122 alSourceStop(this->sourceID); 123 123 alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID()); 124 124 alSourcePlay(this->sourceID); 125 125 126 126 if (DEBUG >= 3) … … 153 153 if (DEBUG >= 3) 154 154 SoundEngine::checkError("Play Source", __LINE__); 155 } 156 157 158 /** 159 * @brief Plays back buffer on this Source and loops it 160 * @param buffer the buffer to play back on this Source 161 */ 162 void SoundSource::loop(const SoundBuffer* buffer) 163 { 164 if (!this->retrieveSource()) 165 { 166 PRINTF(2)("No more Free sources (You might consider raising the Source-Count).\n"); 167 return; 168 } 169 170 alSourceStop(this->sourceID); 171 alSourcei (this->sourceID, AL_BUFFER, buffer->getID()); 172 alSourcei (this->sourceID, AL_LOOPING, AL_TRUE ); 173 174 alSourcePlay(this->sourceID); 175 176 if (unlikely(this->buffer != NULL)) 177 alSourcei (this->sourceID, AL_BUFFER, this->buffer->getID()); 178 this->bPlay = true; 179 180 if (DEBUG >= 3) 181 SoundEngine::checkError("Play LoopSource", __LINE__); 155 182 } 156 183 -
branches/atmospheric_engine/src/lib/sound/sound_source.h
r7317 r7646 28 28 void play(); 29 29 void play(const SoundBuffer* buffer); 30 void loop(const SoundBuffer* buffer); 30 31 void stop(); 31 32 void pause();
Note: See TracChangeset
for help on using the changeset viewer.