AudioLoadRequest
-
class AudioLoadRequest
Bases:
AsyncTask
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.Inheritance diagram
-
explicit AudioLoadRequest(AudioManager *audio_manager, std::string const &filename, bool positional)
-
AudioLoadRequest(AudioLoadRequest const&) = default
Create a new
AudioLoadRequest
, and add it to the loader via load_async(), to begin an asynchronous load.
-
AudioManager *get_audio_manager(void) const
Returns the
AudioManager
that will serve this asynchronousAudioLoadRequest
.
-
static TypeHandle get_class_type(void)
-
std::string const &get_filename(void) const
Returns the filename associated with this asynchronous
AudioLoadRequest
.
-
bool get_positional(void) const
Returns the positional flag associated with this asynchronous
AudioLoadRequest
.
-
AudioSound *get_sound(void) const
Returns the sound that was loaded asynchronously, if any, or nullptr if there was an error. It is an error to call this unless
done()
returns true.Deprecated: Use
result()
instead.
-
bool is_ready(void) const
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()
. Equivalent toreq.done() and not req.cancelled()
.See
AsyncFuture::done()
.
-
explicit AudioLoadRequest(AudioManager *audio_manager, std::string const &filename, bool positional)