00001 00003 00004 #ifndef header_resourcetype_module 00005 #define header_resourcetype_module 00006 00007 #include "../API/Core/Resources/resource_manager.h" 00008 #include "../API/Core/Resources/resourcetype.h" 00009 #include "../API/Core/Resources/resource.h" 00010 #include "../API/Core/System/clanstring.h" 00011 #include "../API/Core/System/error.h" 00012 #include "../API/Core/IOData/inputsource.h" 00013 #include "../API/Core/IOData/inputsource_provider.h" 00014 #include "../API/stl.h" 00015 00016 #include "API/MikMod/streamed_mikmod_sample.h" 00017 00018 class CL_Res_Module : public CL_ResourceType 00019 //: The Module resource is used to store MikMod files in ClanLib datafiles. 00020 // 00023 { 00024 public: 00025 static MODULE *load(std::string res_id, CL_ResourceManager *manager ); 00026 //: Returns a MikMod MODULE. 00030 00031 CL_Res_Module(); 00032 00033 private: 00034 friend CL_ResourceManager; 00035 virtual CL_Resource *create_from_location( 00036 std::string name, 00037 std::string location, 00038 CL_ResourceOptions *options, 00039 CL_ResourceManager *parent); 00040 00041 virtual CL_Resource *create_from_serialization( 00042 std::string name, 00043 CL_ResourceManager *parent); 00044 }; 00045 00046 class CL_ModuleResource : public CL_Resource 00047 { 00048 public: 00049 CL_ModuleResource( 00050 std::string name, 00051 std::string location, 00052 CL_ResourceOptions *options, 00053 CL_ResourceManager *parent); 00054 00055 CL_ModuleResource( 00056 std::string name, 00057 CL_ResourceManager *parent); 00058 00059 MODULE *get_value(); 00060 00061 virtual void load(); 00062 virtual void unload(); 00063 virtual int get_load_count() { return load_count; } 00064 virtual void serialize_save(CL_OutputSource *output); 00065 00066 private: 00067 void load_from_datafile(); 00068 void load_from_file(); 00069 00070 MODULE *value; 00071 00072 std::string location; 00073 CL_ResourceManager *parent; 00074 bool from_datafile; 00075 int load_count; 00076 }; 00077 00078 #endif 00079
1.2.6 written by Dimitri van Heesch,
© 1997-2001