#ifndef __SOUND_MANAGER_H__
#define __SOUND_MANAGER_H__
-#include "math/vector.hpp"
#include <string>
#include <vector>
#include <map>
#include <AL/alc.h>
#include <AL/al.h>
+#include "math/vector.hpp"
typedef void* SoundHandle;
*/
void play(const std::string& name, const Vector& pos = Vector(-1, -1));
- void set_listener_position(Vector position);
- void set_listener_velocity(Vector velocity);
+ void set_listener_position(const Vector& position);
+ void set_listener_velocity(const Vector& velocity);
void enable_music(bool music_enabled);
- void play_music(const std::string& filename);
+ void play_music(const std::string& filename, bool fade = false);
+ void stop_music(float fadetime = 0);
+
+ bool is_sound_enabled() { return sound_enabled; }
void update();
friend class SoundSource;
friend class StreamSoundSource;
- static ALuint load_file_into_buffer(const std::string& filename);
+ static ALuint load_file_into_buffer(SoundFile* file);
static ALenum get_sample_format(SoundFile* file);
void print_openal_version();
std::string current_music;
};
+extern SoundManager* sound_manager;
+
#endif