#include <source.h>
Inheritance diagram for openalpp::Source:
Public Member Functions | |
Source (float x=0.0, float y=0.0, float z=0.0) | |
Source (const std::string &filename, float x=0.0, float y=0.0, float z=0.0) | |
Source (const Sample &buffer, float x=0.0, float y=0.0, float z=0.0) | |
Source (const Stream &stream, float x=0.0, float y=0.0, float z=0.0) | |
Source (const Source &source) | |
void | setSound (const std::string &filename) |
void | setSound (const Sample *buffer) |
void | setSound (Stream *stream) |
void | setSound (const Stream *stream) |
const SoundData * | getSound () const |
void | play (const std::string &filename) |
void | play (const Sample *buffer) |
void | play (const Stream *stream) |
void | play () |
void | stop () |
void | pause () |
void | seek (float time_s) |
bool | isStreaming () |
Source & | operator= (const Source &source) |
Protected Member Functions | |
virtual | ~Source () |
openalpp::Source::Source | ( | float | x = 0.0 , |
|
float | y = 0.0 , |
|||
float | z = 0.0 | |||
) |
Constructor. Creates the source with the specified position.
x | x coordinate. | |
y | y coordinate. | |
z | z coordinate. |
openalpp::Source::Source | ( | const std::string & | filename, | |
float | x = 0.0 , |
|||
float | y = 0.0 , |
|||
float | z = 0.0 | |||
) |
Constructor. Creates the source and a buffer with the specified file.
filename | is the name of the file. |
openalpp::Source::Source | ( | const Sample & | buffer, | |
float | x = 0.0 , |
|||
float | y = 0.0 , |
|||
float | z = 0.0 | |||
) |
Constructor. Creates the source with the specified buffer.
buffer | is the buffer to use. |
openalpp::Source::Source | ( | const Stream & | stream, | |
float | x = 0.0 , |
|||
float | y = 0.0 , |
|||
float | z = 0.0 | |||
) |
Constructor. Creates the source with the specified stream.
stream | is the stream to use. |
openalpp::Source::Source | ( | const Source & | source | ) |
Copy constructor.
virtual openalpp::Source::~Source | ( | ) | [protected, virtual] |
Destructor.
void openalpp::Source::setSound | ( | const std::string & | filename | ) |
Create a buffer for the source and load a file into it. The source should _not_ be playing when doing this.
filename | is the name of the file. |
void openalpp::Source::setSound | ( | const Sample * | buffer | ) |
Sets a new buffer for the source. The source should _not_ be playing when doing this.
buffer | is the new buffer. |
void openalpp::Source::setSound | ( | Stream * | stream | ) |
Sets a new (streamed) buffer for the source. The source should _not_ be playing when doing this.
stream | is the new buffer. |
void openalpp::Source::setSound | ( | const Stream * | stream | ) |
const SoundData* openalpp::Source::getSound | ( | ) | const |
Gets the buffer associated with the source.
void openalpp::Source::play | ( | const std::string & | filename | ) |
Play a file on the source. This will change the source's buffer.
filename | is the name of the file to play. |
void openalpp::Source::play | ( | const Sample * | buffer | ) |
Play a buffer on the source. This will change the source's buffer.
buffer | is the buffer to play. |
void openalpp::Source::play | ( | const Stream * | stream | ) |
Play a stream on the source. This will change the source's buffer.
stream | is the stream to play. |
void openalpp::Source::play | ( | ) |
Play this source. This is only here, because the above Play(...) hides SourceBase::Play()
Reimplemented from openalpp::SourceBase.
void openalpp::Source::stop | ( | ) |
Stop this source. This is needed here for streaming sources...
Reimplemented from openalpp::SourceBase.
void openalpp::Source::pause | ( | ) |
Pause this source. This is needed here for streaming sources...
Reimplemented from openalpp::SourceBase.
void openalpp::Source::seek | ( | float | time_s | ) |
Seek this source to specified time (streaming sources)
bool openalpp::Source::isStreaming | ( | ) |
Check if the source is streaming.