Fix music not properly fading in again
[supertux.git] / src / object / ambient_sound.hpp
index 0b7273b..d58727e 100644 (file)
@@ -47,9 +47,9 @@
 class Player;
 class SoundSource;
 
-class AmbientSound : public GameObject, 
-                     public ScriptInterface, 
-                     public Scripting::AmbientSound
+class AmbientSound : public GameObject,
+                     public ScriptInterface,
+                     public scripting::AmbientSound
 {
 public:
   AmbientSound(const Reader& lisp);
@@ -84,13 +84,13 @@ protected:
   virtual void stop_playing();
   virtual void expose(HSQUIRRELVM vm, SQInteger table_idx);
   virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx);
+
 private:
-  std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */
   Vector position;
   Vector dimension;
 
   std::string sample;
-  SoundSource* sound_source;
+  std::unique_ptr<SoundSource> sound_source;
   int latency;
 
   float distance_factor;  /// distance scaling
@@ -102,6 +102,10 @@ private:
   float currentvolume; /// how loud we are
 
   float * volume_ptr; /// this will be used by the volume adjustment effect.
+
+private:
+  AmbientSound(const AmbientSound&);
+  AmbientSound& operator=(const AmbientSound&);
 };
 
 #endif