first very unfinished and unpolished version of the intro
[supertux.git] / src / audio / sound_manager.hpp
index f385f49..a1b59d6 100644 (file)
@@ -1,13 +1,13 @@
 #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;
 
@@ -35,11 +35,14 @@ public:
    */
   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();
 
@@ -47,7 +50,7 @@ private:
   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();
@@ -69,5 +72,7 @@ private:
   std::string current_music;
 };
 
+extern SoundManager* sound_manager;
+
 #endif