Main Page   Namespace List   Compound List   File List   Namespace Members   Compound Members   File Members  

MediaInfoDLL.h

Go to the documentation of this file.
00001 /* MediaInfoDLL - All info about media files, for DLL
00002 // Copyright (C) 2002-2006 Jerome Martinez, Zen@MediaArea.net
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 //
00018 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00019 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00020 //
00021 // Public DLL interface implementation
00022 // Wrapper for MediaInfo Library
00023 // Please see MediaInfo.h for help
00024 //
00025 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
00026 
00027 #ifndef MediaInfoDLLH
00028 #define MediaInfoDLLH
00029 
00030 #ifndef __MINGW32__ //MinGW does not support _declspec???
00031     #ifdef MEDIAINFO_DLL_EXPORT
00032         #define MEDIAINFO_EXP extern _declspec(dllexport)
00033     #else
00034         #define MEDIAINFO_EXP extern _declspec(dllimport)
00035     #endif
00036 #else //__MINGW32__
00037     #define MEDIAINFO_EXP
00038 #endif //__MINGW32__
00039 
00040 /** @brief Kinds of Stream */
00041 typedef enum MediaInfo_stream_t
00042 {
00043     MediaInfo_Stream_General,
00044     MediaInfo_Stream_Video,
00045     MediaInfo_Stream_Audio,
00046     MediaInfo_Stream_Text,
00047     MediaInfo_Stream_Chapters,
00048     MediaInfo_Stream_Max
00049 } MediaInfo_stream_C;
00050 
00051 /** @brief Kinds of Info */
00052 typedef enum MediaInfo_info_t
00053 {
00054     MediaInfo_Info_Name,
00055     MediaInfo_Info_Text,
00056     MediaInfo_Info_Measure,
00057     MediaInfo_Info_Options,
00058     MediaInfo_Info_Name_Text,
00059     MediaInfo_Info_Measure_Text,
00060     MediaInfo_Info_Info,
00061     MediaInfo_Info_HowTo,
00062     MediaInfo_Info_Max
00063 } MediaInfo_info_C;
00064 
00065 /** @brief Option if InfoKind = Info_Options */
00066 typedef enum MediaInfo_infooptions_t
00067 {
00068     MediaInfo_InfoOption_ShowInInform,
00069     MediaInfo_InfoOption_Support,
00070     MediaInfo_InfoOption_ShowInSupported,
00071     MediaInfo_InfoOption_TypeOfValue,
00072     MediaInfo_InfoOption_Max
00073 } MediaInfo_infooptions_C;
00074 
00075 /** @brief File opening options */
00076 typedef enum MediaInfo_fileoptions_t
00077 {
00078     MediaInfo_FileOption_Nothing,
00079     MediaInfo_FileOption_Recursive,
00080     MediaInfo_FileOption_Close,
00081     MediaInfo_FileOption_Max
00082 } MediaInfo_fileoptions_C;
00083 
00084 #ifdef __cplusplus
00085 extern "C"
00086 {
00087 #endif /* __cplusplus */
00088 
00089 /***************************************************************************/
00090 /*! \file MediaInfoDll.h
00091 \brief DLL wrapper for MediaInfo.h.
00092 
00093 DLL wrapper for MediaInfo.h \n
00094         Can be used for C and C++\n
00095     "Handle" replaces class definition
00096 */
00097 /***************************************************************************/
00098 
00099 #if defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE)) //DLL construction or Unicode
00100 /** @brief A 'new' MediaInfo interface, return a Handle, don't forget to delete it after using it*/
00101 MEDIAINFO_EXP void*             __stdcall MediaInfo_New (); /*you must ALWAYS call MediaInfo_Delete(Handle) in order to free memory*/
00102 /** @brief A 'new' MediaInfo interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it*/
00103 MEDIAINFO_EXP void*             __stdcall MediaInfo_New_Quick (const wchar_t* File, const wchar_t* Options); /*you must ALWAYS call MediaInfo_Delete(Handle) in order to free memory*/
00104 /** @brief Delete a MediaInfo interface*/
00105 MEDIAINFO_EXP void              __stdcall MediaInfo_Delete (void* Handle);
00106 /** @brief Wrapper for MediaInfoLib::MediaInfo::Open (with a filename)*/
00107 MEDIAINFO_EXP int               __stdcall MediaInfo_Open (void* Handle, const wchar_t* File);
00108 /** @brief Wrapper for MediaInfoLib::MediaInfo::Open (with a buffer) */
00109 MEDIAINFO_EXP int               __stdcall MediaInfo_Open_Buffer (void* Handle, const unsigned char* Begin, unsigned int Begin_Size, const unsigned char* End, unsigned int End_Size); /*return Handle*/
00110 /** @brief Wrapper for MediaInfoLib::MediaInfo::Save */
00111 MEDIAINFO_EXP int               __stdcall MediaInfo_Save (void* Handle);
00112 /** @brief Wrapper for MediaInfoLib::MediaInfo::Close */
00113 MEDIAINFO_EXP void              __stdcall MediaInfo_Close (void* Handle);
00114 /** @brief Wrapper for MediaInfoLib::MediaInfo::Inform */
00115 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfo_Inform (void* Handle, int Reserved); /*Default : Reserved=0*/
00116 /** @brief Wrapper for MediaInfoLib::MediaInfo::Get */
00117 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfo_GetI (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind); /*Default : InfoKind=Info_Text*/
00118 /** @brief Wrapper for MediaInfoLib::MediaInfo::Get */
00119 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfo_Get (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber, const wchar_t* Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind); /*Default : InfoKind=Info_Text, SearchKind=Info_Name*/
00120 /** @brief Wrapper for MediaInfoLib::MediaInfo::Set */
00121 MEDIAINFO_EXP int               __stdcall MediaInfo_SetI (void* Handle, const wchar_t* ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const wchar_t* OldParameter);
00122 /** @brief Wrapper for MediaInfoLib::MediaInfo::Set */
00123 MEDIAINFO_EXP int               __stdcall MediaInfo_Set (void* Handle, const wchar_t* ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, const wchar_t* Parameter, const wchar_t* OldParameter);
00124 /** @brief Wrapper for MediaInfoLib::MediaInfo::Option */
00125 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfo_Option (void* Handle, const wchar_t* Option, const wchar_t* Value);
00126 /** @brief Wrapper for MediaInfoLib::MediaInfo::State_Get */
00127 MEDIAINFO_EXP int               __stdcall MediaInfo_State_Get (void* Handle);
00128 /** @brief Wrapper for MediaInfoLib::MediaInfo::Count_Get */
00129 MEDIAINFO_EXP int               __stdcall MediaInfo_Count_Get (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber); /*Default : StreamNumber=-1*/
00130 #else //defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE))
00131     #define MediaInfo_New               MediaInfoA_New
00132     #define MediaInfo_New_Quick         MediaInfoA_New_Quick
00133     #define MediaInfo_Delete            MediaInfoA_Delete
00134     #define MediaInfo_Open              MediaInfoA_Open
00135     #define MediaInfo_Open_Buffer       MediaInfoA_Open_Buffer
00136     #define MediaInfo_Save              MediaInfoA_Save
00137     #define MediaInfo_Close             MediaInfoA_Close
00138     #define MediaInfo_Inform            MediaInfoA_Inform
00139     #define MediaInfo_GetI              MediaInfoA_GetI
00140     #define MediaInfo_Get               MediaInfoA_Get
00141     #define MediaInfo_SetI              MediaInfoA_SetI
00142     #define MediaInfo_Set               MediaInfoA_Set
00143     #define MediaInfo_Option            MediaInfoA_Option
00144     #define MediaInfo_State_Get         MediaInfoA_State_Get
00145     #define MediaInfo_Count_Get         MediaInfoA_Count_Get
00146 #endif //defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE))
00147 
00148 /** @brief A 'new' MediaInfo interface, return a Handle, don't forget to delete it after using it*/
00149 MEDIAINFO_EXP void*             __stdcall MediaInfoA_New (); /*you must ALWAYS call MediaInfo_Delete(Handle) in order to free memory*/
00150 /** @brief A 'new' MediaInfo interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it*/
00151 MEDIAINFO_EXP void*             __stdcall MediaInfoA_New_Quick (const char* File, const char* Options); /*you must ALWAYS call MediaInfo_Delete(Handle) in order to free memory*/
00152 /** @brief Delete a MediaInfo interface*/
00153 MEDIAINFO_EXP void              __stdcall MediaInfoA_Delete (void* Handle);
00154 /** @brief Wrapper for MediaInfoLib::MediaInfo::Open (with a filename)*/
00155 MEDIAINFO_EXP int               __stdcall MediaInfoA_Open (void* Handle, const char* File); /*you must ALWAYS call MediaInfo_Close(Handle) in order to free memory*/
00156 /** @brief Wrapper for MediaInfoLib::MediaInfo::Open (with a buffer) */
00157 MEDIAINFO_EXP int               __stdcall MediaInfoA_Open_Buffer (void* Handle, const unsigned char* Begin, unsigned int Begin_Size, const unsigned char* End, unsigned int End_Size); /*return Handle*/
00158 /** @brief Wrapper for MediaInfoLib::MediaInfo::Save */
00159 MEDIAINFO_EXP int               __stdcall MediaInfoA_Save (void* Handle);
00160 /** @brief Wrapper for MediaInfoLib::MediaInfo::Close */
00161 MEDIAINFO_EXP void              __stdcall MediaInfoA_Close (void* Handle);
00162 /** @brief Wrapper for MediaInfoLib::MediaInfo::Inform */
00163 MEDIAINFO_EXP const char*       __stdcall MediaInfoA_Inform (void* Handle, int Reserved); /*Default : Reserved=MediaInfo_*/
00164 /** @brief Wrapper for MediaInfoLib::MediaInfo::Get */
00165 MEDIAINFO_EXP const char*       __stdcall MediaInfoA_GetI (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind); /*Default : InfoKind=Info_Text*/
00166 /** @brief Wrapper for MediaInfoLib::MediaInfo::Get */
00167 MEDIAINFO_EXP const char*       __stdcall MediaInfoA_Get (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber, const char* Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind); /*Default : InfoKind=Info_Text, SearchKind=Info_Name*/
00168 /** @brief Wrapper for MediaInfoLib::MediaInfo::Set */
00169 MEDIAINFO_EXP int               __stdcall MediaInfoA_SetI (void* Handle, const char* ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const char* OldParameter);
00170 /** @brief Wrapper for MediaInfoLib::MediaInfo::Set */
00171 MEDIAINFO_EXP int               __stdcall MediaInfoA_Set (void* Handle, const char* ToSet, MediaInfo_stream_C StreamKind, int StreamNumber, const char* Parameter, const char* OldParameter);
00172 /** @brief Wrapper for MediaInfoLib::MediaInfo::Option */
00173 MEDIAINFO_EXP const char*       __stdcall MediaInfoA_Option (void* Handle, const char* Option, const char* Value);
00174 /** @brief Wrapper for MediaInfoLib::MediaInfo::State_Get */
00175 MEDIAINFO_EXP int               __stdcall MediaInfoA_State_Get (void* Handle);
00176 /** @brief Wrapper for MediaInfoLib::MediaInfo::Count_Get */
00177 MEDIAINFO_EXP int               __stdcall MediaInfoA_Count_Get (void* Handle, MediaInfo_stream_C StreamKind, int StreamNumber); /*Default : StreamNumber=-1*/
00178 
00179 
00180 #if defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE)) //DLL construction or Unicode
00181 /** @brief A 'new' MediaInfoList interface, return a Handle, don't forget to delete it after using it*/
00182 MEDIAINFO_EXP void*             __stdcall MediaInfoList_New (); /*you must ALWAYS call MediaInfoList_Delete(Handle) in order to free memory*/
00183 /** @brief A 'new' MediaInfoList interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it*/
00184 MEDIAINFO_EXP void*             __stdcall MediaInfoList_New_Quick (const wchar_t* Files, const wchar_t* Config); /*you must ALWAYS call MediaInfoList_Delete(Handle) in order to free memory*/
00185 /** @brief Delete a MediaInfoList interface*/
00186 MEDIAINFO_EXP void              __stdcall MediaInfoList_Delete (void* Handle);
00187 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Open (with a filename)*/
00188 MEDIAINFO_EXP int               __stdcall MediaInfoList_Open (void* Handle, const wchar_t* Files, const MediaInfo_fileoptions_C Options); /*Default : Options=MediaInfo_FileOption_Nothing*/
00189 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Open (with a buffer) */
00190 MEDIAINFO_EXP int               __stdcall MediaInfoList_Open_Buffer (void* Handle, const unsigned char* Begin, unsigned int Begin_Size, const unsigned char* End, unsigned int End_Size); /*return Handle*/
00191 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Save */
00192 MEDIAINFO_EXP int               __stdcall MediaInfoList_Save (void* Handle, unsigned int FilePos);
00193 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Close */
00194 MEDIAINFO_EXP void              __stdcall MediaInfoList_Close (void* Handle, unsigned int FilePos);
00195 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Inform */
00196 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfoList_Inform (void* Handle, unsigned int FilePos, int Reserved); /*Default : Reserved=0*/
00197 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Get */
00198 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfoList_GetI (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind); /*Default : InfoKind=Info_Text*/
00199 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Get */
00200 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfoList_Get (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const wchar_t* Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind); /*Default : InfoKind=Info_Text, SearchKind=Info_Name*/
00201 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Set */
00202 MEDIAINFO_EXP int               __stdcall MediaInfoList_SetI (void* Handle, const wchar_t* ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const wchar_t* OldParameter);
00203 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Set */
00204 MEDIAINFO_EXP int               __stdcall MediaInfoList_Set (void* Handle, const wchar_t* ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const wchar_t* Parameter, const wchar_t* OldParameter);
00205 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Option */
00206 MEDIAINFO_EXP const wchar_t*    __stdcall MediaInfoList_Option (void* Handle, const wchar_t* Option, const wchar_t* Value);
00207 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::State_Get */
00208 MEDIAINFO_EXP int               __stdcall MediaInfoList_State_Get (void* Handle);
00209 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Count_Get */
00210 MEDIAINFO_EXP int               __stdcall MediaInfoList_Count_Get (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber); /*Default : StreamNumber=-1*/
00211 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Count_Get */
00212 MEDIAINFO_EXP int               __stdcall MediaInfoList_Count_Get_Files (void* Handle);
00213 #else //defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE))
00214     #define MediaInfoList_New               MediaInfoListA_New
00215     #define MediaInfoList_New_Quick         MediaInfoListA_New_Quick
00216     #define MediaInfoList_Delete            MediaInfoListA_Delete
00217     #define MediaInfoList_Open              MediaInfoListA_Open
00218     #define MediaInfoList_Open_Buffer       MediaInfoListA_Open_Buffer
00219     #define MediaInfoList_Save              MediaInfoListA_Save
00220     #define MediaInfoList_Save_All          MediaInfoListA_Save_All
00221     #define MediaInfoList_Close             MediaInfoListA_Close
00222     #define MediaInfoList_Close_All         MediaInfoListA_Close_All
00223     #define MediaInfoList_Inform            MediaInfoListA_Inform
00224     #define MediaInfoList_Inform_All        MediaInfoListA_Inform_All
00225     #define MediaInfoList_GetI              MediaInfoListA_GetI
00226     #define MediaInfoList_Get               MediaInfoListA_Get
00227     #define MediaInfoList_SetI              MediaInfoListA_SetI
00228     #define MediaInfoList_Set               MediaInfoListA_Set
00229     #define MediaInfoList_Option            MediaInfoListA_Option
00230     #define MediaInfoList_State_Get         MediaInfoListA_State_Get
00231     #define MediaInfoList_Count_Get         MediaInfoListA_Count_Get
00232     #define MediaInfoList_Count_Get_Files   MediaInfoListA_Count_Get_Files
00233 #endif //defined (MEDIAINFO_DLL_EXPORT) || (defined (UNICODE) || defined (_UNICODE))
00234 
00235 /* Warning : Deprecated, use MediaInfo_Option("Info_Version", "**YOUR VERSION COMPATIBLE**") instead */
00236 MEDIAINFO_EXP const char*       __stdcall MediaInfo_Info_Version ();
00237 
00238 
00239 /** @brief A 'new' MediaInfoList interface, return a Handle, don't forget to delete it after using it*/
00240 MEDIAINFO_EXP void*             __stdcall MediaInfoListA_New (); /*you must ALWAYS call MediaInfoList_Delete(Handle) in order to free memory*/
00241 /** @brief A 'new' MediaInfoList interface (with a quick init of useful options : "**VERSION**;**APP_NAME**;**APP_VERSION**", but without debug information, use it only if you know what you do), return a Handle, don't forget to delete it after using it*/
00242 MEDIAINFO_EXP void*             __stdcall MediaInfoListA_New_Quick (const char* Files, const char* Config); /*you must ALWAYS call MediaInfoList_Delete(Handle) in order to free memory*/
00243 /** @brief Delete a MediaInfoList interface*/
00244 MEDIAINFO_EXP void              __stdcall MediaInfoListA_Delete (void* Handle);
00245 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Open (with a filename)*/
00246 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Open (void* Handle, const char* Files, const MediaInfo_fileoptions_C Options); /*Default : Options=0*/
00247 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Open (with a buffer) */
00248 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Open_Buffer (void* Handle, const unsigned char* Begin, unsigned int Begin_Size, const unsigned char* End, unsigned int End_Size); /*return Handle*/
00249 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Save */
00250 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Save (void* Handle, unsigned int FilePos);
00251 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Close */
00252 MEDIAINFO_EXP void              __stdcall MediaInfoListA_Close (void* Handle, unsigned int FilePos);
00253 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Inform */
00254 MEDIAINFO_EXP const char*       __stdcall MediaInfoListA_Inform (void* Handle, unsigned int FilePos, int Reserved); /*Default : Reserved=0*/
00255 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Get */
00256 MEDIAINFO_EXP const char*       __stdcall MediaInfoListA_GetI (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, MediaInfo_info_C InfoKind); /*Default : InfoKind=Info_Text*/
00257 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Get */
00258 MEDIAINFO_EXP const char*       __stdcall MediaInfoListA_Get (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const char* Parameter, MediaInfo_info_C InfoKind, MediaInfo_info_C SearchKind); /*Default : InfoKind=Info_Text, SearchKind=Info_Name*/
00259 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Set */
00260 MEDIAINFO_EXP int               __stdcall MediaInfoListA_SetI (void* Handle, const char* ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, unsigned int Parameter, const char* OldParameter);
00261 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Set */
00262 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Set (void* Handles, const char* ToSet, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber, const char* Parameter, const char* OldParameter);
00263 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Option */
00264 MEDIAINFO_EXP const char*       __stdcall MediaInfoListA_Option (void* Handle, const char* Option, const char* Value);
00265 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::State_Get */
00266 MEDIAINFO_EXP int               __stdcall MediaInfoListA_State_Get (void* Handle);
00267 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Count_Get */
00268 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Count_Get (void* Handle, unsigned int FilePos, MediaInfo_stream_C StreamKind, int StreamNumber); /*Default : StreamNumber=-1*/
00269 /** @brief Wrapper for MediaInfoListLib::MediaInfoList::Count_Get */
00270 MEDIAINFO_EXP int               __stdcall MediaInfoListA_Count_Get_Files (void* Handle);
00271 
00272 #ifdef __cplusplus
00273 }
00274 #endif /*__cplusplus*/
00275 
00276 
00277 
00278 #ifdef __cplusplus
00279 //DLL C++ wrapper for C functions
00280 #if !defined(MediaInfoH) && !defined (MEDIAINFO_DLL_EXPORT) //No Lib include and No DLL construction
00281 
00282 //---------------------------------------------------------------------------
00283 #include <string>
00284 //---------------------------------------------------------------------------
00285 
00286 namespace MediaInfoLib
00287 {
00288 
00289 //---------------------------------------------------------------------------
00290 //Char types
00291 #undef  _T
00292 #define _T(__x)     __T(__x)
00293 #if defined(UNICODE) || defined (_UNICODE)
00294     typedef wchar_t Char;
00295     #undef  __T
00296     #define __T(__x) L ## __x
00297 #else
00298     typedef char Char;
00299     #undef  __T
00300     #define __T(__x) __x
00301 #endif
00302 typedef std::basic_string<Char, std::char_traits<Char>, std::allocator<Char> > MediaInfo_String;
00303 //---------------------------------------------------------------------------
00304 
00305 //---------------------------------------------------------------------------
00306 /// @brief Kinds of Stream
00307 enum stream_t
00308 {
00309     Stream_General,                 ///< StreamKind = General
00310     Stream_Video,                   ///< StreamKind = Video
00311     Stream_Audio,                   ///< StreamKind = Audio
00312     Stream_Text,                    ///< StreamKind = Text
00313     Stream_Chapters,                ///< StreamKind = Chapters
00314     Stream_Image,                   ///< StreamKind = Image
00315     Stream_Max,
00316 };
00317 
00318 /// @brief Kind of information
00319 enum info_t
00320 {
00321     Info_Name,                      ///< InfoKind = Unique name of parameter
00322     Info_Text,                      ///< InfoKind = Value of parameter
00323     Info_Measure,                   ///< InfoKind = Unique name of measure unit of parameter
00324     Info_Options,                   ///< InfoKind = See infooptions_t
00325     Info_Name_Text,                 ///< InfoKind = Translated name of parameter
00326     Info_Measure_Text,              ///< InfoKind = Translated name of measure unit
00327     Info_Info,                      ///< InfoKind = More information about the parameter
00328     Info_HowTo,                     ///< InfoKind = Information : how data is found
00329     Info_Max
00330 };
00331 
00332 /// Get(...)[infooptions_t] return a string like "YNYN..." \n
00333 /// Use this enum to know at what correspond the Y (Yes) or N (No)
00334 /// If Get(...)[0]==Y, then :
00335 /// @brief Option if InfoKind = Info_Options
00336 enum infooptions_t
00337 {
00338     InfoOption_ShowInInform,            ///< Show this parameter in Inform()
00339     InfoOption_Support,                         ///< how this parameter is supported, could be N (No), R (Read only), W (Read/Write), space (Non applicable)
00340     InfoOption_ShowInSupported,         ///< Internal use only (info : Must be showed in Info_Capacities() )
00341     InfoOption_Max
00342 };
00343 
00344 //---------------------------------------------------------------------------
00345 /// @brief File opening options
00346 enum fileoptions_t
00347 {
00348     FileOption_Nothing,
00349     FileOption_Recursive,           ///< Browse folders recursively
00350     FileOption_Close,               ///< Close all files before open
00351     FileOption_Max
00352 };
00353 //---------------------------------------------------------------------------
00354 
00355 class MediaInfo
00356 {
00357 public :
00358     MediaInfo ()                {Handle=MediaInfo_New();};
00359     ~MediaInfo ()               {MediaInfo_Close(Handle);};
00360 
00361     //File
00362     int Open (const MediaInfo_String &File) {return MediaInfo_Open(Handle, File.c_str());};
00363     int Open (const unsigned char* Begin, size_t Begin_Size, const unsigned char* End=NULL, size_t End_Size=NULL) {return MediaInfo_Open_Buffer(Handle, Begin, Begin_Size, End, End_Size);};
00364     int Save () {return MediaInfo_Save(Handle);};
00365     void Close () {return MediaInfo_Close(Handle);};
00366 
00367     //General information
00368     MediaInfo_String Inform (int Reserved=NULL)  {return MediaInfo_Inform(Handle, NULL);};
00369     MediaInfo_String Get (stream_t StreamKind, int StreamNumber, int Parameter, info_t InfoKind=Info_Text)  {return MediaInfo_GetI (Handle, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter, (MediaInfo_info_C)InfoKind);};
00370     MediaInfo_String Get (stream_t StreamKind, int StreamNumber, const MediaInfo_String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name)  {return MediaInfo_Get (Handle, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter.c_str(), (MediaInfo_info_C)InfoKind, (MediaInfo_info_C)SearchKind);};
00371     int Set (const MediaInfo_String &ToSet, stream_t StreamKind, int StreamNumber, int Parameter, const MediaInfo_String &OldValue=_T(""))  {return MediaInfo_SetI (Handle, ToSet.c_str(), (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter, OldValue.c_str());};
00372     int Set (const MediaInfo_String &ToSet, stream_t StreamKind, int StreamNumber, const MediaInfo_String &Parameter, const MediaInfo_String &OldValue=_T(""))  {return MediaInfo_Set (Handle, ToSet.c_str(), (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter.c_str(), OldValue.c_str());};
00373     MediaInfo_String        Option (const MediaInfo_String &Option, const MediaInfo_String &Value=_T(""))  {return MediaInfo_Option (Handle, Option.c_str(), Value.c_str());};
00374     static MediaInfo_String Option_Static (const MediaInfo_String &Option, const MediaInfo_String &Value=_T(""))  {return MediaInfo_Option (NULL, Option.c_str(), Value.c_str());};
00375     int                     State_Get ()  {return MediaInfo_State_Get(Handle);};
00376     int                     Count_Get (stream_t StreamKind, int StreamNumber=-1)  {return MediaInfo_Count_Get(Handle, (MediaInfo_stream_C)StreamKind, StreamNumber);};
00377 
00378 private :
00379     void* Handle;
00380 };
00381 
00382 class MediaInfoList
00383 {
00384 public :
00385     MediaInfoList ()                {Handle=MediaInfoList_New();};
00386     ~MediaInfoList ()               {MediaInfoList_Delete(Handle);};
00387 
00388     //File
00389     int Open (const MediaInfo_String &File, const fileoptions_t Options=FileOption_Nothing) {return MediaInfoList_Open(Handle, File.c_str(), (MediaInfo_fileoptions_C)Options);};
00390     int Open (const unsigned char* Begin, size_t Begin_Size, const unsigned char* End=NULL, size_t End_Size=NULL) {return MediaInfoList_Open_Buffer(Handle, Begin, Begin_Size, End, End_Size);};
00391     int Save (unsigned int FilePos) {return MediaInfoList_Save(Handle, FilePos);};
00392     void Close (unsigned int FilePos) {return MediaInfoList_Close(Handle, FilePos);};
00393 
00394     //General information
00395     MediaInfo_String Inform (unsigned int FilePos=-1, int Reserved=NULL)  {return MediaInfoList_Inform(Handle, FilePos, NULL);};
00396     MediaInfo_String Get (unsigned int FilePos, stream_t StreamKind, int StreamNumber, int Parameter, info_t InfoKind=Info_Text)  {return MediaInfoList_GetI (Handle, FilePos, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter, (MediaInfo_info_C)InfoKind);};
00397     MediaInfo_String Get (unsigned int FilePos, stream_t StreamKind, int StreamNumber, const MediaInfo_String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name)  {return MediaInfoList_Get (Handle, FilePos, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter.c_str(), (MediaInfo_info_C)InfoKind, (MediaInfo_info_C)SearchKind);};
00398     int Set (const MediaInfo_String &ToSet, unsigned int FilePos, stream_t StreamKind, int StreamNumber, int Parameter, const MediaInfo_String &OldValue=_T(""))  {return MediaInfoList_SetI (Handle, ToSet.c_str(), FilePos, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter, OldValue.c_str());};
00399     int Set (const MediaInfo_String &ToSet, unsigned int FilePos, stream_t StreamKind, int StreamNumber, const MediaInfo_String &Parameter, const MediaInfo_String &OldValue=_T(""))  {return MediaInfoList_Set (Handle, ToSet.c_str(), FilePos, (MediaInfo_stream_C)StreamKind, StreamNumber, Parameter.c_str(), OldValue.c_str());};
00400     MediaInfo_String        Option (const MediaInfo_String &Option, const MediaInfo_String &Value=_T(""))  {return MediaInfoList_Option (Handle, Option.c_str(), Value.c_str());};
00401     static MediaInfo_String Option_Static (const MediaInfo_String &Option, const MediaInfo_String &Value=_T(""))  {return MediaInfoList_Option (NULL, Option.c_str(), Value.c_str());};
00402     int                     State_Get ()  {return MediaInfoList_State_Get(Handle);};
00403     int                     Count_Get (unsigned int FilePos, stream_t StreamKind, int StreamNumber=-1)  {return MediaInfoList_Count_Get(Handle, FilePos, (MediaInfo_stream_C)StreamKind, StreamNumber);};
00404     int                     Count_Get ()  {return MediaInfoList_Count_Get_Files(Handle);};
00405 
00406 private :
00407     void* Handle;
00408 };
00409 } //NameSpace
00410 #endif//#if !defined(MediaInfoH) && !defined (MEDIAINFO_DLL_EXPORT) && !(defined (UNICODE) || defined (_UNICODE))
00411 #endif /*__cplusplus*/
00412 
00413 
00414 #endif

Generated on Sun Apr 30 10:34:51 2006 for MediaInfoLib by doxygen1.3-rc3