]> Dogcows Code - chaz/yoink/blob - src/moof/sound.hh
1f7fcfe788c1e33d5fd44975f4d26e8d98cf8400
[chaz/yoink] / src / moof / sound.hh
1
2 /*] Copyright (c) 2009-2011, Charles McGarvey [*****************************
3 **] All rights reserved.
4 *
5 * Distributable under the terms and conditions of the 2-clause BSD license;
6 * see the file COPYING for a complete text of the license.
7 *
8 *****************************************************************************/
9
10 #ifndef _MOOF_SOUND_HH_
11 #define _MOOF_SOUND_HH_
12
13 /**
14 * \file sound.hh
15 * Load and play sounds, currently supports ogg vorbis.
16 */
17
18 #include <string>
19
20 #include <boost/shared_ptr.hpp>
21
22 #include <moof/math.hh>
23
24
25 namespace moof {
26
27
28 // forward declarations
29 class script;
30
31 class sound
32 {
33 public:
34
35 sound();
36 explicit sound(const std::string& name);
37
38 void sample(const std::string& name);
39 void queue(const std::string& name);
40
41 void play();
42 void stop();
43 void pause();
44
45 void toggle();
46 bool is_playing() const;
47
48 void buffer_size(scalar seconds);
49
50 void position(const vector3& position);
51 void velocity(const vector3& velocity);
52 void gain(scalar gain);
53 void pitch(scalar pitch);
54 void loop(bool looping);
55
56 static void listener_position(const vector3& position);
57 static void listener_velocity(const vector3& velocity);
58 static void listener_orientation(const vector3& forward, const vector3& up);
59
60 static void import(script& script, const std::string& nspace = "");
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.036726 seconds and 3 git commands to generate.