Panda3D
|
A class object that manages a single asynchronous audio load request. More...
#include "audioLoadRequest.h"
Public Member Functions | |
AudioLoadRequest (AudioManager *audio_manager, const string &filename, bool positional) | |
Create a new AudioLoadRequest, and add it to the loader via load_async(), to begin an asynchronous load. | |
virtual TypeHandle | force_init_type () |
AudioManager * | get_audio_manager () const |
Returns the AudioManager that will serve this asynchronous AudioLoadRequest. | |
const string & | get_filename () const |
Returns the filename associated with this asynchronous AudioLoadRequest. | |
bool | get_positional () const |
Returns the positional flag associated with this asynchronous AudioLoadRequest. | |
AudioSound * | get_sound () const |
Returns the sound that was loaded asynchronously, if any, or NULL if there was an error. | |
virtual TypeHandle | get_type () const |
bool | is_ready () const |
Returns true if this request has completed, false if it is still pending. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual DoneStatus | do_task () |
Performs the task: that is, loads the one sound file. |
A class object that manages a single asynchronous audio load request.
This works in conjunction with the Loader class defined in pgraph, or really with any AsyncTaskManager. Create a new AudioLoadRequest, and add it to the loader via load_async(), to begin an asynchronous load.
Definition at line 34 of file audioLoadRequest.h.
AudioLoadRequest::AudioLoadRequest | ( | AudioManager * | audio_manager, |
const string & | filename, | ||
bool | positional | ||
) | [inline] |
Create a new AudioLoadRequest, and add it to the loader via load_async(), to begin an asynchronous load.
Definition at line 23 of file audioLoadRequest.I.
AsyncTask::DoneStatus AudioLoadRequest::do_task | ( | ) | [protected, virtual] |
Performs the task: that is, loads the one sound file.
Reimplemented from AsyncTask.
Definition at line 26 of file audioLoadRequest.cxx.
AudioManager * AudioLoadRequest::get_audio_manager | ( | ) | const [inline] |
Returns the AudioManager that will serve this asynchronous AudioLoadRequest.
Definition at line 39 of file audioLoadRequest.I.
const string & AudioLoadRequest::get_filename | ( | ) | const [inline] |
Returns the filename associated with this asynchronous AudioLoadRequest.
Definition at line 50 of file audioLoadRequest.I.
bool AudioLoadRequest::get_positional | ( | ) | const [inline] |
Returns the positional flag associated with this asynchronous AudioLoadRequest.
Definition at line 61 of file audioLoadRequest.I.
AudioSound * AudioLoadRequest::get_sound | ( | ) | const [inline] |
Returns the sound that was loaded asynchronously, if any, or NULL if there was an error.
It is an error to call this unless is_ready() returns true.
Definition at line 85 of file audioLoadRequest.I.
bool AudioLoadRequest::is_ready | ( | ) | const [inline] |
Returns true if this request has completed, false if it is still pending.
When this returns true, you may retrieve the sound loaded by calling get_sound().
Definition at line 73 of file audioLoadRequest.I.