]>
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
> SoundP
;
35 typedef boost::shared_ptr
<SoundStream
> SoundStreamP
;
38 class Sound
: public Resource
42 static SoundP
alloc(const std::string
& name
)
44 return SoundP(new Sound(name
));
48 explicit Sound(const std::string
& name
);
52 // this implicitly stops the sound if it is playing
53 void setSample(const std::string
& name
);
60 bool isPlaying() const;
62 void setPosition(const Vector3
& position
);
63 void setVelocity(const Vector3
& velocity
);
64 void setGain(Scalar gain
);
65 void setPitch(Scalar pitch
);
66 void setLooping(bool looping
);
68 static void setListenerPosition(const Vector3
& position
);
69 static void setListenerVelocity(const Vector3
& velocity
);
70 static void setListenerOrientation(const Vector3
& forward
,
73 static std::string
getPath(const std::string
& name
);
78 boost::shared_ptr
<Impl
> mImpl
;
82 class SoundStream
: public Sound
86 static SoundStreamP
alloc(const std::string
& name
)
88 return SoundStreamP(new SoundStream(name
));
92 explicit SoundStream(const std::string
& name
) :
95 void enqueue(const std::string
& name
);
103 #endif // _MOOF_SOUND_HH_
This page took 0.036621 seconds and 4 git commands to generate.