Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 25, 2009, 1:53:13 PM (16 years ago)
Author:
erwin
Message:

added mainmenu ambient sound

Location:
code/branches/sound2/src/orxonox/sound
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound2/src/orxonox/sound/CMakeLists.txt

    r3013 r3055  
    22    SoundManager.h
    33    SoundBase.h
     4    SoundMainMenu.h
    45
    56    SoundManager.cc
    67    SoundBase.cc
     8    SoundMainMenu.cc
    79)
    810
  • code/branches/sound2/src/orxonox/sound/SoundBase.cc

    r3013 r3055  
    148148            if(filename.find("ogg", 0) != std::string::npos)
    149149            {
     150                COUT(2) << "Sound: Trying fallback ogg loader" << std::endl;
    150151                this->buffer_ = loadOggFile(filename);
    151152            }
    152153
    153             if(this->buffer_ == AL_NONE)
     154            if(this->buffer_ == AL_NONE)
     155            {
     156                COUT(2) << "Sound: fallback ogg loader failed: " << alutGetErrorString(alutGetError()) << std::endl;
    154157                return false;
     158            }
    155159        }
    156160
     
    158162        alSourcei(this->source_, AL_BUFFER, this->buffer_);
    159163        if(alGetError() != AL_NO_ERROR) {
    160             COUT(2) << "Sound: OpenAL: Error loading sample file" << std::endl;
     164            COUT(2) << "Sound: OpenAL: Error loading sample file: " << filename << std::endl;
    161165            return false;
    162166        }
     
    172176    ALuint SoundBase::loadOggFile(std::string filename)
    173177    {
    174         COUT(2) << "Sound: Trying fallback ogg loader";
    175 
    176178        char inbuffer[4096];
    177179        std::vector<char> outbuffer;
     
    207209            }
    208210        }
    209        
     211
    210212        ov_clear(&vf);
    211213
  • code/branches/sound2/src/orxonox/sound/SoundBase.h

    r3013 r3055  
    3232#include <string>
    3333
     34#include "OrxonoxPrereqs.h"
     35
    3436namespace orxonox
    3537{
    36     class SoundManager;
    37     class WorldEntity;
    38 
    3938    /**
    4039     * The SoudBase class is the base class for all sound file loader classes.
  • code/branches/sound2/src/orxonox/sound/SoundManager.cc

    r3013 r3055  
    5252        else
    5353        {
    54             COUT(4) << "Sound: OpenAL ALUT version:" << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl;
    55             COUT(4) << "Sound: OpenAL ALUT supported MIME types:" << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl;
     54            COUT(4) << "Sound: OpenAL ALUT version: " << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl;
     55            COUT(4) << "Sound: OpenAL ALUT supported MIME types: " << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl;
    5656            if(SoundManager::device_s == NULL)
    5757            {
     
    7777                {
    7878                    if(alcMakeContextCurrent(this->context_) == AL_TRUE)
    79                         COUT(3) << "Sound: OpenAL: Context " << this->context_ << "loaded" << std::endl;
     79                        COUT(3) << "Sound: OpenAL: Context " << this->context_ << " loaded" << std::endl;
    8080                }
    8181            }
     
    124124    void SoundManager::tick(float dt)
    125125    {
     126        if (!CameraManager::getInstancePtr())
     127            return;
     128
    126129        // update listener position
    127130        Camera* camera = CameraManager::getInstance().getActiveCamera();
  • code/branches/sound2/src/orxonox/sound/SoundManager.h

    r3013 r3055  
    3131#include <AL/alc.h>
    3232
    33 #include <orxonox/objects/Tickable.h>
     33#include "OrxonoxPrereqs.h"
     34#include "orxonox/objects/Tickable.h"
    3435
    3536namespace orxonox
    3637{
    37     class SoundBase;
    38 
    3938    /**
    4039     * The SoundManager class manages the OpenAL device, context and listener
Note: See TracChangeset for help on using the changeset viewer.