Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7297 in orxonox.OLD


Ignore:
Timestamp:
Apr 15, 2006, 9:48:08 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: now the sound gets correcty detached from the source, when a SoundSource releses its alSource

Location:
trunk/src
Files:
3 edited

Legend:

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

    r7296 r7297  
    140140    }
    141141    empty();
    142     SoundEngine::getInstance()->pushALSource(source);
     142    alSourcei(this->source, AL_BUFFER, 0);
     143    SoundEngine::getInstance()->pushALSource(this->source);
    143144    this->source = 0;
    144145    this->state &= !SourceAllocated;
  • trunk/src/lib/sound/sound_source.cc

    r7291 r7297  
    2525
    2626/**
    27  * creates a SoundSource at position sourceNode with the SoundBuffer buffer
     27 * @brief creates a SoundSource at position sourceNode with the SoundBuffer buffer
    2828 */
    2929SoundSource::SoundSource(const PNode* sourceNode, const SoundBuffer* buffer)
     
    4242
    4343/**
    44  * deletes a SoundSource
     44 * @brief deletes a SoundSource
    4545 */
    4646SoundSource::~SoundSource()
     
    5050
    5151/**
    52  * Plays back a SoundSource
     52 * @brief Plays back a SoundSource
    5353 */
    5454void SoundSource::play()
     
    9292
    9393/**
    94  * Stops playback of a SoundSource
     94 * @brief Stops playback of a SoundSource
    9595 */
    9696void SoundSource::stop()
     
    102102    if (DEBUG >= 3)
    103103      SoundEngine::checkError("StopSource", __LINE__);
     104    alSourcei(this->sourceID, AL_BUFFER, 0);
    104105    SoundEngine::getInstance()->pushALSource(this->sourceID);
    105106    this->sourceID = 0;
     
    108109
    109110/**
    110  * Pauses Playback of a SoundSource
     111 * @brief Pauses Playback of a SoundSource
    111112 */
    112113void SoundSource::pause()
     
    118119
    119120/**
    120  * Rewinds Playback of a SoundSource
     121 * @brief Rewinds Playback of a SoundSource
    121122 */
    122123void SoundSource::rewind()
     
    129130
    130131/**
    131  * sets the RolloffFactor of the Sound emitted from the SoundSource
     132 * @brief sets the RolloffFactor of the Sound emitted from the SoundSource
    132133 * @param rolloffFactor The Factor described
    133 
    134    this tells openAL how fast the Sounds decay outward from the Source
     134 *
     135 * this tells openAL how fast the Sounds decay outward from the Source
    135136 */
    136137void SoundSource::setRolloffFactor(ALfloat rolloffFactor)
  • trunk/src/story_entities/game_world.cc

    r7296 r7297  
    136136int GameWorld::createAudioThread(void* gameWorld)
    137137{
    138 /*  GameWorld* gw = (GameWorld*)gameWorld;
     138  GameWorld* gw = (GameWorld*)gameWorld;
    139139  printf("STARTIG AUDIO THREAD\n");
    140140  if(gw->dataTank && gw->dataTank->music != NULL)
     
    146146      gw->dataTank->music->update();
    147147    SDL_Delay(1);
    148   }*/
    149   //printf("End the AudioThread\n");
     148  }
     149  printf("End the AudioThread\n");
    150150}
    151151
     
    229229  if (this->audioThread == NULL)
    230230    this->audioThread = SDL_CreateThread(GameWorld::createAudioThread, (void*)this);
    231 
    232   if (this->dataTank->music != NULL)
    233     this->dataTank->music->playback();
    234231
    235232  this->run();
     
    413410  PNode::getNullParent()->updateNode (this->dtS);
    414411  SoundEngine::getInstance()->update();
    415 
    416   if (this->dataTank->music != NULL)
    417     this->dataTank->music->update();
    418 
    419412}
    420413
Note: See TracChangeset for help on using the changeset viewer.