17 #ifndef _GAZEBO_UTIL_OPENAL_HH_ 18 #define _GAZEBO_UTIL_OPENAL_HH_ 25 #include <ignition/math/Vector3.hh> 26 #include <ignition/math/Pose3.hh> 32 #include "gazebo/gazebo_config.h" 45 class OpenALSourcePrivate;
52 class GZ_UTIL_VISIBLE OpenAL :
public SingletonT<OpenAL>
58 private:
virtual ~OpenAL();
62 public:
bool Load(sdf::ElementPtr _sdf = sdf::ElementPtr());
80 public: std::set<std::string> DeviceList()
const;
84 private: std::unique_ptr<OpenALPrivate> dataPtr;
92 class GZ_UTIL_VISIBLE OpenALSink
98 public:
virtual ~OpenALSink();
103 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
108 public:
bool SetVelocity(
const ignition::math::Vector3d &_vel);
113 class GZ_UTIL_VISIBLE OpenALSource
116 public: OpenALSource();
119 public:
virtual ~OpenALSource();
124 public:
bool Load(sdf::ElementPtr _sdf);
129 public:
bool SetPose(
const ignition::math::Pose3d &_pose);
134 public:
bool SetVelocity(
const ignition::math::Vector3d &_vel);
139 public:
bool SetPitch(
float _p);
144 public:
bool SetGain(
float _g);
149 public:
bool SetLoop(
bool _state);
157 public:
bool GetOnContact() const GAZEBO_DEPRECATED(7.0);
164 public:
bool OnContact() const;
170 public:
std::vector<
std::
string> GetCollisionNames() const
171 GAZEBO_DEPRECATED(7.0);
176 public:
std::vector<
std::
string> CollisionNames() const;
181 public:
bool HasCollisionName(const
std::
string &_name) const;
187 public:
void Pause();
193 public:
void Rewind();
196 public:
bool IsPlaying();
203 public:
bool FillBufferFromPCM(uint8_t *_pcmData,
unsigned int _dataCount,
208 public:
void FillBufferFromFile(const
std::
string &_audioFile);
212 private:
std::unique_ptr<OpenALSourcePrivate> dataPtr;
Forward declarations for the common classes.
Definition: Animation.hh:33
Singleton template class.
Definition: SingletonT.hh:33
std::shared_ptr< OpenALSource > OpenALSourcePtr
Definition: UtilTypes.hh:48
std::shared_ptr< OpenALSink > OpenALSinkPtr
Definition: UtilTypes.hh:44