X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fyoink;a=blobdiff_plain;f=src%2Fmoof%2Fsound.hh;h=a3c94f1009bbe698bf7cd9d5fa716a8ac9d5a92c;hp=5a60f0c1ecafffb143db1e9fef53f5704adc03b4;hb=1da520638918096276158ecdfaeebc14a3d70be7;hpb=831f04d4bc19a390415ac0bbac4331c7a65509bc diff --git a/src/moof/sound.hh b/src/moof/sound.hh index 5a60f0c..a3c94f1 100644 --- a/src/moof/sound.hh +++ b/src/moof/sound.hh @@ -22,39 +22,26 @@ #include #include -#include namespace moof { -class sound; -typedef boost::shared_ptr sound_ptr; - -class sound_stream; -typedef boost::shared_ptr sound_stream_ptr; - - -class sound : public resource +class sound { public: - static sound_ptr alloc(const std::string& name) - { - return sound_ptr(new sound(name)); - } - sound(); - explicit sound(const std::string& name); + explicit sound(const std::string& path); - virtual ~sound() {} + void sample(const std::string& path); + void enqueue(const std::string& path); - // this implicitly stops the sound if it is playing - void sample(const std::string& name); - - virtual void play(); + void play(); + void stream(); void stop(); void pause(); + void rewind(); void toggle(); bool is_playing() const; @@ -64,40 +51,21 @@ public: 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); + void listener_position(const vector3& position); + void listener_velocity(const vector3& velocity); + void listener_orientation(const vector3& forward, + const vector3& up); - static bool find_path(std::string& name); -protected: +private: class impl; boost::shared_ptr impl_; }; -class sound_stream : public sound -{ -public: - - static sound_stream_ptr alloc(const std::string& name) - { - return sound_stream_ptr(new sound_stream(name)); - } - - sound_stream(); - explicit sound_stream(const std::string& name) : - sound(name) {} - - void enqueue(const std::string& name); - - void play(); -}; - - } // namespace moof #endif // _MOOF_SOUND_HH_