class sound;
-typedef boost::shared_ptr<sound> sound_ptr;
-
+typedef resource_handle<sound> sound_handle;
class sound_stream;
-typedef boost::shared_ptr<sound_stream> sound_stream_ptr;
+typedef resource_handle<sound_stream> sound_stream_handle;
class sound : public resource
{
public:
- static sound_ptr alloc(const std::string& name)
- {
- return sound_ptr(new sound(name));
- }
-
- sound();
- explicit sound(const std::string& name);
+ //sound();
+ explicit sound(const std::string& path);
virtual ~sound() {}
// this implicitly stops the sound if it is playing
- void sample(const std::string& name);
+ void sample(const std::string& path);
virtual void play();
void stop();
static void listener_orientation(const vector3& forward,
const vector3& up);
- static bool find_path(std::string& name);
-
protected:
class impl;
{
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) {}
+ //sound_stream();
+ explicit sound_stream(const std::string& path) :
+ sound(path) {}
- void enqueue(const std::string& name);
+ void enqueue(const std::string& path);
void play();
};