Gorgon Game Engine
PositionalController Class Reference

Positional controller allows sounds to be played at a specific location. More...

Inheritance diagram for PositionalController:
[legend]

Public Member Functions

 PositionalController ()=default
 Default constructor. More...
 
 PositionalController (const Containers::Wave &wavedata)
 Filling constructor. More...
 
Geometry::Point3D GetLocation () const
 
void Move (const Geometry::Point3D &target)
 
void Move (const Geometry::Pointf &target)
 
virtual ControllerType Type () const override
 Returns the type of the controller. More...
 
- Public Member Functions inherited from BasicController
 BasicController ()=default
 Default constructor. More...
 
 BasicController (const Containers::Wave &wavedata)
 Filling constructor. More...
 
float GetCurrentFraction () const
 Returns the fraction of the audio that is played. More...
 
float GetCurrentTime () const
 Returns the current playback time in seconds. More...
 
float GetDuration () const
 Returns the duration of the audio buffer in seconds. This function will return 0 if data is not set. More...
 
float GetVolume () const
 Returns the current volume of the playback. More...
 
bool HasData () const
 Returns whether this controller has data. More...
 
bool IsFinished () const
 Whether the audio is finished playing. More...
 
bool IsLooping () const
 Whether the audio is being looped. More...
 
bool IsPlaying () const
 Whether the audio is being played right now. More...
 
BasicControllerLoop ()
 Plays this sound. More...
 
BasicControllerPause ()
 Pauses the playback. More...
 
BasicControllerPlay ()
 Plays this sound. More...
 
void ReleaseData ()
 Releases the data being played by this controller. More...
 
BasicControllerReset ()
 Resets the playback to the beginning of the buffer. This function will not stop the playback. More...
 
BasicControllerSeek (float target)
 Changes the point of playback to the given time in seconds. More...
 
BasicControllerSeekTo (float target)
 Changes the point of playback to the given time in fraction: 1 would be the end of buffer. More...
 
void SetData (const Containers::Wave &wavedata)
 Sets the data to be played by this controller. More...
 
BasicControllerSetVolume (float volume)
 Changes the volume of the playback. More...
 
- Public Member Functions inherited from Controller
 Controller ()
 Default constructor. More...
 
virtual ~Controller ()
 

Additional Inherited Members

- Protected Member Functions inherited from BasicController
virtual void datachanged ()
 Override this function to detect changes in the wave data. More...
 
- Protected Attributes inherited from BasicController
const Containers::Wavewavedata
 Contains the data for this controller. More...
 

Detailed Description

Positional controller allows sounds to be played at a specific location.

This helps user to identify to location of the sound source. However, in games, it would be a better idea to consider advanced positional controller as it enables sound lag due to distance and doppler shift. These would add to the realism of the sound. If there is mono channel in the audio data, this controller will exclusively use mono data and optionally low frequency data. If mono channel does not exists, this controller will mix all channels except low frequency and playback the mixed data. If there is no low frequency speaker in the config, low frequency data will be mixed into the output data.

Constructor & Destructor Documentation

◆ PositionalController() [1/2]

PositionalController ( )
default

Default constructor.

◆ PositionalController() [2/2]

PositionalController ( const Containers::Wave wavedata)

Filling constructor.

Member Function Documentation

◆ GetLocation()

Geometry::Point3D GetLocation ( ) const

◆ Move() [1/2]

void Move ( const Geometry::Point3D target)

◆ Move() [2/2]

void Move ( const Geometry::Pointf target)

◆ Type()

virtual ControllerType Type ( ) const
overridevirtual

Returns the type of the controller.

Reimplemented from BasicController.

References Gorgon::Audio::Basic.


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