]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sound.hh
more featureful sound class
[chaz/yoink] / src / Moof / Sound.hh
index bc669bcd5df6dcf629ab26a97b564b23e6151b3a..32f4c87097fed36cf82c651c0a32dad75ad2082d 100644 (file)
@@ -34,8 +34,6 @@
  * Image-loading and OpenGL texture loading.
  */
 
-#include <stdexcept>
-
 #include <boost/shared_ptr.hpp>
 
 #include <Moof/Exception.hh>
 namespace Mf {
 
 
+class Sound;
+typedef boost::shared_ptr<Sound> SoundP;
+
+
 class Sound : public Resource
 {
+       class Impl;
+       boost::shared_ptr<Impl> impl_;
+
 public:
-       Sound(const std::string& name);
+
+       inline static SoundP alloc(const std::string& name)
+       {
+               return SoundP(new Sound(name));
+       }
+
+       explicit Sound(const std::string& name);
+
 
        void play();
+
+       void stream();
+       void update(Scalar t, Scalar dt);
+
+       void stop();
        void pause();
-       void togglePlayPause();
+       void resume();
+       void toggle();
+
+       void setSample(const std::string& name);
+       void enqueue(const std::string& name);
 
+       bool isPlaying() const;
+
+       void setPosition(Vector3 position);
+       void setVelocity(Vector3 velocity);
        void setGain(Scalar gain);
+       void setPitch(Scalar pitch);
+       void setLooping(bool looping);
 
        static std::string getPath(const std::string& name);
 
+
        struct Exception : public Mf::Exception
        {
                enum
@@ -84,22 +112,6 @@ public:
                        return Mf::Exception::what();
                }
        };
-
-protected:
-       Sound() {}
-       class Impl;
-       boost::shared_ptr<Impl> impl_;
-};
-
-
-class SoundStream : public Sound
-{
-public:
-       SoundStream(const std::string& name);
-
-       void update(Scalar t, Scalar dt);
-
-       static std::string getPath(const std::string& name);
 };
 
 
This page took 0.017568 seconds and 4 git commands to generate.