MediaInfoLib: MediaInfoLib::MediaInfoList Class Reference

MediaInfoLib 0.7

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Members

Public Member Functions | Static Public Member Functions | List of all members
MediaInfoLib::MediaInfoList Class Reference

MediaInfoList. More...

`#include <MediaInfoList.h>`

## Public Member Functions
| MediaInfoList (size_t Count_Init=64)
| Constructor. More...
size_t | Open (const String &File, const fileoptions_t Options=FileOption_Nothing)
| Open files. More...
size_t | Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0)
| Open a stream (Init) More...
size_t | Open_Buffer_Continue (size_t FilePos, const ZenLib::int8u *Buffer, size_t Buffer_Size)
| Open a stream (Continue) More...
ZenLib::int64u | Open_Buffer_Continue_GoTo_Get (size_t FilePos)
| Open a stream (Get the needed file Offset) More...
size_t | Open_Buffer_Finalize (size_t FilePos)
| Open a stream (Finalize) More...
size_t | Save (size_t FilePos)
| Save the file. More...
void | Close (size_t FilePos=(size_t)-1)
| (NOT IMPLEMENTED YET) Save all files More...
String | Inform (size_t FilePos=(size_t)-1, size_t Reserved=0)
| Get all details about a file. More...
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) More...
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) More...
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) More...
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) More...
char * | Output_Buffer_Get (size_t FilePos, size_t &Output_Buffer_Size)
| Output buffer retrieving. More...
String | Option (const String &Option, const String &Value=String())
size_t | State_Get ()
| (NOT IMPLEMENTED YET) Get the state of the library More...
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. More...
size_t | Count_Get ()
| Get the count of opened files. More...

## Static Public Member Functions
static String | Option_Static (const String &Option, const String &Value=String())

## Detailed Description

MediaInfoList.

Version
  0.7

Definition at line 53 of file MediaInfoList.h.

## Constructor & Destructor Documentation

MediaInfoLib::MediaInfoList::MediaInfoList | ( | size_t | Count_Init = `64` | ) |

Constructor.

Parameters

  Count_Init | optimization information: How many files do you plan to handle?

## Member Function Documentation

void MediaInfoLib::MediaInfoList::Close | ( | size_t | FilePos = `(size_t)-1` | ) |

(NOT IMPLEMENTED YET) Save all files

(NOT IMPLEMENTED YET) Save all files opened before with Open() (modifications of tags)

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )

Return values

  Count | of files saved

size_t MediaInfoLib::MediaInfoList::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.

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  StreamKind | Kind of stream (general, video, audio...)
  StreamNumber | Stream number in this kind of stream (first, second...)

Returns
  The count of fields for this stream kind / stream number if stream number is provided, else the count of streams for this stream kind

size_t MediaInfoLib::MediaInfoList::Count_Get | ( |  | ) |

Get the count of opened files.

Returns
  Count of files opened

String MediaInfoLib::MediaInfoList::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)

Get a piece of information about a file (parameter is an integer)

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  StreamKind | Kind of stream (general, video, audio...)
  StreamNumber | Stream number in Kind of stream (first, second...)
  Parameter | Parameter you are looking for in the stream (Codec, width, bitrate...), in integer format (first parameter, second parameter...)
  KindOfInfo | Kind of information you want about the parameter (the text, the measure, the help...)

Returns
  a string about information you search
  an empty string if there is a problem

String MediaInfoLib::MediaInfoList::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)

Get a piece of information about a file (parameter is a string)

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  StreamKind | Kind of stream (general, video, audio...)
  StreamNumber | Stream number in Kind of stream (first, second...)
  Parameter | Parameter you are looking for in the stream (Codec, width, bitrate...), in string format ("Codec", "Width"...) See MediaInfo::Option("Info_Parameters") to have the full list
  KindOfInfo | Kind of information you want about the parameter (the text, the measure, the help...)
  KindOfSearch | Where to look for the parameter

Returns
  a string about information you search
  an empty string if there is a problem

String MediaInfoLib::MediaInfoList::Inform | ( | size_t | FilePos = `(size_t)-1`,
|  | size_t | Reserved = `0`
| ) |  |

Get all details about a file.

Get all details about a file in one string

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  Reserved | Deprecated, do not use it anymore

Precondition
  You can change default presentation with Inform_Set()

Returns
  Text with information about the file

size_t MediaInfoLib::MediaInfoList::Open | ( | const String & | File,
|  | const fileoptions_t | Options = `FileOption_Nothing`
| ) |  |

Open files.

Open one or more files and collect information about them (technical information and tags)

Parameters

  File | Full name of file(s) to open or Full name of folder(s) to open
  Options,: | FileOption_Recursive = Recursive mode for folders FileOption_Close = Close all already opened files before

Returns
  Number of files successfuly added

size_t MediaInfoLib::MediaInfoList::Open_Buffer_Continue | ( | size_t | FilePos,
|  | const ZenLib::int8u * | Buffer,
|  | size_t | Buffer_Size
| ) |  |

Open a stream (Continue)

