Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions
AudioLoadRequest Class Reference

A class object that manages a single asynchronous audio load request. More...

#include "audioLoadRequest.h"

Inheritance diagram for AudioLoadRequest:
AsyncTask AsyncTaskBase TypedReferenceCount Namable TypedObject ReferenceCount MemoryBase MemoryBase MemoryBase

List of all members.

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 ()
AudioManagerget_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.
AudioSoundget_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.

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

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.

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.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations