F:/Programmation/MediaInfoLib/Source/MediaInfo/MediaInfo.h

Go to the documentation of this file.
00001 // MediaInfo - All information about media files
00002 // Copyright (C) 2002-2008 Jerome Martinez, Zen@MediaArea.net
00003 //
00004 // This library is free software: you can redistribute it and/or modify it
00005 // under the terms of the GNU Lesser General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // 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
00012 // GNU Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public License
00015 // along with this library. If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00018 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00019 //
00020 // Give information about a lot of media files
00021 // Dispatch the file to be tested by all containers
00022 //
00023 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00024 
00025 //---------------------------------------------------------------------------
00026 #ifndef MediaInfoH
00027 #define MediaInfoH
00028 //---------------------------------------------------------------------------
00029 
00030 //---------------------------------------------------------------------------
00031 #include <MediaInfo/MediaInfo_Const.h>
00032 //---------------------------------------------------------------------------
00033 
00034 namespace MediaInfoLib
00035 {
00036 
00037 class File__Base;
00038 class File__Analyze;
00039 class Internet__Base;
00040 class WxThread;
00041 
00042 //***************************************************************************
00045 //***************************************************************************
00046 
00047 class MediaInfo
00048 {
00049 public :
00050     //Constructor/Destructor
00051     MediaInfo ();
00052     ~MediaInfo ();
00053     //File
00059     size_t Open (const String &File_Name);
00069         size_t Open (const ZenLib::int8u* Begin, size_t Begin_Size, const ZenLib::int8u* End=NULL, size_t End_Size=0, ZenLib::int64u File_Size=0);
00074         size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
00079         size_t Open_Buffer_Continue (const ZenLib::int8u* Buffer, size_t Buffer_Size);
00084         ZenLib::int64u Open_Buffer_Continue_GoTo_Get ();
00087     size_t Open_Buffer_Finalize ();
00092     size_t Save ();
00096     void Close ();
00097 
00098     //General information
00102     String Inform (size_t Reserved=0);
00103 
00104     //Get
00113     String Get (stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t InfoKind=Info_Text);
00124     String Get (stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name);
00125 
00126     //Set
00136         size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=_T(""));
00146     size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=_T(""));
00147 
00148     //Output_Buffered
00155     size_t Output_Buffer_Get (const String &Value, unsigned char** Output_Buffer=NULL);
00156 
00157     //Info
00197     String        Option (const String &Option, const String &Value=_T(""));
00203         static String Option_Static (const String &Option, const String &Value=_T(""));
00211     size_t                  State_Get ();
00215     size_t                  Count_Get (stream_t StreamKind, size_t StreamNumber=(size_t)-1);
00216 
00217 private :
00218     friend class File_Cdxa; //Theses classes need access to internal structure for optimization. There is recursivity with theses formats
00219 
00220     //Format testing
00221     int Format_Test();
00222     int Format_Test_Buffer();
00223     int Format_Test_FillBuffer_Init();
00224     int Format_Test_FillBuffer_Continue();
00225     int Format_Test_FillBuffer_Close();
00226 
00227     //File
00228     String File_Name;
00229     void*                File_Handle;
00230         ZenLib::int64u   File_Size;
00231         ZenLib::int64u   File_Offset;
00232     bool             File_AlreadyBuffered;
00233 
00234     //Buffer
00235     unsigned char*   Buffer;
00236     size_t           Buffer_Size;
00237     size_t           Buffer_Size_Max;
00238     const unsigned char* BufferConst;
00239 
00240     //Parsing handles
00241     File__Base*     Info;
00242     Internet__Base* Internet;
00243 
00244     //Thread
00245     WxThread* Thread;
00246     blockmethod_t BlockMethod; //Open() returns when?
00247 
00248     //Helpers
00249     int  InternalMethod; //1=Open file, 3=Supported formats
00250     int  ApplyMethod();
00251     int  ListFormats();
00252         void Buffer_Clear(); //Clear the buffer
00253         void SelectFromExtension (const String &Parser); //Select File_* from the parser name
00254     bool LibraryIsModified(); //Is the library has been modified? (#defines...)
00255     void CreateDummy (const String& Value); //Create dummy Information
00256 
00257     MediaInfo(const MediaInfo&); // Copy Constructor
00258 
00259     //Open Buffer
00260     bool MultipleParsing_IsDetected;
00261 };
00262 
00263 } //NameSpace
00264 #endif

Generated on Wed Jan 9 14:53:59 2008 for MediaInfoLib by  doxygen 1.5.4