[Orxonox-commit 356] r2966 - in branches/sound/src: . orxonox orxonox/objects orxonox/sound

erwin at orxonox.net erwin at orxonox.net
Mon May 11 14:30:55 CEST 2009


Author: erwin
Date: 2009-05-11 14:30:54 +0200 (Mon, 11 May 2009)
New Revision: 2966

Added:
   branches/sound/src/orxonox/sound/
   branches/sound/src/orxonox/sound/CMakeLists.txt
   branches/sound/src/orxonox/sound/SoundBase.cc
   branches/sound/src/orxonox/sound/SoundBase.h
   branches/sound/src/orxonox/sound/SoundManager.cc
   branches/sound/src/orxonox/sound/SoundManager.h
Removed:
   branches/sound/src/sound/
Modified:
   branches/sound/src/orxonox/CMakeLists.txt
   branches/sound/src/orxonox/objects/Level.cc
   branches/sound/src/orxonox/objects/Level.h
Log:
moved files, modified to support multiple contexts

Modified: branches/sound/src/orxonox/CMakeLists.txt
===================================================================
--- branches/sound/src/orxonox/CMakeLists.txt	2009-05-11 11:42:10 UTC (rev 2965)
+++ branches/sound/src/orxonox/CMakeLists.txt	2009-05-11 12:30:54 UTC (rev 2966)
@@ -30,6 +30,7 @@
 ADD_SUBDIRECTORY(objects)
 ADD_SUBDIRECTORY(overlays)
 ADD_SUBDIRECTORY(tools)
+ADD_SUBDIRECTORY(sound)
 GET_ALL_HEADER_FILES(ORXONOX_HDR_FILES)
 SET(ORXONOX_FILES ${ORXONOX_SRC_FILES} ${ORXONOX_HDR_FILES})
 
@@ -50,6 +51,11 @@
   ${LUA_LIBRARIES}
   ${CEGUILUA_LIBRARY}
   ${Boost_SYSTEM_LIBRARY}
+  ${OPENAL_LIBRARY}
+  ${ALUT_LIBRARY}
+  #${VORBISFILE_LIBRARY}
+  #${VORBIS_LIBRARY}
+  #${OGG_LIBRARY}
   ogreceguirenderer_orxonox
   tinyxml++_orxonox
   tolua++_orxonox
@@ -57,7 +63,6 @@
   util
   core
   network
-  sound
 )
 
 ORXONOX_INSTALL(orxonox)

Modified: branches/sound/src/orxonox/objects/Level.cc
===================================================================
--- branches/sound/src/orxonox/objects/Level.cc	2009-05-11 11:42:10 UTC (rev 2965)
+++ branches/sound/src/orxonox/objects/Level.cc	2009-05-11 12:30:54 UTC (rev 2966)
@@ -56,6 +56,8 @@
 
         if (this->xmlfilename_.length() >= Core::getMediaPathString().length())
             this->xmlfilename_ = this->xmlfilename_.substr(Core::getMediaPathString().length());
+            
+        this->sndmgr_ = new SoundManager();
     }
 
     Level::~Level()
@@ -67,6 +69,11 @@
 
             if (this->xmlfile_)
                 Loader::unload(this->xmlfile_);
+            
+            if(this->ambientsound_ != NULL)
+                delete this->ambientsound_;
+            
+            delete this->sndmgr_;
         }
     }
 
@@ -157,7 +164,7 @@
             if(this->ambientsound_ == NULL)
             {
                 this->ambientsound_ = new SoundBase();
-                this->sndmgr_.addSound(this->ambientsound_);
+                this->sndmgr_->addSound(this->ambientsound_);
             }
 
             this->ambientsound_->loadFile(filename);

Modified: branches/sound/src/orxonox/objects/Level.h
===================================================================
--- branches/sound/src/orxonox/objects/Level.h	2009-05-11 11:42:10 UTC (rev 2965)
+++ branches/sound/src/orxonox/objects/Level.h	2009-05-11 12:30:54 UTC (rev 2966)
@@ -72,7 +72,7 @@
             std::string            xmlfilename_;
             XMLFile*               xmlfile_;
             std::list<BaseObject*> objects_;
-            SoundManager           sndmgr_;
+            SoundManager*          sndmgr_;
             SoundBase*             ambientsound_;
     };
 }

