MediaInfoList.h

    00001 // MediaInfoList - A list of MediaInfo
    00002 // Copyright (C) 2002-2012 MediaArea.net SARL, Info@MediaArea.net
    00003 //
    00004 // This library is free software: you can redistribute it and/or modify it
    00005 // under the terms of the GNU Library General Public License as published by
    00006 // the Free Software Foundation, either version 2 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 Library General Public License for more details.
    00013 //
    00014 // You should have received a copy of the GNU Library General Public License
    00015 // along with this library. If not, see <http://www.gnu.org/licenses/>.
    00016 //
    00017 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00018 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00019 // MediaInfoList
    00020 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00021 //
    00022 // Give information about a lot of media files
    00023 //
    00024 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    00025
    00026 //---------------------------------------------------------------------------
    00027 #ifndef MediaInfoListH
    00028 #define MediaInfoListH
    00029 //---------------------------------------------------------------------------
    00030
    00031 //---------------------------------------------------------------------------
    00032 #include "MediaInfo/MediaInfo.h"
    00033 //---------------------------------------------------------------------------
    00034
    00035 //---------------------------------------------------------------------------
    00036 #undef MEDIAINFO_EXP
    00037 #if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
    00038     #ifdef MEDIAINFO_DLL_EXPORT
    00039         #define MEDIAINFO_EXP
    00040     #else
    00041         #define MEDIAINFO_EXP
    00042     #endif
    00043 #else //defined(_WIN32) && !defined(__MINGW32__)
    00044     #if __GNUC__ >= 4
    00045         #define MEDIAINFO_EXP __attribute__ ((visibility("default")))
    00046     #else
    00047         #define MEDIAINFO_EXP
    00048     #endif
    00049 #endif //defined(_WIN32) && !defined(__MINGW32__)
    00050
    00051 #if !defined(__WINDOWS__)
    00052     #define __stdcall //Supported only on windows
    00053 #endif //!defined(_WIN32)
    00054 //---------------------------------------------------------------------------
    00055
    00056 namespace MediaInfoLib
    00057 {
    00058
    00059 //***************************************************************************
    00062 //***************************************************************************
    00063
    00064 class MEDIAINFO_EXP MediaInfoList
    00065 {
    00066 public :
    00067     //Class
    00070     MediaInfoList (size_t Count_Init=64);
    00071     ~MediaInfoList ();
    00072
    00073     //Files
    00082     size_t Open (const String &File, const fileoptions_t Options=FileOption_Nothing);
    00087     size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
    00093     size_t Open_Buffer_Continue (size_t FilePos, const ZenLib::int8u* Buffer, size_t Buffer_Size);
    00099     ZenLib::int64u Open_Buffer_Continue_GoTo_Get (size_t FilePos);
    00103     size_t Open_Buffer_Finalize (size_t FilePos);
    00110     size_t Save (size_t FilePos);
    00116     void Close (size_t FilePos=(size_t)-1);
    00117
    00124     String Inform (size_t FilePos=(size_t)-1, size_t Reserved=0);
    00125
    00126     //Get
    00137     String Get (size_t FilePos, stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t KindOfInfo=Info_Text); //Get info, FilePos=File position, StreamKind=General video audio text chapter, StreamNumber=stream number, PosInStream=parameter you want, KindOfInfo=name, text, measure, options, name (language), measure (language), info, how to
    00150     String Get (size_t FilePos, stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t KindOfInfo=Info_Text, info_t KindOfSearch=Info_Name); //Get info, FilePos=File position, StreamKind=General video audio text chapter, StreamNumber=stream number, PosInStream=parameter you want, KindOfInfo=name text measure options name(language) measure(language) information how to, KindOfSearch=which Kind Of information Parameter must be searched?
    00151
    00152     //Set
    00165     size_t Set (const String &ToSet, size_t FilePos, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String()); //Get info, FilePos=File position, StreamKind=General video audio text chapter, StreamNumber=stream number, PosInStream=parameter you want, KindOfInfo=name, text, measure, options name(language) measure(language) information how to
    00178     size_t Set (const String &ToSet, size_t FilePos, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String()); //Get info, FilePos=File position, StreamKind=General video audio text chapter, StreamNumber=stream number, PosInStream=parameter you want, KindOfInfo=name text measure options name (language) measure (language) information how to, KindOfSearch=which Kind Of information Parameter must be searched?
    00179
    00180     //Output_Buffered
    00187     char* Output_Buffer_Get (size_t FilePos, size_t &Output_Buffer_Size);
    00188
    00189     //Info
    00195     String        Option (const String &Option, const String &Value=String());
    00201     static String Option_Static (const String &Option, const String &Value=String());
    00209     size_t                  State_Get ();
    00215     size_t                  Count_Get (size_t FilePos, stream_t StreamKind, size_t StreamNumber=(size_t)-1);
    00218     size_t                  Count_Get ();
    00219
    00220 private :
    00221     void* Internal;
    00222 };
    00223
    00224 } //NameSpace
    00225 #endif