00001 /*! \file 00002 \author victorien ferry & www.m4nkind.com 00003 \brief This file applies the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 , read file COPYING. 00004 */ 00005 #ifndef COM_M4NKIND_MediaAccess_H 00006 #define COM_M4NKIND_MediaAccess_H 00007 00008 #include "BaseObject.h" 00009 #include "PackObjectReference.h" 00010 #include "VirtualMedia.h" 00011 #include "PackString.h" 00012 #include "PackULong_Enums.h" 00013 /*! 00014 \class MediaAccess 00015 \ingroup BaseObjectInheritedDocGroup BaseObjectInherited_Veda 00016 \brief Define which Media objects are the main media and the boot media 00017 in a context. Then static method MediaAccess::GetMainMedia() 00018 is a simple entry to a media in the context. 00019 There should be only one MediaAccess object per context. 00020 */ 00021 class MediaAccess : public BaseObject 00022 { 00023 /*================================================================== 00024 PUBLIC 00025 ==================================================================*/ 00026 public: 00027 /*! 00028 \brief Constructor. 00029 */ 00030 MediaAccess(void); 00031 00032 /*! 00033 \brief Class Inheritance Descriptors. Also forces a destructor. See BASEOBJECT_DECLARE_... in .cpp 00034 */ 00035 BASEOBJECT_DEFINE_CLASS(MediaAccess); 00036 /*! 00037 \brief Get the media object defined as the main, from the context, 00038 and eventually a boot script. 00039 \param _pContext the context which has a main script. 00040 \param _ppbootScript a pointer to a pointer to a bootscript to return. 00041 \param _ppMediaExportName a pointer to an executable name. 00042 \return the main media object or null if none selected. 00043 */ 00044 static VirtualMedia *GetMainMedia(BaseContext *_pContext,VirtualMedia **_ppbootScript=0L,const char **_ppMediaExportName=0L); 00045 #ifdef _ENGINE_EDITABLE_ 00046 /*! 00047 \brief Extend this method to draw your preview ! 00048 a GUI could need to play, draw, print, or output from any way, a preview of a 00049 created object. Inherited classes can implement it in 00050 any way, to explicit the current shape of an object. 00051 00052 \param _frameDate a date, in second, which defines the effect cinematic. 00053 \param _pPreviewViewPort the viewport to render. Can't be 0L. 00054 \param _pPreviewConfiguration Preview Configuration object. Never 0L. Do not keep a pointer to it. 00055 */ 00056 virtual void ProcessPreview(double _frameDate,VirtualMachine::InternalViewPort *_pPreviewViewPort,const PreviewConfiguration *_pPreviewConfiguration); 00057 #endif 00058 #ifdef _ENGINE_EDITABLE_ 00059 /* 00060 \brief Return the main media object. Then use ->Create() to build it. 00061 \param _pMediaObjectToLink Media Object To set as main. 00062 \return a possible error enum, like in PackObjectReference::Set() . 00063 */ 00064 inline PackObjectReference::enum_SetReferenceResult 00065 SetMainMedia( VirtualMedia *_pMediaObjectToLink ) 00066 { return mSer_MainMedia.SetObjectPointer( _pMediaObjectToLink ); }; 00067 #endif 00068 #ifdef _ENGINE_EDITABLE_ 00069 /* 00070 \brief Return the main media object. Then use ->Create() to build it. 00071 \param _pMediaObjectToLink Media Object To set as main. 00072 \return a possible error enum, like in PackObjectReference::Set() . 00073 */ 00074 inline PackObjectReference::enum_SetReferenceResult 00075 SetBootMedia( VirtualMedia *_pMediaObjectToLink ) 00076 { return mSer_BootMedia.SetObjectPointer( _pMediaObjectToLink ); }; 00077 #endif 00078 00079 /* 00080 \brief returns a name for the whole media, suitable as Executable name. 00081 00082 \return a character string of the name. 00083 */ 00084 inline const char *GetExportName(){ return mSer_ExportName.Get(); }; 00085 //! \typedef define a default resolution preference for executable export. 00086 typedef enum { 00087 eRes_320x240=0, 00088 eRes_640x480=0, 00089 eRes_800x600=0, 00090 } eVGAResolution; 00091 /*================================================================== 00092 PROTECTED 00093 ==================================================================*/ 00094 protected: 00095 //! the selector of the main media, as a serializable type. 00096 PackObjectReference mSer_MainMedia; 00097 //! the selector of the boot media, as a serializable type. 00098 PackObjectReference mSer_BootMedia; 00099 //! name of the media, can be used as executable name: 00100 PackString mSer_ExportName; 00101 //! default eVGAResolution enum for exporting media executable. 00102 PackULong_Enums mSer_VGADefaultResolution; 00103 //! additional text 00104 PackObjectReference mSer_QuittingInfoTextRef; 00105 }; 00106 00107 #endif
/\/\ 4 N k ! N D _______ _ __ ___ _____ ___ _ _ ____ ___________ __//___ /________ |/ / ___________\_______/ \ / _ _ \/ _ / _ / _/_/____/ _ __ / / / / / / / \ \/ / / \ \ / \\___/___/___/ ¯ _____/_____/ ______\___/_____/\________\\ \________/_ ___ __ l____\ /elD! http://www.m4nkind.com \____/