Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7296 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Apr 14, 2006, 1:45:05 PM (19 years ago)
Author:
bensch
Message:

nicer code :)

File:
1 edited

Legend:

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

    r7295 r7296  
    5959bool OggPlayer::open(const std::string& fileName)
    6060{
    61   // release old State
    62   if (state & FileOpened)
    63     release();
     61  // release old Ogg-File
     62  if (this->state & FileOpened)
     63    this->release();
    6464
    6565  // allocating Buffers
     
    8181  else
    8282  {
    83     PRINTF(2)("No more Sources Availiable (maybe you should consider raising the source-count\n");
     83    PRINTF(2)("No more Sources Availiable (maybe you should consider raising the source-count.)\n");
    8484    this->release();
    8585    return false;
     
    119119  alSourcei (source, AL_SOURCE_RELATIVE, AL_TRUE      );
    120120  alSourcef (source, AL_GAIN,            SoundEngine::getInstance()->getMusicVolume());
    121   SoundEngine::checkError("OggPlayer::SetSourceProperties", __LINE__);
     121  SoundEngine::checkError("OggPlayer::open()::SetSourceProperties", __LINE__);
    122122
    123123  return true;
     
    125125
    126126/**
    127  * releases a stream
     127 * @brief releases a stream
    128128 */
    129129void OggPlayer::release()
     
    175175  this->state |= Playing;
    176176
    177   if(!stream(buffers[0]) || !stream(buffers[1]))
     177  if(!this->stream(this->buffers[0]) || !this->stream(this->buffers[1]))
    178178    return false;
    179179
     
    181181  if (DEBUG >= 3)
    182182    SoundEngine::checkError("OggPlayer::playback()::alSourceQueueBuffers", __LINE__);
     183  if (!alIsBuffer(this->buffers[0])) printf("AHA0\n");
     184  if (!alIsBuffer(this->buffers[1])) printf("AHA1\n");
     185
     186  if (!alIsSource(this->source)) printf("AHA2\n");
     187  SoundEngine::checkError("SKJFLKSDJF",__LINE__);
     188
    183189  alSourcePlay(this->source);
    184190  if (DEBUG >= 3)
     
    268274  alBufferData(buffer, format, pcm, size, vorbisInfo->rate);
    269275  if (DEBUG >= 3)
    270     SoundEngine::checkError("OggPlayer::playback()::BUFFER", __LINE__);
     276    SoundEngine::checkError("OggPlayer::stream()::BUFFER", __LINE__);
    271277
    272278  return true;
Note: See TracChangeset for help on using the changeset viewer.