]> Dogcows Code - chaz/yoink/blobdiff - src/moof/sound.hh
remove some unused stlplus modules
[chaz/yoink] / src / moof / sound.hh
index a0dd1033c1a1eb0f7979a62745537e12d8d36d08..1f7fcfe788c1e33d5fd44975f4d26e8d98cf8400 100644 (file)
@@ -1,20 +1,18 @@
 
-/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
+/*]  Copyright (c) 2009-2011, Charles McGarvey  [*****************************
 **]  All rights reserved.
 *
-* vi:ts=4 sw=4 tw=75
-*
 * Distributable under the terms and conditions of the 2-clause BSD license;
 * see the file COPYING for a complete text of the license.
 *
-**************************************************************************/
+*****************************************************************************/
 
 #ifndef _MOOF_SOUND_HH_
 #define _MOOF_SOUND_HH_
 
 /**
  * \file sound.hh
- * Load and play sounds, current supports ogg vorbis.
+ * Load and play sounds, currently supports ogg vorbis.
  */
 
 #include <string>
 #include <boost/shared_ptr.hpp>
 
 #include <moof/math.hh>
-#include <moof/resource.hh>
 
 
 namespace moof {
 
 
-class sound;
-typedef resource_handle<sound> sound_handle;
-class sound_stream;
-typedef resource_handle<sound_stream> sound_stream_handle;
-
+// forward declarations
+class script;
 
-class sound : public resource
+class sound
 {
 public:
 
-       //sound();
-       explicit sound(const std::string& path);
+       sound();
+       explicit sound(const std::string& name);
 
-       virtual ~sound() {}
+       void sample(const std::string& name);
+       void queue(const std::string& name);
 
-       // this implicitly stops the sound if it is playing
-       void sample(const std::string& path);
-
-       virtual void play();
+       void play();
        void stop();
        void pause();
 
        void toggle();
        bool is_playing() const;
 
+       void buffer_size(scalar seconds);
+
        void position(const vector3& position);
        void velocity(const vector3& velocity);
        void gain(scalar gain);
        void pitch(scalar pitch);
        void loop(bool looping);
-
+       
        static void listener_position(const vector3& position);
        static void listener_velocity(const vector3& velocity);
-       static void listener_orientation(const vector3& forward,
-                                                                        const vector3& up);
+       static void listener_orientation(const vector3& forward, const vector3& up);
 
-protected:
+       static void import(script& script, const std::string& nspace = "");
+
+private:
 
        class impl;
        boost::shared_ptr<impl> impl_;
 };
 
 
-class sound_stream : public sound
-{
-public:
-
-       //sound_stream();
-       explicit sound_stream(const std::string& path) :
-               sound(path) {}
-
-       void enqueue(const std::string& path);
-
-       void play();
-};
-
-
 } // namespace moof
 
 #endif // _MOOF_SOUND_HH_
This page took 0.019576 seconds and 4 git commands to generate.