+ inline float get_volume() { return _volume * _master_volume; }
+
+ /**
+ * Set the OpenAL format of this audio sample.
+ * @param format OpenAL format-id
+ */
+ inline void set_format( int format ) { _format = format; }
+
+ /**
+ * Returns the format of this audio sample.
+ * @return OpenAL format-id
+ */
+ inline int get_format() { return _format; }
+
+ /**
+ * Set the frequency (in Herz) of this audio sample.
+ * @param freq Frequency
+ */
+ inline void set_frequency( int freq ) { _freq = freq; }
+
+ /**
+ * Returns the frequency (in Herz) of this audio sample.
+ * @return Frequency
+ */
+ inline int get_frequency() { return _freq; }
+
+ /**
+ * Sets the size (in bytes) of this audio sample.
+ * @param size Data size
+ */
+ inline void set_size( size_t size ) { _size = size; }
+
+ /**
+ * Returns the size (in bytes) of this audio sample.
+ * @return Data size
+ */
+ inline size_t get_size() const { return _size; }
+
+ /**
+ * Set the position of this sound relative to the base position.
+ * This is in the same coordinate system as OpenGL; y=up, z=back, x=right.
+ * @param pos Relative position of this sound
+ */
+ inline void set_relative_position( const SGVec3f& pos ) {
+ _relative_pos = toVec3d(pos); _changed = true;
+ }
+
+ /**
+ * Set the base position in Cartesian coordinates
+ * @param pos position in Cartesian coordinates
+ */
+ inline void set_position( const SGVec3d& pos ) {
+ _base_pos = pos; _changed = true;
+ }
+
+ /**
+ * Get the absolute position of this sound.
+ * This is in the same coordinate system as OpenGL; y=up, z=back, x=right.
+ * @return Absolute position
+ */
+ SGVec3d& get_position() { return _absolute_pos; }
+
+ /**
+ * Set the orientation of this sound.
+ * @param ori Quaternation containing the orientation information
+ */
+ inline void set_orientation( const SGQuatd& ori ) {
+ _orientation = ori; _changed = true;
+ }
+
+ inline void set_rotation( const SGQuatd& ec2body ) {
+ _rotation = ec2body; _changed = true;
+ }
+
+ /**
+ * Set direction of this sound relative to the orientation.
+ * This is in the same coordinate system as OpenGL; y=up, z=back, x=right
+ * @param dir Sound emission direction
+ */
+ inline void set_direction( const SGVec3f& dir ) {
+ _direction = toVec3d(dir); _static_changed = true;
+ }
+
+ /**
+ * Define the audio cone parameters for directional audio.
+ * Note: setting it to 2 degree will result in 1 degree to both sides.
+ * @param inner Inner cone angle (0 - 360 degrees)
+ * @param outer Outer cone angle (0 - 360 degrees)
+ * @param gain Remaining gain at the edge of the outer cone (0.0 - 1.0)
+ */
+ void set_audio_cone( float inner, float outer, float gain ) {
+ _inner_angle = inner; _outer_angle = outer; _outer_gain = gain;
+ _static_changed = true;
+ }
+
+ /**
+ * Get the orientation vector of this sound.
+ * This is in the same coordinate system as OpenGL; y=up, z=back, x=right
+ * @return Orientaton vector
+ */
+ SGVec3f& get_orientation() { return _orivec; }
+
+ /**
+ * Get the inner angle of the audio cone.
+ * @return Inner angle in degrees
+ */
+ float get_innerangle() { return _inner_angle; }
+
+ /**
+ * Get the outer angle of the audio cone.
+ * @return Outer angle in degrees
+ */
+ float get_outerangle() { return _outer_angle; }
+
+ /**
+ * Get the remaining gain at the edge of the outer cone.
+ * @return Gain
+ */
+ float get_outergain() { return _outer_gain; }
+
+ /**
+ * Set the velocity vector (in meters per second) of this sound.
+ * This is in the local frame coordinate system; x=north, y=east, z=down
+ * @param Velocity vector
+ */
+ inline void set_velocity( const SGVec3f& vel ) {
+ _velocity = vel; _changed = true;