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

Generated on Sun Feb 12 14:24:02 2006 for MediaInfoLib by doxygen1.3-rc3