Copied: branches/sound/src/orxonox/sound/CMakeLists.txt (from rev 2963, branches/sound/src/sound/CMakeLists.txt)
===================================================================
--- branches/sound/src/orxonox/sound/CMakeLists.txt	                        (rev 0)
+++ branches/sound/src/orxonox/sound/CMakeLists.txt	2009-05-11 12:30:54 UTC (rev 2966)
@@ -0,0 +1,8 @@
+ADD_SOURCE_FILES(ORXONOX_SRC_FILES
+    SoundManager.h
+    SoundBase.h
+
+    SoundManager.cc
+    SoundBase.cc
+)
+


Property changes on: branches/sound/src/orxonox/sound/CMakeLists.txt
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/sound/CMakeLists.txt:1875-2277,2279-2401
/branches/buildsystem2/src/sound/CMakeLists.txt:2507-2659
/branches/buildsystem3/src/sound/CMakeLists.txt:2663-2709
/branches/ceguilua/src/sound/CMakeLists.txt:1803-1809
/branches/core3/src/sound/CMakeLists.txt:1573-1740
/branches/gcc43/src/sound/CMakeLists.txt:1581
/branches/gui/src/sound/CMakeLists.txt:1636-1724
/branches/input/src/sound/CMakeLists.txt:1630-1637
/branches/lodfinal/src/sound/CMakeLists.txt:2373-2412
/branches/miniprojects/src/sound/CMakeLists.txt:2755-2825
/branches/network/src/sound/CMakeLists.txt:2357
/branches/network64/src/sound/CMakeLists.txt:2211-2356
/branches/objecthierarchy/src/sound/CMakeLists.txt:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/sound/CMakeLists.txt:2172-2480
/branches/overlay/src/sound/CMakeLists.txt:2118-2386
/branches/physics/src/sound/CMakeLists.txt:1913-2056,2108-2440
/branches/physics_merge/src/sound/CMakeLists.txt:2437-2458
/branches/pickups/src/sound/CMakeLists.txt:1927-2087,2128
/branches/pickups2/src/sound/CMakeLists.txt:2108-2498
/branches/presentation/src/sound/CMakeLists.txt:2370-2653,2655-2661
/branches/questsystem/src/sound/CMakeLists.txt:1895-2089
/branches/questsystem2/src/sound/CMakeLists.txt:2108-2260
/branches/script_trigger/src/sound/CMakeLists.txt:1296-1954,1956
/branches/weapon/src/sound/CMakeLists.txt:1926-2095
/branches/weapon2/src/sound/CMakeLists.txt:2108-2489