Open a stream and collect information about it (technical information and tags)

Parameters

  FilePos | File position
  Buffer | pointer to the stream
  Buffer_Size | Count of bytes to read

Return values

  0 | failed
  1 | succeed

ZenLib::int64u MediaInfoLib::MediaInfoList::Open_Buffer_Continue_GoTo_Get | ( | size_t | FilePos | ) |

Open a stream (Get the needed file Offset)

Open a stream and collect information about it (technical information and tags)

Parameters

  FilePos | File position

Returns
  the needed offset of the file
  File size if no more bytes are needed

size_t MediaInfoLib::MediaInfoList::Open_Buffer_Finalize | ( | size_t | FilePos | ) |

Open a stream (Finalize)

Open a stream and collect information about it (technical information and tags)

Parameters

  FilePos | File position

Return values

  0 | failed
  1 | succeed

size_t MediaInfoLib::MediaInfoList::Open_Buffer_Init | ( | ZenLib::int64u | File_Size = `(ZenLib::int64u)-1`,
|  | ZenLib::int64u | File_Offset = `0`
| ) |  |

Open a stream (Init)

Open a stream and collect information about it (technical information and tags)

Parameters

  File_Size | Estimated file size
  File_Offset | Offset of the file (if we don't have the beginning of the file)

Return values

  0 | failed
  1 | succeed

String MediaInfoLib::MediaInfoList::Option | ( | const String & | Option,
|  | const String & | Value = `String()`
| ) |  |

Configure or get information about MediaInfoLib

Parameters

  Option | The name of option
  Value | The value of option

Returns
  Depend of the option: by default "" (nothing) means No, other means Yes

Postcondition
  Known options are: See MediaInfo::Option()

static String MediaInfoLib::MediaInfoList::Option_Static | ( | const String & | Option,
|  | const String & | Value = `String()`
| ) |  |
| static

Configure or get information about MediaInfoLib (static version)

Parameters

  Option | The name of option
  Value | The value of option

Returns
  Depend of the option: by default "" (nothing) means No, other means Yes

Postcondition
  Known options are: See MediaInfo::Option()

char* MediaInfoLib::MediaInfoList::Output_Buffer_Get | ( | size_t | FilePos,
|  | size_t & | Output_Buffer_Size
| ) |  |

Output buffer retrieving.

Output buffer retrieving, used for File_Duplicate option.

Parameters

  FilePos | File position
  Output_Buffer_Size | A pointer to the variable that receives the size of the buffer Note: you must use all the size of the buffer before the next call to this procedure

Returns
  A pointer on the output buffer, NULL if there is nothing in the buffer

size_t MediaInfoLib::MediaInfoList::Save | ( | size_t | FilePos | ) |

Save the file.

Save the file opened before with Open() (modifications of tags)

Parameters

  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )

Return values

  0 | failed
  1 | succeed

size_t MediaInfoLib::MediaInfoList::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)

(NOT IMPLEMENTED YET) Set a piece of information about a file (parameter is an int)

Warning
  Not yet implemented, do not use it

Parameters

  ToSet | Piece of information
  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  StreamKind | Kind of stream (general, video, audio...)
  StreamNumber | Stream number in Kind of stream (first, second...)
  Parameter | Parameter you are looking for in the stream (Codec, width, bitrate...), in integer format (first parameter, second parameter...)
  OldValue | The old value of the parameter if OldValue is empty and ToSet is filled: tag is added if OldValue is filled and ToSet is filled: tag is replaced if OldValue is filled and ToSet is empty: tag is deleted

Return values

  >0 | succeed
  0 | failed

size_t MediaInfoLib::MediaInfoList::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)

Warning
  Not yet implemented, do not use it

Parameters

  ToSet | Piece of information
  FilePos | File position (you can know the position in searching the filename with MediaInfoList::Get(FilePos, 0, 0, "CompleteName") )
  StreamKind | Kind of stream (general, video, audio...)
  StreamNumber | Stream number in Kind of stream (first, second...)
  Parameter | Parameter you are looking for in the stream (Codec, width, bitrate...), in string format ("Codec", "Width"...) See Option("Info_Parameters") to have the full list
  OldValue | The old value of the parameter if OldValue is empty and ToSet is filled: tag is added if OldValue is filled and ToSet is filled: tag is replaced if OldValue is filled and ToSet is empty: tag is deleted

Return values

  >0 | succeed
  0 | failed

size_t MediaInfoLib::MediaInfoList::State_Get | ( |  | ) |

(NOT IMPLEMENTED YET) Get the state of the library

Return values

  <1000 | No information is available for the file yet
  >=1000_<5000 | Only local (into the file) information is available, getting Internet information (titles only) is no finished yet
  5000 | (only if Internet connection is accepted) User interaction is needed (use Option() with "Internet_Title_Get") Warning: even there is only one possible, user interaction (or the software) is needed
  >5000<=10000 | Only local (into the file) information is available, getting Internet information (all) is no finished yet
  <10000 | Done

The documentation for this class was generated from the following file:

- MediaInfoList.h