Panda3D
|
00001 // Filename: audioLoadRequest.h 00002 // Created by: drose (29Aug06) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef AUDIOLOADREQUEST_H 00016 #define AUDIOLOADREQUEST_H 00017 00018 #include "pandabase.h" 00019 00020 #include "asyncTask.h" 00021 #include "audioManager.h" 00022 #include "audioSound.h" 00023 #include "pointerTo.h" 00024 00025 //////////////////////////////////////////////////////////////////// 00026 // Class : AudioLoadRequest 00027 // Description : A class object that manages a single asynchronous 00028 // audio load request. This works in conjunction with 00029 // the Loader class defined in pgraph, or really with 00030 // any AsyncTaskManager. Create a new AudioLoadRequest, 00031 // and add it to the loader via load_async(), to begin 00032 // an asynchronous load. 00033 //////////////////////////////////////////////////////////////////// 00034 class EXPCL_PANDA_AUDIO AudioLoadRequest : public AsyncTask { 00035 public: 00036 ALLOC_DELETED_CHAIN(AudioLoadRequest); 00037 00038 PUBLISHED: 00039 INLINE AudioLoadRequest(AudioManager *audio_manager, const string &filename, 00040 bool positional); 00041 00042 INLINE AudioManager *get_audio_manager() const; 00043 INLINE const string &get_filename() const; 00044 INLINE bool get_positional() const; 00045 00046 INLINE bool is_ready() const; 00047 INLINE AudioSound *get_sound() const; 00048 00049 protected: 00050 virtual DoneStatus do_task(); 00051 00052 private: 00053 PT(AudioManager) _audio_manager; 00054 string _filename; 00055 bool _positional; 00056 00057 bool _is_ready; 00058 PT(AudioSound) _sound; 00059 00060 public: 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 static void init_type() { 00065 AsyncTask::init_type(); 00066 register_type(_type_handle, "AudioLoadRequest", 00067 AsyncTask::get_class_type()); 00068 } 00069 virtual TypeHandle get_type() const { 00070 return get_class_type(); 00071 } 00072 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00073 00074 private: 00075 static TypeHandle _type_handle; 00076 }; 00077 00078 #include "audioLoadRequest.I" 00079 00080 #endif 00081