Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7297 in orxonox.OLD for trunk/src/lib/sound


Ignore:
Timestamp:
Apr 15, 2006, 9:48:08 PM (19 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/lib/sound
Files:
2 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)
Note: See TracChangeset for help on using the changeset viewer.