MediaInfoLib  0.7
MediaInfoList.h
1 // MediaInfoList - A list of MediaInfo
2 // Copyright (C) 2002-2011 MediaArea.net SARL, Info@MediaArea.net
3 //
4 // This library is free software: you can redistribute it and/or modify it
5 // under the terms of the GNU Lesser General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // any later version.
8 //
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public License
15 // along with this library. If not, see <http://www.gnu.org/licenses/>.
16 //
17 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 // MediaInfoList
20 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 //
22 // Give information about a lot of media files
23 //
24 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
25 
26 //---------------------------------------------------------------------------
27 #ifndef MediaInfoListH
28 #define MediaInfoListH
29 //---------------------------------------------------------------------------
30 
31 //---------------------------------------------------------------------------
32 #include "MediaInfo/MediaInfo.h"
33 //---------------------------------------------------------------------------
34 
35 //---------------------------------------------------------------------------
36 #undef MEDIAINFO_EXP
37 #if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
38  #ifdef MEDIAINFO_DLL_EXPORT
39  #define MEDIAINFO_EXP
40  #else
41  #define MEDIAINFO_EXP
42  #endif
43 #else //defined(_WIN32) && !defined(__MINGW32__)
44  #if __GNUC__ >= 4
45  #define MEDIAINFO_EXP __attribute__ ((visibility("default")))
46  #else
47  #define MEDIAINFO_EXP
48  #endif
49 #endif //defined(_WIN32) && !defined(__MINGW32__)
50 
51 #if !defined(__WINDOWS__)
52  #define __stdcall //Supported only on windows
53 #endif
54 //---------------------------------------------------------------------------
55 
56 namespace MediaInfoLib
57 {
58 
59 //***************************************************************************
62 //***************************************************************************
63 
64 class MEDIAINFO_EXP MediaInfoList
65 {
66 public :
67  //Class
70  MediaInfoList (size_t Count_Init=64);
71  ~MediaInfoList ();
72 
73  //Files
82  size_t Open (const String &File, const fileoptions_t Options=FileOption_Nothing);
87  size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
93  size_t Open_Buffer_Continue (size_t FilePos, const ZenLib::int8u* Buffer, size_t Buffer_Size);
99  ZenLib::int64u Open_Buffer_Continue_GoTo_Get (size_t FilePos);
103  size_t Open_Buffer_Finalize (size_t FilePos);
110  size_t Save (size_t FilePos);
116  void Close (size_t FilePos=(size_t)-1);
117 
124  String Inform (size_t FilePos=(size_t)-1, size_t Reserved=0);
125 
126  //Get
137  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
150  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?
151 
152  //Set
165  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
178  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?
179 
180  //Output_Buffered
187  char* Output_Buffer_Get (size_t FilePos, size_t &Output_Buffer_Size);
188 
189  //Info
195  String Option (const String &Option, const String &Value=String());
201  static String Option_Static (const String &Option, const String &Value=String());
209  size_t State_Get ();
215  size_t Count_Get (size_t FilePos, stream_t StreamKind, size_t StreamNumber=(size_t)-1);
218  size_t Count_Get ();
219 
220 private :
221  void* Internal;
222 };
223 
224 } //NameSpace
225 #endif