MediaInfoList.h
/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license that can
* be found in the License.html file in the root of the source tree.
*/
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Give information about a lot of media files
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//---------------------------------------------------------------------------
#ifndef MediaInfoListH
#define MediaInfoListH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "MediaInfo/MediaInfo.h"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#undef MEDIAINFO_EXP
#if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
#ifdef MEDIAINFO_DLL_EXPORT
#define MEDIAINFO_EXP
#else
#define MEDIAINFO_EXP
#endif
#else //defined(_WIN32) && !defined(__MINGW32__)
#if __GNUC__ >= 4
#define MEDIAINFO_EXP __attribute__ ((visibility("default")))
#else
#define MEDIAINFO_EXP
#endif
#endif //defined(_WIN32) && !defined(__MINGW32__)
#if !defined(__WINDOWS__)
#define __stdcall //Supported only on windows
#endif
//---------------------------------------------------------------------------
namespace MediaInfoLib
{
class MediaInfoList_Internal;
//***************************************************************************
//***************************************************************************
class MEDIAINFO_EXP MediaInfoList
{
public :
//Class
MediaInfoList (size_t Count_Init=64);
~MediaInfoList ();
//Files
size_t Open (const String &File, const fileoptions_t Options=FileOption_Nothing);
size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
size_t Open_Buffer_Continue (size_t FilePos, const ZenLib::int8u* Buffer, size_t Buffer_Size);
ZenLib::int64u Open_Buffer_Continue_GoTo_Get (size_t FilePos);
size_t Open_Buffer_Finalize (size_t FilePos);
size_t Save (size_t FilePos);
void Close (size_t FilePos=(size_t)-1);
String Inform (size_t FilePos=(size_t)-1, size_t Reserved=0);
//Get
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
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?
//Set
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
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?
//Output_Buffered
char* Output_Buffer_Get (size_t FilePos, size_t &Output_Buffer_Size);
//Info
String Option (const String &Option, const String &Value=String());
static String Option_Static (const String &Option, const String &Value=String());
size_t State_Get ();
size_t Count_Get (size_t FilePos, stream_t StreamKind, size_t StreamNumber=(size_t)-1);
size_t Count_Get ();
private :
MediaInfoList_Internal* Internal;
//Constructor
MediaInfoList (const MediaInfoList&); // Prevent copy-construction
MediaInfoList& operator=(const MediaInfoList&); // Prevent assignment
};
} //NameSpace
#endif
MediaInfoLib::MediaInfoList::Output_Buffer_Get
char * Output_Buffer_Get(size_t FilePos, size_t &Output_Buffer_Size)
Output buffer retrieving.
MediaInfoLib::MediaInfoList::MediaInfoList
MediaInfoList(size_t Count_Init=64)
Constructor.
MediaInfoLib::MediaInfoList::Inform
String Inform(size_t FilePos=(size_t) -1, size_t Reserved=0)
Get all details about a file.
MediaInfoLib::MediaInfoList::Open_Buffer_Continue_GoTo_Get
ZenLib::int64u Open_Buffer_Continue_GoTo_Get(size_t FilePos)
Open a stream (Get the needed file Offset).
MediaInfoLib::MediaInfoList::Count_Get
size_t Count_Get()
Get the count of opened files.
MediaInfoLib::MediaInfoList::Get
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 a piece of information about a file (parameter is a string).
MediaInfoLib::MediaInfoList::Option
String Option(const String &Option, const String &Value=String())
MediaInfoLib::MediaInfoList::Get
String Get(size_t FilePos, stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t KindOfInfo=Info_Text)
Get a piece of information about a file (parameter is an integer).
MediaInfoLib::MediaInfoList::Close
void Close(size_t FilePos=(size_t) -1)
(NOT IMPLEMENTED YET) Save all files
MediaInfoLib::MediaInfoList::Set
size_t Set(const String &ToSet, size_t FilePos, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String())
(NOT IMPLEMENTED YET) Get information about a file (parameter is a string)
MediaInfoLib::MediaInfoList::Save
size_t Save(size_t FilePos)
Save the file.
MediaInfoLib::MediaInfoList::Open_Buffer_Continue
size_t Open_Buffer_Continue(size_t FilePos, const ZenLib::int8u *Buffer, size_t Buffer_Size)
Open a stream (Continue).
MediaInfoLib::MediaInfoList::Option_Static
static String Option_Static(const String &Option, const String &Value=String())
MediaInfoLib::MediaInfoList::State_Get
size_t State_Get()
(NOT IMPLEMENTED YET) Get the state of the library
MediaInfoLib::MediaInfoList::Set
size_t Set(const String &ToSet, size_t FilePos, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String())
(NOT IMPLEMENTED YET) Set a piece of information about a file (parameter is an int)
MediaInfoLib::MediaInfoList::Count_Get
size_t Count_Get(size_t FilePos, stream_t StreamKind, size_t StreamNumber=(size_t) -1)
Count of streams, or count of piece of information in this stream.
MediaInfoLib::MediaInfoList::Open_Buffer_Finalize
size_t Open_Buffer_Finalize(size_t FilePos)
Open a stream (Finalize).
MediaInfoLib::MediaInfoList::Open
size_t Open(const String &File, const fileoptions_t Options=FileOption_Nothing)
Open files.
MediaInfoLib::MediaInfoList::Open_Buffer_Init
size_t Open_Buffer_Init(ZenLib::int64u File_Size=(ZenLib::int64u) -1, ZenLib::int64u File_Offset=0)
Open a stream (Init).
MediaInfoLib
defined(_WIN32)
Definition MediaInfo_Const.h:24
MediaInfoLib::String
std::basic_string< MediaInfoLib::Char > String
Unicode/Ansi independant string.
Definition MediaInfo_Const.h:125
MediaInfoLib::info_t
info_t
Kind of information.
Definition MediaInfo_Const.h:74
MediaInfoLib::Info_Text
@ Info_Text
InfoKind = Value of parameter.
Definition MediaInfo_Const.h:76
MediaInfoLib::Info_Name
@ Info_Name
InfoKind = Unique name of parameter.
Definition MediaInfo_Const.h:75
MediaInfoLib::fileoptions_t
fileoptions_t
File opening options.
Definition MediaInfo_Const.h:103
MediaInfoLib::stream_t
stream_t
Kinds of Stream.
Definition MediaInfo_Const.h:61