MPMA Framework 0.4
Public Member Functions | Static Public Member Functions
AUDIO::Player Class Reference

Used to play sound buffers sources. More...

#include <Player.h>

List of all members.

Public Member Functions

bool PlayStreaming (std::shared_ptr< Source > source, RenderMode mode, float streamSizeInSeconds=0.2f)
 Starts playing a source on this player. If the player was already playing something, the previous sound is stopped. A source may not be played by more than one player at a time. Returns true if the sound could be started.
bool PlayStatic (std::shared_ptr< StaticBuffer > buffer, RenderMode mode)
 Starts playing a precreated static source on this player. If the player was already playing something, the previous sound is stopped. A StaticBuffer may be played by any number of players at the same time. Returns true if the sound could be started.
void Stop ()
 Stops the currently playing sound.
bool IsPlaying () const
 Returns whether a sound is still being played by this player.
void SetVolume (float value)
 Sets the global sound volume level for this player. Value can be from 0 being silence to 1 being normal. Default is 1.
void SetPitchMultiplier (float value)
 Sets a pitch multiplier for the sound (must be >0)
void SetPosition (float x, float y, float z)
 Sets the 3D position that the sound is located at.
template<typename VectorType >
void SetPosition (const VectorType &pos)
 Sets the 3D position that the sound is located at.
void SetVelocity (float x, float y, float z)
 Sets the speed and direction that sound is moving. (used for doppler)
template<typename VectorType >
void SetVelocity (const VectorType &vel)
 Sets the speed and direction that sound is moving. (used for doppler)
void SetCone (float dirX, float dirY, float dirZ, float coneInnerAngle, float coneOutterAngle, float coneOutterAngleVolume)
 Sets the sound's output to be restricted to a cone pointing in a specific direction. Sounds within the inner angle are normal volume, while sounds outside the outter angle are coneOutterAngleVolume volume(from 0 to 1). Angles are in radians.
template<typename VectorType >
void SetCone (const VectorType &dir, float coneInnerAngle, float coneOutterAngle, float coneOutterAngleVolume)
 Sets the sound's output to be restricted to a cone pointing in a specific direction. Sounds within the inner angle are normal volume, while sounds outside the outter angle are coneOutterAngleVolume volume(from 0 to 1). Angles are in radians.
void SetDistanceVolumeLimits (float minVolume, float maxVolume)
 This sets the minimum and maximum volume the sound can be scaled. This is applied after the current distance model's effect is applied.
void SetReferenceDistance (float value)
 Sets this player's ReferenceDistance for the current distance model (see Listener.h).
void SetMaxDistance (float value)
 Sets this player's MaxDistance for the current distance model (see Listener.h).
void SetRolloffFactor (float value)
 Sets this player's RolloffFactor for the current distance model (see Listener.h).
void SetDefaults ()
 Applies the default settings to the current player.

Static Public Member Functions

static std::shared_ptr< PlayerCreate (bool allocateNow=false)
 Creates a new instance of a Player. If allocateNow is true, openAl resources will be allocated for it immediately so that effects may be set prior to calling Play.
static void SetDefaultVolume (float value)
 Sets the default value for SetVolume, which is applied to newly created Players.
static void SetDefaultPitchMultiplier (float value)
 Sets the default value for SetPitchMultiplier, which is applied to newly created Players.
static void SetDefaultDistanceVolumeLimits (float minVolume, float maxVolume)
 Sets the default value for SetDistanceVolumeLimits, which is applied to newly created Players.
static void SetDefaultReferenceDistance (float value)
 Sets the default value for SetReferenceDistance, which is applied to newly created Players.
static void SetDefaultMaxDistance (float value)
 Sets the default value for SetMaxDistance, which is applied to newly created Players.
static void SetDefaultRolloffFactor (float value)
 Sets the default value for SetRolloffFactor, which is applied to newly created Players.

Detailed Description

Used to play sound buffers sources.


Member Function Documentation

bool AUDIO::Player::PlayStatic ( std::shared_ptr< StaticBuffer buffer,
RenderMode  mode 
)

Starts playing a precreated static source on this player. If the player was already playing something, the previous sound is stopped. A StaticBuffer may be played by any number of players at the same time. Returns true if the sound could be started.

Starts playing a precreated static source on this player. If the player was already playing something, the previous sound is stopped. Returns true if the sound could be started.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends