]> git.mxchange.org Git - simgear.git/blobdiff - simgear/sound/sample_openal.hxx
Compile under MSVC 9
[simgear.git] / simgear / sound / sample_openal.hxx
index 9e816c21aaf9aed5316003e9f590135829258a3c..a231f6633a6dc3afe91c9a08f6a393026e031d4c 100644 (file)
@@ -85,7 +85,7 @@ public:
     virtual ~SGSoundSample ();
 
     /**
-     * Detect wheter this audio sample holds the information of a sound file.
+     * Detect whether this audio sample holds the information of a sound file.
      * @return Return true if this audio sample is to be constructed from a file.
      */
     inline bool is_file() const { return _is_file; }
@@ -103,7 +103,7 @@ public:
     }
 
     /**
-     * Test if static dataa of audio sample configuration has changed.
+     * Test if static data of audio sample configuration has changed.
      * Calling this function will reset the flag so calling it a second
      * time in a row will return false.
      * @return Return true is the static data has changed in the mean time.
@@ -152,6 +152,22 @@ public:
      */
     inline bool is_playing() { return _playing; }
 
+
+    /**
+     * Set this sample to out-of-range (or not) and
+     * Schedule this audio sample to stop (or start) playing.
+     */
+    inline void set_out_of_range(bool oor = true) {
+        _out_of_range = oor; _playing = (!oor && _loop); _changed = true;
+    }
+
+    /**
+     * Test if this sample to out-of-range or not.
+     */
+    inline bool test_out_of_range() {
+        return _out_of_range;
+    }
+
     /**
      * Set the data associated with this audio sample
      * @param data Pointer to a memory block containg this audio sample data.
@@ -495,6 +511,7 @@ private:
     bool _playing;
     bool _changed;
     bool _static_changed;
+    bool _out_of_range;
     bool _is_file;
 
     string random_string();