Changeset 7299 in orxonox.OLD for trunk/src/lib/sound/sound_engine.cc
- Timestamp:
- Apr 16, 2006, 5:48:40 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/sound/sound_engine.cc
r7298 r7299 36 36 ////////////////// 37 37 /** 38 * standard constructor38 * @brief standard constructor 39 39 */ 40 40 SoundEngine::SoundEngine () … … 59 59 60 60 /** 61 * the singleton reference to this class61 * @brief the singleton reference to this class 62 62 */ 63 63 SoundEngine* SoundEngine::singletonRef = NULL; 64 64 65 65 /** 66 * standard deconstructor66 * @brief standard destructor 67 67 */ 68 68 SoundEngine::~SoundEngine () … … 105 105 106 106 /** 107 * loads the settings of the SoundEngine from an ini-file107 * @brief loads the settings of the SoundEngine from an ini-file 108 108 */ 109 109 void SoundEngine::loadSettings() … … 120 120 121 121 /** 122 * creates a new SoundSource.122 * @brief creates a new SoundSource. 123 123 * @param fileName The Name to load the SoundBuffer from 124 124 * @param sourceNode The sourceNode to bind this SoundSource to. … … 133 133 134 134 /** 135 * Sets the doppler values of openAL135 * @brief Sets the doppler values of openAL 136 136 * @param dopplerFactor the extent of the doppler-effect 137 137 * @param dopplerVelocity the Speed the sound travels … … 147 147 148 148 149 /** 150 * @brief retrieves an OpenAL Source from the availiable Sources. 151 * @param source the Source to fill with the Value. 152 */ 149 153 void SoundEngine::popALSource(ALuint& source) 150 154 { … … 158 162 this->ALSources.pop(); 159 163 SDL_mutexV(this->sourceMutex); 160 printf("Retrieve Source %d\n", source); 161 } 162 } 163 164 } 165 } 166 167 168 /** 169 * @brief Pushes an OpenAL Source back into the Stack of known sources 170 * @param source the Source to push onto the top of the SourceStack 171 */ 164 172 void SoundEngine::pushALSource(ALuint& source) 165 173 { … … 174 182 175 183 /** 176 * updates all The positions, Directions and Velocities of all Sounds177 */184 * @brief updates all The positions, Directions and Velocities of all Sounds 185 */ 178 186 void SoundEngine::update() 179 187 { … … 239 247 } 240 248 241 /**242 * Removes all the Buffers that are not anymore needed by any Sources243 */244 void SoundEngine::flushUnusedBuffers()245 {246 /// FIXME247 /* if(this->sourceList && this->bufferList)248 {249 tIterator<BaseObject>* bufferIterator = this->bufferList->getIterator();250 SoundBuffer* enumBuffer = (SoundBuffer*)bufferIterator->firstElement();251 while (enumBuffer)252 {253 tIterator<BaseObject>* sourceIterator = this->sourceList->getIterator();254 SoundSource* enumSource = (SoundSource*)sourceIterator->firstElement();255 while (enumSource)256 {257 if (enumBuffer == enumSource->getBuffer())258 break;259 enumSource = (SoundSource*)sourceIterator->nextElement();260 }261 delete sourceIterator;262 if (enumSource == NULL)263 ResourceManager::getInstance()->unload(enumBuffer);264 enumBuffer = (SoundBuffer*)bufferIterator->nextElement();265 }266 delete bufferIterator;267 }*/ /// FIXME268 }269 270 /**271 * flushes all the Buffers272 * deletes them from the BufferList, and also removes them via the ResourceManager.273 */274 void SoundEngine::flushAllBuffers()275 {276 if (this->bufferList)277 {278 while (this->bufferList->size() > 0)279 ResourceManager::getInstance()->unload(static_cast<SoundBuffer*>(this->bufferList->front()), RP_LEVEL);280 }281 }282 283 /**284 * deletes all the Sources.285 */286 void SoundEngine::flushAllSources()287 {288 if (this->sourceList)289 {290 while(this->sourceList->size() > 0)291 delete this->sourceList->front();292 }293 }294 249 295 250 /** … … 378 333 } 379 334 335 /** 336 * @brief checks for an OpenAL error 337 * @param error the ErrorMessage to display 338 * @param line on what line did the error occure. 339 */ 380 340 bool SoundEngine::checkError(const std::string& error, unsigned int line) 381 341 { … … 390 350 } 391 351 352 /** 353 * @brief check for an ALC error. 354 * @brief error the Error-String to display 355 * @param line on that line, the error occured (debugging mode). 356 */ 392 357 bool SoundEngine::checkALCError(const std::string& error, unsigned int line) 393 358 {
Note: See TracChangeset
for help on using the changeset viewer.