emilib
Public Types | Public Member Functions | Static Public Member Functions | List of all members
al::Source Class Reference

A sound source. Has position, and a sound to play. More...

#include <al_lib.hpp>

Public Types

enum  State { INITIAL, PLAYING, PAUSED, STOPPED }
 

Public Member Functions

void set_state (State arg)
 
State state () const
 
void play ()
 
void pause ()
 
void stop ()
 
void rewind ()
 
void set_sound (Sound_SP sound)
 
const Sound_SP & sound () const
 
void set_gain (float gain)
 Volume, [0,1]. >1 MAY work.
 
float gain () const
 
void set_pitch (float pitch)
 sets pitch (clamped to [0,2]), does affect speed
 
float pitch () const
 get current pitch
 
void set_pos (Vec3f)
 
Vec3f pos () const
 
void set_vel (Vec3f)
 
Vec3f vel () const
 
void set_direction (Vec3f)
 
Vec3f direction () const
 
void set_max_distance (float arg)
 
float max_distance () const
 
void set_rolloff_factor (float arg)
 Controls how fast the sound falls off with distance.
 
float rolloff_factor () const
 
void set_reference_distance (float arg)
 
float reference_distance () const
 
void set_min_gain (float arg)
 
float min_gain () const
 
void set_max_gain (float arg)
 
float max_gain () const
 
void set_cone_outer_gain (float arg)
 
float cone_outer_gain () const
 
void set_cone_inner_angle (float arg)
 
float cone_inner_angle () const
 
void set_cone_outer_angle (float arg)
 
float cone_outer_angle () const
 
void set_relative_to_listener (bool arg)
 is the position relative to the listener? false by default
 
bool relative_to_listener () const
 
void set_looping (bool)
 
bool looping () const
 

Static Public Member Functions

static int max_sources ()
 Returns the maximum number of sources possible to have instantiated at the same time.
 

Detailed Description

A sound source. Has position, and a sound to play.

Member Function Documentation

◆ set_max_distance()

void al::Source::set_max_distance ( float  arg)

Indicate distance above which sources are not attenuated using the inverse clamped distance model. Default: +inf

◆ set_reference_distance()

void al::Source::set_reference_distance ( float  arg)

source specific reference distance At 0.0, no distance attenuation occurs. Default is 1.0.


The documentation for this class was generated from the following file: