]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Sound.hh
ray-scene intersection
[chaz/yoink] / src / Moof / Sound.hh
index 982e9b4065eeca659601fd9015846407a2936fab..6e5f78a23fc4311e736000aecd922f534a003a3a 100644 (file)
@@ -47,6 +47,9 @@ namespace Mf {
 class Sound;
 typedef boost::shared_ptr<Sound> SoundP;
 
+class SoundStream;
+typedef boost::shared_ptr<SoundStream> SoundStreamP;
+
 
 class Sound : public Resource
 {
@@ -60,20 +63,16 @@ public:
        Sound();
        explicit Sound(const std::string& name);
 
+       virtual ~Sound() {}
 
-       void play();
-       void stream();
-
-       // TODO this API sucks...  refactor me!!
+       // this implicitly stops the sound if it is playing
+       void setSample(const std::string& name);
 
+       virtual void play();
        void stop();
        void pause();
-       void resume();
-       void toggle();
-
-       void setSample(const std::string& name);
-       void enqueue(const std::string& name);
 
+       void toggle();
        bool isPlaying() const;
 
        void setPosition(const Vector3& position);
@@ -89,13 +88,32 @@ public:
 
        static std::string getPath(const std::string& name);
 
-private:
+protected:
 
        class Impl;
        boost::shared_ptr<Impl> mImpl;
 };
 
 
+class SoundStream : public Sound
+{
+public:
+
+       static SoundStreamP alloc(const std::string& name)
+       {
+               return SoundStreamP(new SoundStream(name));
+       }
+
+       SoundStream();
+       explicit SoundStream(const std::string& name) :
+               Sound(name) {}
+
+       void enqueue(const std::string& name);
+
+       void play();
+};
+
+
 } // namespace Mf
 
 #endif // _MOOF_SOUND_HH_
This page took 0.021165 seconds and 4 git commands to generate.