]> git.tdb.fi Git - libs/al.git/blobdiff - source/listener.h
Make Listener a singleton instead of all-static
[libs/al.git] / source / listener.h
index 0fe3d818b8e4f2f23644d4d9027e87e7db849264..98e16388236c01e3e5a43138e465b8e0fe150b94 100644 (file)
@@ -1,10 +1,3 @@
-/* $Id$
-
-This file is part of libmspal
-Copyright © 2008 Mikko Rasa, Mikkosoft Productions
-Distributed under the LGPL
-*/
-
 #ifndef MSP_AL_LIStENER_H_
 #define MSP_AL_LISTENER_H_
 
@@ -14,19 +7,20 @@ namespace Msp {
 namespace AL {
 
 /**
-Represents the listener in the 3D environment.  There is only one listener in
-OpenAL - this class is not instantiable and all of its functions are static.
+Represents the listener in the 3D environment.  This class is a singleton.
 */
 class Listener
 {
 private:
-       Listener();
+       Listener() { }
 public:
-       static void attribute(ALenum, float);
-       static void attribute(ALenum, float, float, float);
-       static void attribute(ALenum, const float *);
-       static void set_position(float, float, float);
-       static void set_gain(float);
+       static Listener &instance();
+
+       void attribute(ALenum, float);
+       void attribute(ALenum, float, float, float);
+       void attribute(ALenum, const float *);
+       void set_position(float, float, float);
+       void set_gain(float);
 };
 
 } // namespace AL