![]() |
xyginext
0.2.0
Second generation of xygine game creation framework
|
Contains one or more definitions used to create AudioEmitter components. Similarly to the SpriteSheet class used for loading Sprites from configuration files, AudioScapes can be used to define the settings used to create AudioEmitter components. AudioScape files usually have the extension *.xas with the following ConfigFile compatible layout: More...
#include <AudioScape.hpp>
Public Member Functions | |
AudioScape (AudioResource &rx) | |
Constructor. More... | |
bool | loadFromFile (const std::string &path) |
Attempts to load an AudioScape file from the given path. More... | |
bool | saveToFile (const std::string &path) |
Saves the AudioScape configuration to a given path. AudioScape files normally have the extension *.xas. | |
AudioEmitter | getEmitter (const std::string &name) const |
Returns an AudioEmitter configured with the given name from the loaded confugration, if it exists, else returns an Uninitialised AudioEmitter. Use AudioEmitter::hasSource() to check validity of the returned emitter. | |
void | addEmitter (const std::string &name, const AudioEmitter &emitter) |
Adds an emitter configuration to the AudioScape. More... | |
Contains one or more definitions used to create AudioEmitter components. Similarly to the SpriteSheet class used for loading Sprites from configuration files, AudioScapes can be used to define the settings used to create AudioEmitter components. AudioScape files usually have the extension *.xas with the following ConfigFile compatible layout:
Emitter properties are optional (except path and streaming) and any omitted properties will fall back to their default values.
|
explicit |
Constructor.
rx | Reference to an AudioResource object used to cache any non-streamed audio files. |
void xy::AudioScape::addEmitter | ( | const std::string & | name, |
const AudioEmitter & | emitter | ||
) |
Adds an emitter configuration to the AudioScape.
name | Name of the AudioEmitter as it appears in the configuration. If an emitter with the name already exists then it will be overwritten. |
emitter | An AudioEmitter whose current settings will be saved in the configuration file. |
bool xy::AudioScape::loadFromFile | ( | const std::string & | path | ) |
Attempts to load an AudioScape file from the given path.
path | String containing the path to the *.xas file to load |