Copied: branches/sound/src/orxonox/sound/SoundBase.cc (from rev 2963, branches/sound/src/sound/SoundBase.cc)
===================================================================
--- branches/sound/src/orxonox/sound/SoundBase.cc	                        (rev 0)
+++ branches/sound/src/orxonox/sound/SoundBase.cc	2009-05-11 12:30:54 UTC (rev 2966)
@@ -0,0 +1,151 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include "orxonox/objects/worldentities/WorldEntity.h"
+#include "util/Math.h"
+#include "SoundManager.h"
+#include "SoundBase.h"
+
+namespace orxonox 
+{
+    SoundBase::SoundBase()
+    {
+        this->source_ = 0;
+        this->buffer_ = 0;
+        this->entity_ = NULL;
+    }
+
+    SoundBase::SoundBase(WorldEntity* entity)
+    {
+        this->source_ = 0;
+        this->buffer_ = 0;
+        this->entity_ = entity;
+    }
+
+    SoundBase::~SoundBase()
+    {
+        alSourcei(this->source_, AL_BUFFER, 0);
+        alDeleteSources(1, &this->source_);
+        alDeleteBuffers(1, &this->buffer_);
+    }
+
+    void SoundBase::attachToEntity(WorldEntity* entity)
+    {
+        this->entity_ = entity;
+        this->update();
+    }
+
+    void SoundBase::update() {
+        if(this->entity_ != NULL && alIsSource(this->source_)) {
+            Vector3 pos = this->entity_->getPosition();
+            alSource3f(this->source_, AL_POSITION, pos.x, pos.y, pos.z);
+            ALenum error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "OpenAL: Invalid sound position" << std::endl;
+
+            Vector3 vel = this->entity_->getVelocity();
+            alSource3f(this->source_, AL_VELOCITY, vel.x, vel.y, vel.z);
+            error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "OpenAL: Invalid sound position" << std::endl;
+
+            Quaternion orient = this->entity_->getOrientation();
+            Vector3 at = orient.zAxis();
+            alSource3f(this->source_, AL_DIRECTION, at.x, at.y, at.z);
+            error = alGetError();
+            if(error == AL_INVALID_VALUE)
+                COUT(2) << "OpenAL: Invalid sound position" << std::endl;
+        }
+    }
+
+    void SoundBase::play(bool loop) {
+        if(alIsSource(this->source_)) {
+            if(loop)
+                alSourcei(this->source_, AL_LOOPING, AL_TRUE);
+            else
+                alSourcei(this->source_, AL_LOOPING, AL_FALSE);
+            alSourcePlay(this->source_);
+        }
+    }
+
+    void SoundBase::stop() {
+        if(alIsSource(this->source_)) {
+            alSourceStop(this->source_);
+        }
+    }
+
+    void SoundBase::pause() {
+        if(alIsSource(this->source_)) {
+            alSourcePause(this->source_);
+        }
+    }
+
+    bool SoundBase::isPlaying() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_PLAYING;
+        }
+        return false;
+    }
+
+    bool SoundBase::isPaused() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_PAUSED;
+        }
+        return true;
+    }
+
+    bool SoundBase::isStopped() {
+        if(alIsSource(this->source_)) {
+            return getSourceState() == AL_INITIAL || getSourceState() == AL_STOPPED;
+        }
+        return true;
+    }
+
+    bool SoundBase::loadFile(std::string filename) {
+        COUT(3) << "OpenAL ALUT: loading file " << filename << std::endl;
+        this->buffer_ = alutCreateBufferFromFile(filename.c_str());
+        if(this->buffer_ == AL_NONE) {
+            COUT(2) << "OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+            return false;
+        }
+
+        alGenSources(1, &this->source_);
+        alSourcei(this->source_, AL_BUFFER, this->buffer_);
+        if(alGetError() != AL_NO_ERROR) {
+            COUT(2) << "OpenAL: Error loading sample file" << std::endl;
+            return false;
+        }
+        return true;
+    }
+
+    ALint SoundBase::getSourceState() {
+        ALint state;
+        alGetSourcei(this->source_, AL_SOURCE_STATE, &state);
+        return state;
+    }
+} // namespace: orxonox


Property changes on: branches/sound/src/orxonox/sound/SoundBase.cc
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/sound/SoundBase.cc:1875-2277,2279-2401
/branches/buildsystem2/src/sound/SoundBase.cc:2507-2659
/branches/buildsystem3/src/sound/SoundBase.cc:2663-2709
/branches/ceguilua/src/sound/SoundBase.cc:1803-1809
/branches/core3/src/sound/SoundBase.cc:1573-1740
/branches/gcc43/src/sound/SoundBase.cc:1581
/branches/gui/src/sound/SoundBase.cc:1636-1724
/branches/input/src/sound/SoundBase.cc:1630-1637
/branches/lodfinal/src/sound/SoundBase.cc:2373-2412
/branches/miniprojects/src/sound/SoundBase.cc:2755-2825
/branches/network/src/sound/SoundBase.cc:2357
/branches/network64/src/sound/SoundBase.cc:2211-2356
/branches/objecthierarchy/src/sound/SoundBase.cc:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/sound/SoundBase.cc:2172-2480
/branches/overlay/src/sound/SoundBase.cc:2118-2386
/branches/physics/src/sound/SoundBase.cc:1913-2056,2108-2440
/branches/physics_merge/src/sound/SoundBase.cc:2437-2458
/branches/pickups/src/sound/SoundBase.cc:1927-2087,2128
/branches/pickups2/src/sound/SoundBase.cc:2108-2498
/branches/presentation/src/sound/SoundBase.cc:2370-2653,2655-2661
/branches/questsystem/src/sound/SoundBase.cc:1895-2089
/branches/questsystem2/src/sound/SoundBase.cc:2108-2260
/branches/script_trigger/src/sound/SoundBase.cc:1296-1954,1956
/branches/weapon/src/sound/SoundBase.cc:1926-2095
/branches/weapon2/src/sound/SoundBase.cc:2108-2489

