Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 11, 2009, 5:55:26 PM (15 years ago)
Author:
youngk
Message:

Made a big change to the sound system: Implemented cross-fading for multiple changing sources.
Compiles, however the game doesn't load sounds properly in the main menu and on entering a level.
It can load a sound via DistanceTrigger and fades in/out correctly, but second loading fails.

Please test.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/sound3/src/orxonox/sound/SoundManager.h

    r6031 r6046  
    4242     *
    4343     */
    44     class _OrxonoxExport SoundManager : public Singleton<SoundManager>
     44    class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public OrxonoxClass
    4545    {
    4646        friend class Singleton<SoundManager>;
     
    4949        ~SoundManager();
    5050
     51        void update(const Clock &time);
     52        void setConfigValues(void);
     53
    5154        void setListenerPosition(const Vector3& position);
    5255        void setListenerOrientation(const Quaternion& orientation);
    53         void registerAmbientSound(BaseSound* newAmbient);
    54         void unregisterAmbientSound(BaseSound* currentAmbient);
     56
     57        void registerAmbientSound(AmbientSound* newAmbient);
     58        void unregisterAmbientSound(AmbientSound* currentAmbient);
    5559        const std::string& getAmbientPath(const std::string& source);
     60        void fadeInAmbientSound(float dt);
     61        void fadeOutAmbientSound(float dt);
     62        void checkFadeStepValidity(void);
    5663
    5764    private:
    5865        ALCdevice* device_;
    5966        ALCcontext* context_;
    60         std::list<BaseSound*> ambientSounds_;
    61         std::string lastReqPath;
     67       
     68        std::list<AmbientSound*> ambientSounds_;
     69       
     70        float fadeStep_;       //per second
     71        std::list<std::pair<AmbientSound*, float> > fadeInList_;
     72        std::list<std::pair<AmbientSound*, float> > fadeOutList_;
     73       
     74        std::string lastReqPath_;
    6275
    6376        static SoundManager* singletonPtr_s;
Note: See TracChangeset for help on using the changeset viewer.