]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sound.hh
more featureful sound class
[chaz/yoink] / src / Moof / Sound.hh
index 3f64162f0ca4b2a690f3b7be7005095ee00a3f7c..32f4c87097fed36cf82c651c0a32dad75ad2082d 100644 (file)
@@ -34,8 +34,6 @@
  * Image-loading and OpenGL texture loading.
  */
 
-#include <stdexcept>
-
 #include <boost/shared_ptr.hpp>
 
 #include <Moof/Exception.hh>
@@ -52,25 +50,39 @@ typedef boost::shared_ptr<Sound> SoundP;
 
 class Sound : public Resource
 {
-protected:
-       Sound() {}
        class Impl;
        boost::shared_ptr<Impl> impl_;
 
 public:
 
-       static SoundP alloc(const std::string& name)
+       inline static SoundP alloc(const std::string& name)
        {
                return SoundP(new Sound(name));
        }
 
-       Sound(const std::string& 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);
 
@@ -103,17 +115,6 @@ public:
 };
 
 
-class SoundStream : public Sound
-{
-public:
-       SoundStream(const std::string& name);
-
-       void update(Scalar t, Scalar dt);
-
-       static std::string getPath(const std::string& name);
-};
-
-
 } // namespace Mf
 
 #endif // _MOOF_SOUND_HH_
This page took 0.018866 seconds and 4 git commands to generate.