]> Dogcows Code - chaz/yoink/blob - src/moof/sound.hh
testing improved runloop scheduling
[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 script;
31
32
33 class sound
34 {
35 public:
36
37 sound();
38 explicit sound(const std::string& name);
39
40 void sample(const std::string& name);
41 void queue(const std::string& name);
42
43 void play();
44 void stop();
45 void pause();
46
47 void toggle();
48 bool is_playing() const;
49
50 void buffer_size(scalar seconds);
51
52 void position(const vector3& position);
53 void velocity(const vector3& velocity);
54 void gain(scalar gain);
55 void pitch(scalar pitch);
56 void loop(bool looping);
57
58
59 static void listener_position(const vector3& position);
60 static void listener_velocity(const vector3& velocity);
61 static void listener_orientation(const vector3& forward,
62 const vector3& up);
63
64 static void import(script& script, const std::string& nspace = "");
65
66 private:
67
68 class impl;
69 boost::shared_ptr<impl> impl_;
70 };
71
72
73 } // namespace moof
74
75 #endif // _MOOF_SOUND_HH_
76
This page took 0.032619 seconds and 4 git commands to generate.