]> Dogcows Code - chaz/yoink/blob - src/moof/sound.hh
resource loading bugs and new sound class
[chaz/yoink] / src / moof / sound.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
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.
9 *
10 **************************************************************************/
11
12 #ifndef _MOOF_SOUND_HH_
13 #define _MOOF_SOUND_HH_
14
15 /**
16 * \file sound.hh
17 * Load and play sounds, current supports ogg vorbis.
18 */
19
20 #include <string>
21
22 #include <boost/shared_ptr.hpp>
23
24 #include <moof/math.hh>
25
26
27 namespace moof {
28
29
30 class sound
31 {
32 public:
33
34 sound();
35 explicit sound(const std::string& path);
36
37 void sample(const std::string& path);
38 void enqueue(const std::string& path);
39
40 void play();
41 void stream();
42 void stop();
43 void pause();
44 void rewind();
45
46 void toggle();
47 bool is_playing() const;
48
49 void position(const vector3& position);
50 void velocity(const vector3& velocity);
51 void gain(scalar gain);
52 void pitch(scalar pitch);
53 void loop(bool looping);
54
55
56 void listener_position(const vector3& position);
57 void listener_velocity(const vector3& velocity);
58 void listener_orientation(const vector3& forward,
59 const vector3& up);
60
61
62 private:
63
64 class impl;
65 boost::shared_ptr<impl> impl_;
66 };
67
68
69 } // namespace moof
70
71 #endif // _MOOF_SOUND_HH_
72
This page took 0.0359930000000001 seconds and 4 git commands to generate.