Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7299 in orxonox.OLD for trunk/src/lib/sound/sound_engine.cc


Ignore:
Timestamp:
Apr 16, 2006, 5:48:40 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: some nice Class-Stuff

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/sound/sound_engine.cc

    r7298 r7299  
    3636//////////////////
    3737/**
    38  * standard constructor
     38 * @brief standard constructor
    3939*/
    4040SoundEngine::SoundEngine ()
     
    5959
    6060/**
    61  * the singleton reference to this class
     61 * @brief the singleton reference to this class
    6262*/
    6363SoundEngine* SoundEngine::singletonRef = NULL;
    6464
    6565/**
    66  *  standard deconstructor
     66 * @brief standard destructor
    6767 */
    6868SoundEngine::~SoundEngine ()
     
    105105
    106106/**
    107  * loads the settings of the SoundEngine from an ini-file
     107 * @brief loads the settings of the SoundEngine from an ini-file
    108108 */
    109109void SoundEngine::loadSettings()
     
    120120
    121121/**
    122  * creates a new SoundSource.
     122 * @brief creates a new SoundSource.
    123123 * @param fileName The Name to load the SoundBuffer from
    124124 * @param sourceNode The sourceNode to bind this SoundSource to.
     
    133133
    134134/**
    135  * Sets the doppler values of openAL
     135 * @brief Sets the doppler values of openAL
    136136 * @param dopplerFactor the extent of the doppler-effect
    137137 * @param dopplerVelocity the Speed the sound travels
     
    147147
    148148
     149/**
     150 * @brief retrieves an OpenAL Source from the availiable Sources.
     151 * @param source the Source to fill with the Value.
     152 */
    149153void SoundEngine::popALSource(ALuint& source)
    150154{
     
    158162    this->ALSources.pop();
    159163    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 */
    164172void SoundEngine::pushALSource(ALuint& source)
    165173{
     
    174182
    175183/**
    176  * updates all The positions, Directions and Velocities of all Sounds
    177 */
     184 * @brief updates all The positions, Directions and Velocities of all Sounds
     185 */
    178186void SoundEngine::update()
    179187{
     
    239247}
    240248
    241 /**
    242  *  Removes all the Buffers that are not anymore needed by any Sources
    243 */
    244 void SoundEngine::flushUnusedBuffers()
    245 {
    246   /// FIXME
    247   /*  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   }*/ /// FIXME
    268 }
    269 
    270 /**
    271  * flushes all the Buffers
    272  * 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 }
    294249
    295250/**
     
    378333}
    379334
     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 */
    380340bool SoundEngine::checkError(const std::string& error, unsigned int line)
    381341{
     
    390350}
    391351
     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 */
    392357bool SoundEngine::checkALCError(const std::string& error, unsigned int line)
    393358{
Note: See TracChangeset for help on using the changeset viewer.