Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

lrt::Sound Class Reference

Implements a simple sound playing mechanism. More...

#include <rtsound.h>

List of all members.

Static Public Methods

bool isSupported ()
 Returns whether sound playing is supported on this platform.

bool isPresent (const String &logicalSoundName)
 Returns true if the sound given by its logical name is found.

bool play (const String &logicalSoundName, bool sync=false, bool stop=true)
 Plays a sound. More...

String getExtension ()
 Returns this platform's sound file extension. More...

void addSoundFolder (const String &folder)
 Adds another folder to search sound files in.


Detailed Description

Implements a simple sound playing mechanism.

For the purpose of this Sound class, sounds are represented by logical sound names, i.e. file names without extension (such as "start"). Whenever an application requests to play a given sound name, libRT looks for the sound file (with a system specific extension) first in the current folder, then in the executable file folder, and finally in the subfolder sounds/ of the executable file folder.


Member Function Documentation

String lrt::Sound::getExtension (    )  [static]
 

Returns this platform's sound file extension.

(For example: ".wav" for Windows.)

bool lrt::Sound::play (  const String &    logicalSoundName,
bool    sync = false,
bool    stop = true
)  [static]
 

Plays a sound.

Parameters:
logicalSoundName  The logical name of the requested sound.
sync  (optional) If the sound should be played synchronously (normally not). Synchronous playing means that the play() method only returns when the sound has finished playing. Asynchronous playing means that the play() method returns immediately.
stop  (optional) Stop other playing sounds, if that is needed to play this sound. If stop is not given and other sounds are playing, this sound will not be played.


The documentation for this class was generated from the following files:
This is the RoboTour API documentation version 0.1 • Copyright (C) by Florian Fischer