Changeset 5968 in orxonox.OLD for branches/network/src/lib/sound/sound_engine.h
- Timestamp:
- Dec 7, 2005, 4:16:51 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/sound/sound_engine.h
r5819 r5968 14 14 15 15 #include <list> 16 #include <stack> 16 17 17 18 #define SOUND_DOPPLER_FACTOR 0.001 //!< A factor for the audible doppler effect … … 22 23 class IniParser; 23 24 25 24 26 //! A class that handles audio via the openAudioLibrary 25 27 class SoundEngine : public BaseObject { 26 27 28 public: 28 29 virtual ~SoundEngine(); … … 47 48 48 49 // administrative 49 void addBuffer(SoundBuffer* buffer); 50 void removeBuffer(SoundBuffer* buffer); 51 void addSource(SoundSource* source); 50 void popALSource(ALuint& source); 51 void pushALSource(ALuint& source) { if (source != 0) this->ALSources.push(source); }; 52 52 53 53 void flushUnusedBuffers(); 54 54 void flushAllBuffers(); 55 55 void flushAllSources(); 56 56 57 bool initAudio(); 58 bool allocateSources(unsigned int count); 57 59 58 60 // error handling: 59 static void PrintALErrorString(ALenum err); 60 // static void PrintALCErrorString(ALenum err); 61 61 static const char* getALErrorString(ALenum err); 62 62 63 63 private: 64 64 SoundEngine(); 65 65 66 void listDevices(); 66 67 67 68 private: 68 static SoundEngine* singletonRef; //!< Reference to this class69 static SoundEngine* singletonRef; //!< Reference to this class 69 70 70 ALCdevice* device; //!< the used audio-device.71 ALCcontext* context; //!< the context, currently in use.71 ALCdevice* device; //!< the used audio-device. 72 ALCcontext* context; //!< the context, currently in use. 72 73 73 float musicVolume; //!< the maximum volume of the music in % (0f,1f]74 float effectsVolume; //!< the maximum volume of sound-effects in % (0f,1f]75 PNode* listener; //!< The listener of the Scene74 float musicVolume; //!< the maximum volume of the music in % (0f,1f] 75 float effectsVolume; //!< the maximum volume of sound-effects in % (0f,1f] 76 PNode* listener; //!< The listener of the Scene 76 77 77 std::list<BaseObject*>* bufferList; //!< A list of buffers78 std::list<BaseObject*>* sourceList; //!< A list for all the sources in the scene.78 const std::list<BaseObject*>* bufferList; //!< A list of buffers 79 const std::list<BaseObject*>* sourceList; //!< A list for all the sources in the scene. 79 80 80 81 unsigned int maxSourceCount; //!< How many Sources is the Maximum 82 std::stack<ALuint> ALSources; //!< A list of real openAL-Sources, the engine allocates, and stores for reuse. 81 83 }; 82 84
Note: See TracChangeset
for help on using the changeset viewer.