+ inline void set_pitch( float p ) {
+ if (p > 2.0) p = 2.0; else if (p < 0.01) p = 0.01;
+ _pitch = p; _changed = true;
+ }
+
+ /**
+ * Get the current pitch value of this audio sample.
+ * @return Pitch
+ */
+ inline float get_pitch() { return _pitch; }
+
+ /**
+ * Set the master volume of this sample. Should be between 0.0 and 1.0.
+ * The final volume is calculated by multiplying the master and audio sample
+ * volume.
+ * @param v Volume
+ */
+ inline void set_master_volume( float v ) {
+ if (v > 1.0) v = 1.0; else if (v < 0.0) v = 0.0;
+ _master_volume = v; _changed = true;
+ }
+
+ /**
+ * Set the volume of this audio sample. Should be between 0.0 and 1.0.
+ * The final volume is calculated by multiplying the master and audio sample
+ * volume.
+ * @param v Volume
+ */
+ inline void set_volume( float v ) {
+ if (v > 1.0) v = 1.0; else if (v < 0.0) v = 0.0;
+ _volume = v; _changed = true;
+ }
+
+ /**
+ * Get the final volume value of this audio sample.
+ * @return Volume
+ */
+ 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; }