xyginext  0.2.0
Second generation of xygine game creation framework
Public Member Functions | List of all members
xy::AudioSystem Class Referencefinal

Audio System. While AudioEmitter components will still be audible without and active AudioSystem, and AudioSystem instance is required in the scene to update positional audio, as well as apply the values stored in the AudioMixer. It is, therefore, recommended that any scene which employs AudioEmitter components also has an AudioSystem. More...

#include <AudioSystem.hpp>

Inheritance diagram for xy::AudioSystem:
xy::System

Public Member Functions

 AudioSystem (MessageBus &)
 
void handleMessage (const xy::Message &) override
 Used to process any incoming system messages.
 
void process (float) override
 Implement this for system specific processing to entities.
 
void setVolume (float volume)
 Sets the volume of AudioEmitters assigned to this system When using multiple scenes either in the same state of multiple active states it is sometimes desirable to set the volume of a group of emitters within a specific system. The accepted volume is in the range, automatically clamped, of 0 - 1. This is multiplied with emitter volume so that AudioEmitter settings are left unaffected.
 
float getVolume () const
 Returns the current volume of the system. More...
 
- Public Member Functions inherited from xy::System
 System (MessageBus &mb, UniqueType t)
 Constructor. Pass in a reference to the concrete implementation to generate a unique type ID for this system.
 
UniqueType getType () const
 Returns the unique type ID of the system.
 
const std::vector< Entity > & getEntities () const
 Returns a list of entities that this system is currently interested in.
 
void addEntity (Entity)
 Adds an entity to the list to process.
 
void removeEntity (Entity)
 Removes an entity from the list to process.
 
const ComponentMask & getComponentMask () const
 Returns the component mask used to mask entities with corresponding components for this system to process.
 
bool isActive () const
 Returns true if the system is currently active. Systems can be activeated and deactivated with Scene::setSystemActive()
 
template<typename T >
void requireComponent ()
 
template<typename T >
T * postMessage (Message::ID id)
 

Additional Inherited Members

- Public Types inherited from xy::System
using Ptr = std::unique_ptr< System >
 
- Protected Member Functions inherited from xy::System
template<typename T >
void requireComponent ()
 Adds a component type to the list of components required by the system for it to be interested in a particular entity. This should only be used in the constructor of the System else types will not be registered.
 
std::vector< Entity > & getEntities ()
 
virtual void onEntityAdded (Entity)
 Optional callback performed when an entity is added.
 
template<typename T >
T * postMessage (Message::ID id)
 Posts a message on the system wide message bus.
 
MessageBusgetMessageBus ()
 Returns a reference to the MessageBus.
 
void setScene (Scene &)
 
ScenegetScene ()
 Returns a pointer to the scene to which this system belongs.
 

Detailed Description

Audio System. While AudioEmitter components will still be audible without and active AudioSystem, and AudioSystem instance is required in the scene to update positional audio, as well as apply the values stored in the AudioMixer. It is, therefore, recommended that any scene which employs AudioEmitter components also has an AudioSystem.

Member Function Documentation

◆ getVolume()

float xy::AudioSystem::getVolume ( ) const
inline

Returns the current volume of the system.

See also
setVolume