Copied: branches/sound/src/orxonox/sound/SoundBase.h (from rev 2963, branches/sound/src/sound/SoundBase.h)
===================================================================
--- branches/sound/src/orxonox/sound/SoundBase.h	                        (rev 0)
+++ branches/sound/src/orxonox/sound/SoundBase.h	2009-05-11 12:30:54 UTC (rev 2966)
@@ -0,0 +1,72 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+#ifndef _SOUNDBASE_H__
+#define _SOUNDBASE_H__
+
+#include <AL/al.h>
+#include <AL/alut.h>
+#include <string>
+
+namespace orxonox
+{
+    class SoundManager;
+    class WorldEntity;
+    /**
+     * The SoudBase class is the base class for all sound file loader classes.
+     * It server as main interface to the OpenAL library.
+     *
+     */
+    class _OrxonoxExport SoundBase
+    {
+    public:
+        SoundBase();
+        SoundBase(WorldEntity* entity);
+        ~SoundBase();
+
+        void attachToEntity(WorldEntity* entity);
+        void update();
+        void play(bool loop = false);
+        void stop();
+        void pause();
+
+        bool isPlaying();
+        bool isPaused();
+        bool isStopped();
+
+        bool loadFile(std::string filename);
+
+    private:
+        ALuint source_;
+        ALuint buffer_;
+        WorldEntity* entity_;
+
+        ALint getSourceState();
+    }; // class SoundBase
+} // namepsace orxonox
+
+#endif // _SOUNDBASE_H__


Property changes on: branches/sound/src/orxonox/sound/SoundBase.h
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/sound/SoundBase.h:1875-2277,2279-2401
/branches/buildsystem2/src/sound/SoundBase.h:2507-2659
/branches/buildsystem3/src/sound/SoundBase.h:2663-2709
/branches/ceguilua/src/sound/SoundBase.h:1803-1809
/branches/core3/src/sound/SoundBase.h:1573-1740
/branches/gcc43/src/sound/SoundBase.h:1581
/branches/gui/src/sound/SoundBase.h:1636-1724
/branches/input/src/sound/SoundBase.h:1630-1637
/branches/lodfinal/src/sound/SoundBase.h:2373-2412
/branches/miniprojects/src/sound/SoundBase.h:2755-2825
/branches/network/src/sound/SoundBase.h:2357
/branches/network64/src/sound/SoundBase.h:2211-2356
/branches/objecthierarchy/src/sound/SoundBase.h:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/sound/SoundBase.h:2172-2480
/branches/overlay/src/sound/SoundBase.h:2118-2386
/branches/physics/src/sound/SoundBase.h:1913-2056,2108-2440
/branches/physics_merge/src/sound/SoundBase.h:2437-2458
/branches/pickups/src/sound/SoundBase.h:1927-2087,2128
/branches/pickups2/src/sound/SoundBase.h:2108-2498
/branches/presentation/src/sound/SoundBase.h:2370-2653,2655-2661
/branches/questsystem/src/sound/SoundBase.h:1895-2089
/branches/questsystem2/src/sound/SoundBase.h:2108-2260
/branches/script_trigger/src/sound/SoundBase.h:1296-1954,1956
/branches/weapon/src/sound/SoundBase.h:1926-2095
/branches/weapon2/src/sound/SoundBase.h:2108-2489

