Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 24, 2006, 3:35:07 PM (18 years ago)
Author:
amaechler
Message:

branches/atmospheric_engine: rainsound fade working and comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/sound/sound_source.cc

    r8495 r8771  
    164164
    165165  /**
    166   * @brief Plays back buffer on this Source with gain
    167   * @param buffer the buffer to play back on this Source
     166   * @brief Plays back buffer on this Source with gain
     167   * @param buffer the buffer to play back on this Source
     168   * @param gain the gain of the sound buffer
    168169  */
    169170  void SoundSource::play(const SoundBuffer* buffer, float gain)
     
    189190      SoundEngine::checkError("Play Source", __LINE__);
    190191  }
    191  
    192    /**
     192
     193  /**
    193194   * @brief Plays back buffer on this Source with gain and looping possibility
    194195   * @param buffer the buffer to play back on this Source
    195     */
     196   *  @param gain the gain of the sound buffer
     197   * @param loop if true, sound gets looped
     198   */
    196199  void SoundSource::play(const SoundBuffer* buffer, float gain, bool loop)
    197200  {
     
    204207    alSourceStop(this->sourceID);
    205208    alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
    206    
     209
    207210    if (loop)
    208         alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
     211      alSourcei (this->sourceID, AL_LOOPING,  AL_TRUE);
    209212    else
    210         alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
    211    
     213      alSourcei (this->sourceID, AL_LOOPING,  AL_FALSE);
     214
    212215    alSourcef (this->sourceID, AL_GAIN, gain);
    213216
     
    220223    if (DEBUG_LEVEL >= 3)
    221224      SoundEngine::checkError("Play Source", __LINE__);
    222   }
    223 
    224 
    225   /**
    226   * @brief Stops playback of a SoundSource
    227   */
     225  }
     226
     227  /**
     228   * @brief Changes the volume of an (active) buffer
     229   * @param buffer the buffer to play back on this Source
     230   * @param gain the new gain value
     231   */
     232  void SoundSource::gain(const SoundBuffer* buffer, float gain)
     233  {
     234    // alSourcei (this->sourceID, AL_BUFFER, buffer->getID());
     235    alSourcef (this->sourceID, AL_GAIN, gain);
     236  }
     237
     238  /**
     239   * @brief Stops playback of a SoundSource
     240   */
    228241  void SoundSource::stop()
    229242  {
Note: See TracChangeset for help on using the changeset viewer.