Photon 0.0.2 Simple Open Source 2D Game API |
SourceSimple OO wrapper around an OpenAL source, defines the interface used for Sample and Music. Source is a template class and can not be used directly, use either Sample or Music. Sample is for playing small files such as sound effects. Music is for streaming files such as background music. Operators
Summary
addResource
Define a new named resource. (Ex. Image::addResource(“monkey”,”images/monkey.png”) would make it so that any attempts to load “monkey” would load the image images/monkey.png) Parameters
|
Default constructor, initalizes internal state of Source.
Source()
Opens an audio file, supported formats are WAV and Ogg.
void open( const std:: string & name )
Destructor for source, frees the OpenAL source resource.
~Source()
Starts the playback of the sound attached to the source.
void play()
Stops the playback of the sound attached to the source.
void stop()
Pauses the playback of the sound attached to the source.
void pause()
Rewinds the position of the sound attached to the source.
void rewind()
Sets if the source’s sound is looping or is played only once.
void setLooping( bool loop )
Determine status of Source.
bool isValid() const
Determine if source is playing.
bool isPlaying() const
Determine if source is looping.
bool isLooping() const
Define a new named resource.
static void addResource( const std:: string & name, const std:: string & path )