Copied: branches/sound/src/orxonox/sound/SoundManager.cc (from rev 2963, branches/sound/src/sound/SoundManager.cc)
===================================================================
--- branches/sound/src/orxonox/sound/SoundManager.cc	                        (rev 0)
+++ branches/sound/src/orxonox/sound/SoundManager.cc	2009-05-11 12:30:54 UTC (rev 2966)
@@ -0,0 +1,146 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ *
+ */
+
+#include <AL/alut.h>
+
+#include "orxonox/CameraManager.h"
+#include "orxonox/objects/worldentities/Camera.h"
+#include "util/Math.h"
+#include "SoundBase.h"
+#include "SoundManager.h"
+
+namespace orxonox
+{
+    ALCdevice* SoundManager::device_s = NULL;
+
+    /**
+     * Default constructor
+     */
+    SoundManager::SoundManager()
+    {
+        if(!alutInitWithoutContext(NULL,NULL))
+        {
+            COUT(2) << "OpenAL ALUT: " << alutGetErrorString(alutGetError()) << std::endl;
+        }
+        else
+        {
+            COUT(4) << "OpenAL ALUT version:" << alutGetMajorVersion() << "." << alutGetMinorVersion() << std::endl;
+            COUT(4) << "OpenAL ALUT supported MIME types:" << alutGetMIMETypes(ALUT_LOADER_BUFFER) << std::endl;
+            if(SoundManager::device_s == NULL)
+            {
+                COUT(3) << "OpenAL: open sound device..." << std::endl;
+                SoundManager::device_s = alcOpenDevice(NULL);
+            }
+
+            if(SoundManager::device_s == NULL)
+            {
+                COUT(2) << "OpenAL: Could not open sound device" << std::endl;
+            }
+            else
+            {
+                this->context_ = alcCreateContext(SoundManager::device_s, NULL);
+                if(this->context_ == NULL)
+                {
+                    COUT(2) << "OpenAL: Could not create sound context";
+                }
+                else
+                {
+                    alcMakeContextCurrent(this->context_);
+                }
+            }
+        }
+    }
+
+    SoundManager::~SoundManager()
+    {
+        alcDestroyContext(this->context_);
+        alcCloseDevice(SoundManager::device_s);
+        alutExit();
+    }
+
+    /**
+     * Add a SoundBase object to the list. Every SoundBase object should be in
+     * this list.
+     *
+     * @param sound Pointer to the SoundBase object to add
+     */
+    void SoundManager::addSound(SoundBase* sound)
+    {
+        this->soundlist_.push_back(sound);
+    }
+
+    /**
+     * Remove a SoundBase object from the list and destroy it.
+     */
+    void SoundManager::removeSound(SoundBase* sound)
+    {
+        std::list<SoundBase*>::iterator pos = this->soundlist_.end();
+        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
+        {
+            if((*i) == sound)
+                pos = i;
+        }
+
+        delete (*pos);
+        this->soundlist_.erase(pos);
+    }
+
+    /**
+     * Tick function, updates listener and registred SoundBase objects
+     *
+     * @param dt @see Orxonox::Tickable
+     */
+    void SoundManager::tick(float dt)
+    {
+        // update listener position
+        Camera* camera = CameraManager::getInstance().getActiveCamera();
+        if(camera == NULL) return;
+        Vector3 pos = camera->getPosition();
+        alListener3f(AL_POSITION, pos.x, pos.y, pos.z);
+        ALenum error = alGetError();
+        if(error == AL_INVALID_VALUE)
+            COUT(2) << "OpenAL: Invalid listener position" << std::endl;
+
+        // update listener orientation
+        Quaternion orient = camera->getOrientation();
+        Vector3 up = orient.xAxis(); // just a wild guess
+        Vector3 at = orient.zAxis();
+
+        ALfloat orientation[6] = { at.x, at.y, at.z, 
+                                 up.x, up.y, up.z };
+
+        alListenerfv(AL_POSITION, orientation);
+        error = alGetError();
+        if(error == AL_INVALID_VALUE)
+            COUT(2) << "OpenAL: Invalid listener orientation" << std::endl;
+
+        // update sounds
+        for(std::list<SoundBase*>::iterator i = this->soundlist_.begin(); i != this->soundlist_.end(); i++)
+            (*i)->update();
+    }
+}


Property changes on: branches/sound/src/orxonox/sound/SoundManager.cc
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/sound/SoundManager.cc:1875-2277,2279-2401
/branches/buildsystem2/src/sound/SoundManager.cc:2507-2659
/branches/buildsystem3/src/sound/SoundManager.cc:2663-2709
/branches/ceguilua/src/sound/SoundManager.cc:1803-1809
/branches/core3/src/sound/SoundManager.cc:1573-1740
/branches/gcc43/src/sound/SoundManager.cc:1581
/branches/gui/src/sound/SoundManager.cc:1636-1724
/branches/input/src/sound/SoundManager.cc:1630-1637
/branches/lodfinal/src/sound/SoundManager.cc:2373-2412
/branches/miniprojects/src/sound/SoundManager.cc:2755-2825
/branches/network/src/sound/SoundManager.cc:2357
/branches/network64/src/sound/SoundManager.cc:2211-2356
/branches/objecthierarchy/src/sound/SoundManager.cc:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/sound/SoundManager.cc:2172-2480
/branches/overlay/src/sound/SoundManager.cc:2118-2386
/branches/physics/src/sound/SoundManager.cc:1913-2056,2108-2440
/branches/physics_merge/src/sound/SoundManager.cc:2437-2458
/branches/pickups/src/sound/SoundManager.cc:1927-2087,2128
/branches/pickups2/src/sound/SoundManager.cc:2108-2498
/branches/presentation/src/sound/SoundManager.cc:2370-2653,2655-2661
/branches/questsystem/src/sound/SoundManager.cc:1895-2089
/branches/questsystem2/src/sound/SoundManager.cc:2108-2260
/branches/script_trigger/src/sound/SoundManager.cc:1296-1954,1956
/branches/weapon/src/sound/SoundManager.cc:1926-2095
/branches/weapon2/src/sound/SoundManager.cc:2108-2489

