]>
Dogcows Code - chaz/yoink/blob - src/moof/sound.hh
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
10 **************************************************************************/
12 #ifndef _MOOF_SOUND_HH_
13 #define _MOOF_SOUND_HH_
17 * Load and play sounds, current supports ogg vorbis.
22 #include <boost/shared_ptr.hpp>
24 #include <moof/math.hh>
25 #include <moof/resource.hh>
32 typedef boost::shared_ptr
<sound
> sound_ptr
;
35 typedef boost::shared_ptr
<sound_stream
> sound_stream_ptr
;
38 class sound
: public resource
42 static sound_ptr
alloc(const std::string
& name
)
44 return sound_ptr(new sound(name
));
48 explicit sound(const std::string
& name
);
52 // this implicitly stops the sound if it is playing
53 void sample(const std::string
& name
);
60 bool is_playing() const;
62 void position(const vector3
& position
);
63 void velocity(const vector3
& velocity
);
64 void gain(scalar gain
);
65 void pitch(scalar pitch
);
66 void loop(bool looping
);
68 static void listener_position(const vector3
& position
);
69 static void listener_velocity(const vector3
& velocity
);
70 static void listener_orientation(const vector3
& forward
,
73 static bool find_path(std::string
& name
);
78 boost::shared_ptr
<impl
> impl_
;
82 class sound_stream
: public sound
86 static sound_stream_ptr
alloc(const std::string
& name
)
88 return sound_stream_ptr(new sound_stream(name
));
92 explicit sound_stream(const std::string
& name
) :
95 void enqueue(const std::string
& name
);
103 #endif // _MOOF_SOUND_HH_
This page took 0.038288 seconds and 4 git commands to generate.