Copied: branches/sound/src/orxonox/sound/SoundManager.h (from rev 2963, branches/sound/src/sound/SoundManager.h)
===================================================================
--- branches/sound/src/orxonox/sound/SoundManager.h	                        (rev 0)
+++ branches/sound/src/orxonox/sound/SoundManager.h	2009-05-11 12:30:54 UTC (rev 2966)
@@ -0,0 +1,63 @@
+/*
+ *   ORXONOX - the hottest 3D action shooter ever to exist
+ *                    > www.orxonox.net <
+ *
+ *
+ *   License notice:
+ *
+ *   This program is free software; you can redistribute it and/or
+ *   modify it under the terms of the GNU General Public License
+ *   as published by the Free Software Foundation; either version 2
+ *   of the License, or (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ *
+ *   Author:
+ *       Erwin 'vaiursch' Herrsche
+ *   Co-authors:
+ *      ...
+ */
+#ifndef _SOUNDMANGER_H__
+#define _SOUNDMANGER_H__
+
+#include <AL/al.h>
+#include <AL/alc.h>
+
+#include <orxonox/objects/Tickable.h>
+
+namespace orxonox
+{
+    class SoundBase;
+
+    /**
+     * The SoundManager class manages the OpenAL device, context and listener
+     * position. It has a list of all SoundBase objects and calls their update
+     * function every tick. It is a singleton.
+     *
+     */
+    class _OrxonoxExport SoundManager : public Tickable 
+    {
+    public:
+        SoundManager();
+        ~SoundManager();
+        void addSound(SoundBase* sound);
+        void removeSound(SoundBase* sound);
+
+        virtual void tick(float dt);
+
+    private:
+        static ALCdevice* device_s;
+        ALCcontext* context_;
+        std::list<SoundBase*> soundlist_;
+
+    }; // class SoundManager
+} // namespace orxonox
+
+#endif // _SOUNDMANAGER_H__


Property changes on: branches/sound/src/orxonox/sound/SoundManager.h
___________________________________________________________________
Added: svn:mergeinfo
   + /branches/buildsystem/src/sound/SoundManager.h:1875-2277,2279-2401
/branches/buildsystem2/src/sound/SoundManager.h:2507-2659
/branches/buildsystem3/src/sound/SoundManager.h:2663-2709
/branches/ceguilua/src/sound/SoundManager.h:1803-1809
/branches/core3/src/sound/SoundManager.h:1573-1740
/branches/gcc43/src/sound/SoundManager.h:1581
/branches/gui/src/sound/SoundManager.h:1636-1724
/branches/input/src/sound/SoundManager.h:1630-1637
/branches/lodfinal/src/sound/SoundManager.h:2373-2412
/branches/miniprojects/src/sound/SoundManager.h:2755-2825
/branches/network/src/sound/SoundManager.h:2357
/branches/network64/src/sound/SoundManager.h:2211-2356
/branches/objecthierarchy/src/sound/SoundManager.h:1912-2086,2101,2111-2170
/branches/objecthierarchy2/src/sound/SoundManager.h:2172-2480
/branches/overlay/src/sound/SoundManager.h:2118-2386
/branches/physics/src/sound/SoundManager.h:1913-2056,2108-2440
/branches/physics_merge/src/sound/SoundManager.h:2437-2458
/branches/pickups/src/sound/SoundManager.h:1927-2087,2128
/branches/pickups2/src/sound/SoundManager.h:2108-2498
/branches/presentation/src/sound/SoundManager.h:2370-2653,2655-2661
/branches/questsystem/src/sound/SoundManager.h:1895-2089
/branches/questsystem2/src/sound/SoundManager.h:2108-2260
/branches/script_trigger/src/sound/SoundManager.h:1296-1954,1956
/branches/weapon/src/sound/SoundManager.h:1926-2095
/branches/weapon2/src/sound/SoundManager.h:2108-2489




More information about the Orxonox-commit mailing list