foobar2000 SDK
2015-08-03
|
#include <file_info.h>
Public Types | |
typedef pfc::string::comparatorCaseInsensitiveASCII | field_name_comparator |
Public Member Functions | |
t_size | __info_add_unsafe (const char *p_name, const char *p_value) |
t_size | __info_add_unsafe_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length) |
t_size | __meta_add_unsafe (const char *p_name, const char *p_value) |
t_size | __meta_add_unsafe_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length) |
void | _add_tag (const file_info &otherTag) |
void | _copy_meta_single_nocheck (const file_info &p_source, t_size p_index) |
void | _set_tag (const file_info &tag) |
bool | are_meta_fields_identical (t_size p_index1, t_size p_index2) const |
audio_chunk::spec_t | audio_chunk_spec () const |
virtual void | copy (const file_info &p_source) |
virtual void | copy_info (const file_info &p_source) |
void | copy_info_single (const file_info &p_source, t_size p_index) |
void | copy_info_single_by_name (const file_info &p_source, const char *p_name) |
void | copy_info_single_by_name_ex (const file_info &p_source, const char *p_name, t_size p_name_length) |
virtual void | copy_meta (const file_info &p_source) |
void | copy_meta_single (const file_info &p_source, t_size p_index) |
void | copy_meta_single_by_name (const file_info &p_source, const char *p_name) |
void | copy_meta_single_by_name_ex (const file_info &p_source, const char *p_name, t_size p_name_length) |
void | copy_meta_single_rename (const file_info &p_source, t_size p_index, const char *p_new_name) |
void | copy_meta_single_rename_ex (const file_info &p_source, t_size p_index, const char *p_new_name, t_size p_new_name_length) |
void | from_mem (const void *memPtr, size_t memSize) |
void | from_stream (stream_reader *stream, abort_callback &abort) |
virtual double | get_length () const =0 |
virtual replaygain_info | get_replaygain () const =0 |
void | info_calculate_bitrate (t_filesize p_filesize, double p_length) |
virtual const char * | info_enum_name (t_size p_index) const =0 |
virtual const char * | info_enum_value (t_size p_index) const =0 |
bool | info_exists (const char *p_name) const |
bool | info_exists_ex (const char *p_name, t_size p_name_length) const |
t_size | info_find (const char *p_name) const |
virtual t_size | info_find_ex (const char *p_name, t_size p_name_length) const |
const char * | info_get (const char *p_name) const |
t_int64 | info_get_bitrate () const |
t_int64 | info_get_bitrate_vbr () const |
virtual t_size | info_get_count () const =0 |
unsigned | info_get_decoded_bps () const |
const char * | info_get_ex (const char *p_name, t_size p_name_length) const |
double | info_get_float (const char *name) const |
t_int64 | info_get_int (const char *name) const |
t_int64 | info_get_length_samples () const |
uint32_t | info_get_wfx_chanMask () const |
bool | info_remove (const char *p_name) |
void | info_remove_all () |
bool | info_remove_ex (const char *p_name, t_size p_name_length) |
void | info_remove_index (t_size p_index) |
virtual void | info_remove_mask (const bit_array &p_mask)=0 |
t_size | info_set (const char *p_name, const char *p_value) |
void | info_set_bitrate (t_int64 val) |
void | info_set_bitrate_vbr (t_int64 val) |
virtual t_size | info_set_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)=0 |
void | info_set_float (const char *name, double value, unsigned precision, bool force_sign=false, const char *unit=0) |
void | info_set_int (const char *name, t_int64 value) |
bool | info_set_replaygain (const char *p_name, const char *p_value) |
void | info_set_replaygain_album_gain (float value) |
void | info_set_replaygain_album_peak (float value) |
void | info_set_replaygain_auto (const char *p_name, const char *p_value) |
void | info_set_replaygain_auto_ex (const char *p_name, t_size p_name_len, const char *p_value, t_size p_value_len) |
bool | info_set_replaygain_ex (const char *p_name, t_size p_name_len, const char *p_value, t_size p_value_len) |
void | info_set_replaygain_track_gain (float value) |
void | info_set_replaygain_track_peak (float value) |
void | info_set_wfx_chanMask (uint32_t val) |
bool | is_encoding_lossy () const |
void | merge_fallback (const file_info &fallback) |
t_size | meta_add (const char *p_name, const char *p_value) |
t_size | meta_add_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length) |
void | meta_add_value (t_size p_index, const char *p_value) |
void | meta_add_value_ex (t_size p_index, const char *p_value, t_size p_value_length) |
t_size | meta_calc_total_value_count () const |
virtual const char * | meta_enum_name (t_size p_index) const =0 |
virtual const char * | meta_enum_value (t_size p_index, t_size p_value_number) const =0 |
virtual t_size | meta_enum_value_count (t_size p_index) const =0 |
bool | meta_exists (const char *p_name) const |
bool | meta_exists_ex (const char *p_name, t_size p_name_length) const |
t_size | meta_find (const char *p_name) const |
virtual t_size | meta_find_ex (const char *p_name, t_size p_name_length) const |
bool | meta_format (const char *p_name, pfc::string_base &p_out, const char *separator=", ") const |
void | meta_format_entry (t_size index, pfc::string_base &p_out, const char *separator=", ") const |
const char * | meta_get (const char *p_name, t_size p_index) const |
virtual t_size | meta_get_count () const =0 |
t_size | meta_get_count_by_name (const char *p_name) const |
t_size | meta_get_count_by_name_ex (const char *p_name, t_size p_name_length) const |
const char * | meta_get_ex (const char *p_name, t_size p_name_length, t_size p_index) const |
void | meta_insert_value (t_size p_index, t_size p_value_index, const char *p_value) |
virtual void | meta_insert_value_ex (t_size p_index, t_size p_value_index, const char *p_value, t_size p_value_length)=0 |
void | meta_modify_value (t_size p_index, t_size p_value_index, const char *p_value) |
virtual void | meta_modify_value_ex (t_size p_index, t_size p_value_index, const char *p_value, t_size p_value_length)=0 |
void | meta_remove_all () |
void | meta_remove_field (const char *p_name) |
void | meta_remove_field_ex (const char *p_name, t_size p_name_length) |
void | meta_remove_index (t_size p_index) |
virtual void | meta_remove_mask (const bit_array &p_mask)=0 |
void | meta_remove_value (t_size p_index, t_size p_value) |
virtual void | meta_remove_values (t_size p_index, const bit_array &p_mask)=0 |
virtual void | meta_reorder (const t_size *p_order)=0 |
t_size | meta_set (const char *p_name, const char *p_value) |
virtual t_size | meta_set_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)=0 |
const file_info & | operator= (const file_info &p_source) |
void | overwrite_info (const file_info &p_source) |
void | overwrite_meta (const file_info &p_source) |
void | reset () |
void | reset_replaygain () |
virtual void | set_length (double p_length)=0 |
virtual void | set_replaygain (const replaygain_info &p_info)=0 |
void | to_console () const |
void | to_formatter (pfc::string_formatter &) const |
void | to_stream (stream_writer *stream, abort_callback &abort) const |
Static Public Member Functions | |
static bool | field_is_person (const char *fieldName) |
static bool | field_is_title (const char *fieldName) |
static bool | field_name_equals (const char *n1, const char *n2) |
static bool | g_is_info_equal (const file_info &p_item1, const file_info &p_item2) |
static bool | g_is_meta_equal (const file_info &p_item1, const file_info &p_item2) |
static bool | g_is_meta_equal_debug (const file_info &p_item1, const file_info &p_item2) |
static bool | g_is_valid_field_name (const char *p_name, t_size p_length=pfc_infinite) |
Protected Member Functions | |
file_info () | |
~file_info () | |
void | copy_info_single_by_name_nocheck (const file_info &p_source, const char *p_name) |
void | copy_info_single_by_name_nocheck_ex (const file_info &p_source, const char *p_name, t_size p_name_length) |
void | copy_info_single_nocheck (const file_info &p_source, t_size p_index) |
void | copy_meta_single_by_name_nocheck (const file_info &p_source, const char *p_name) |
void | copy_meta_single_by_name_nocheck_ex (const file_info &p_source, const char *p_name, t_size p_name_length) |
void | copy_meta_single_nocheck (const file_info &p_source, t_size p_index) |
t_size | info_set_nocheck (const char *p_name, const char *p_value) |
virtual t_size | info_set_nocheck_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)=0 |
t_size | meta_set_nocheck (const char *p_name, const char *p_value) |
virtual t_size | meta_set_nocheck_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)=0 |
Private Member Functions | |
void | merge (const pfc::list_base_const_t< const file_info * > &p_sources) |
Main interface class for information about some playable object.
Definition at line 73 of file file_info.h.
Definition at line 249 of file file_info.h.
|
inlineprotected |
Definition at line 266 of file file_info.h.
|
inlineprotected |
Definition at line 267 of file file_info.h.
|
inline |
Unsafe - does not check whether the field already exists and will result in duplicates if it does - call only when appropriate checks have been applied externally.
Definition at line 243 of file file_info.h.
|
inline |
Unsafe - does not check whether the field already exists and will result in duplicates if it does - call only when appropriate checks have been applied externally.
Definition at line 241 of file file_info.h.
|
inline |
Unsafe - does not check whether the field already exists and will result in duplicates if it does - call only when appropriate checks have been applied externally.
Definition at line 238 of file file_info.h.
|
inline |
Unsafe - does not check whether the field already exists and will result in duplicates if it does - call only when appropriate checks have been applied externally.
Definition at line 236 of file file_info.h.
void file_info::_add_tag | ( | const file_info & | otherTag | ) |
Definition at line 158 of file file_info_merge.cpp.
Definition at line 245 of file file_info.h.
void file_info::_set_tag | ( | const file_info & | tag | ) |
Definition at line 151 of file file_info_merge.cpp.
Definition at line 363 of file file_info.cpp.
audio_chunk::spec_t file_info::audio_chunk_spec | ( | ) | const |
Returns ESTIMATED audio chunk spec from what has been put in the file_info.
Provided for convenience. Do not rely on it for processing decoded data.
Definition at line 715 of file file_info.cpp.
|
virtual |
Copies entire file_info contents from specified file_info object.
Reimplemented in file_info_const_impl.
Definition at line 166 of file file_info.cpp.
|
virtual |
Copies technical info from specified file_info object.
Reimplemented in file_info_impl.
Definition at line 156 of file file_info.cpp.
Definition at line 136 of file file_info.cpp.
|
inline |
Definition at line 185 of file file_info.h.
void file_info::copy_info_single_by_name_ex | ( | const file_info & | p_source, |
const char * | p_name, | ||
t_size | p_name_length | ||
) |
Definition at line 118 of file file_info.cpp.
|
inlineprotected |
Definition at line 273 of file file_info.h.
|
protected |
Definition at line 130 of file file_info.cpp.
Definition at line 141 of file file_info.cpp.
|
virtual |
Copies metadata from specified file_info object.
Reimplemented in file_info_impl.
Definition at line 146 of file file_info.cpp.
Definition at line 94 of file file_info.cpp.
|
inline |
Definition at line 184 of file file_info.h.
void file_info::copy_meta_single_by_name_ex | ( | const file_info & | p_source, |
const char * | p_name, | ||
t_size | p_name_length | ||
) |
Definition at line 112 of file file_info.cpp.
|
inlineprotected |
Definition at line 272 of file file_info.h.
|
protected |
Definition at line 124 of file file_info.cpp.
Definition at line 99 of file file_info.cpp.
|
inline |
Definition at line 189 of file file_info.h.
void file_info::copy_meta_single_rename_ex | ( | const file_info & | p_source, |
t_size | p_index, | ||
const char * | p_new_name, | ||
t_size | p_new_name_length | ||
) |
Definition at line 302 of file file_info.cpp.
|
static |
Definition at line 553 of file file_info.cpp.
|
static |
Definition at line 564 of file file_info.cpp.
|
inlinestatic |
Definition at line 251 of file file_info.h.
void file_info::from_mem | ( | const void * | memPtr, |
size_t | memSize | ||
) |
Definition at line 672 of file file_info.cpp.
void file_info::from_stream | ( | stream_reader * | stream, |
abort_callback & | abort | ||
) |
Definition at line 612 of file file_info.cpp.
Definition at line 474 of file file_info.cpp.
Definition at line 412 of file file_info.cpp.
|
static |
Definition at line 443 of file file_info.cpp.
|
static |
Definition at line 498 of file file_info.cpp.
|
pure virtual |
Retrieves audio duration, in seconds.
Note that the reported duration should not be assumed to be the exact length of the track -
with many popular audio formats, exact duration is impossible to determine without performing a full decode pass;
with other formats, the decoded data may be shorter than reported due to truncation other damage.
Implemented in file_info_impl, and file_info_const_impl.
|
pure virtual |
Retrieves ReplayGain information.
Implemented in file_info_impl, and file_info_const_impl.
void file_info::info_calculate_bitrate | ( | t_filesize | p_filesize, |
double | p_length | ||
) |
Definition at line 395 of file file_info.cpp.
|
pure virtual |
Retrieves the name of specified technical info entry. Return value is a null-terminated UTF-8 encoded string.
Implemented in file_info_impl, and file_info_const_impl.
|
pure virtual |
Retrieves the value of specified technical info entry. Return value is a null-terminated UTF-8 encoded string.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 169 of file file_info.h.
bool file_info::info_exists_ex | ( | const char * | p_name, |
t_size | p_name_length | ||
) | const |
Definition at line 61 of file file_info.cpp.
|
inline |
Definition at line 168 of file file_info.h.
Finds technical info entry of specified name. Returns index of found entry on success, infinite on failure.
Definition at line 52 of file file_info.cpp.
|
inline |
Definition at line 171 of file file_info.h.
|
inline |
Definition at line 205 of file file_info.h.
|
inline |
Definition at line 203 of file file_info.h.
|
pure virtual |
Retrieves number of technical info entries.
Implemented in file_info_impl, and file_info_const_impl.
unsigned file_info::info_get_decoded_bps | ( | ) | const |
Definition at line 277 of file file_info.cpp.
const char * file_info::info_get_ex | ( | const char * | p_name, |
t_size | p_name_length | ||
) | const |
Definition at line 186 of file file_info.cpp.
double file_info::info_get_float | ( | const char * | name | ) | const |
Definition at line 214 of file file_info.cpp.
t_int64 file_info::info_get_int | ( | const char * | name | ) | const |
Definition at line 193 of file file_info.cpp.
t_int64 file_info::info_get_length_samples | ( | ) | const |
Definition at line 201 of file file_info.cpp.
uint32_t file_info::info_get_wfx_chanMask | ( | ) | const |
Definition at line 544 of file file_info.cpp.
|
inline |
Definition at line 170 of file file_info.h.
void file_info::info_remove_all | ( | ) |
Definition at line 71 of file file_info.cpp.
bool file_info::info_remove_ex | ( | const char * | p_name, |
t_size | p_name_length | ||
) |
Definition at line 76 of file file_info.cpp.
void file_info::info_remove_index | ( | t_size | p_index | ) |
Definition at line 66 of file file_info.cpp.
|
pure virtual |
Removes technical info entries indicated by specified bit mask.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 167 of file file_info.h.
|
inline |
Definition at line 206 of file file_info.h.
|
inline |
Definition at line 204 of file file_info.h.
|
pure virtual |
Creates a new technical info entry with specified name and specified value. If an entry of the same name already exists, it is erased. Return value is the index of newly created entry.
Implemented in file_info_impl, and file_info_const_impl.
void file_info::info_set_float | ( | const char * | name, |
double | value, | ||
unsigned | precision, | ||
bool | force_sign = false , |
||
const char * | unit = 0 |
||
) |
Definition at line 227 of file file_info.cpp.
void file_info::info_set_int | ( | const char * | name, |
t_int64 | value | ||
) |
Definition at line 221 of file file_info.cpp.
|
inlineprotected |
Definition at line 278 of file file_info.h.
|
protectedpure virtual |
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 174 of file file_info.h.
void file_info::info_set_replaygain_album_gain | ( | float | value | ) |
Definition at line 243 of file file_info.cpp.
void file_info::info_set_replaygain_album_peak | ( | float | value | ) |
Definition at line 250 of file file_info.cpp.
|
inline |
Definition at line 176 of file file_info.h.
void file_info::info_set_replaygain_auto_ex | ( | const char * | p_name, |
t_size | p_name_len, | ||
const char * | p_value, | ||
t_size | p_value_len | ||
) |
Definition at line 349 of file file_info.cpp.
bool file_info::info_set_replaygain_ex | ( | const char * | p_name, |
t_size | p_name_len, | ||
const char * | p_value, | ||
t_size | p_value_len | ||
) |
Definition at line 338 of file file_info.cpp.
void file_info::info_set_replaygain_track_gain | ( | float | value | ) |
Definition at line 257 of file file_info.cpp.
void file_info::info_set_replaygain_track_peak | ( | float | value | ) |
Definition at line 264 of file file_info.cpp.
void file_info::info_set_wfx_chanMask | ( | uint32_t | val | ) |
Definition at line 532 of file file_info.cpp.
bool file_info::is_encoding_lossy | ( | ) | const |
Definition at line 400 of file file_info.cpp.
|
private |
Definition at line 74 of file file_info_merge.cpp.
void file_info::merge_fallback | ( | const file_info & | fallback | ) |
Definition at line 134 of file file_info_merge.cpp.
|
inline |
Definition at line 162 of file file_info.h.
t_size file_info::meta_add_ex | ( | const char * | p_name, |
t_size | p_name_length, | ||
const char * | p_value, | ||
t_size | p_value_length | ||
) |
Definition at line 314 of file file_info.cpp.
|
inline |
Definition at line 159 of file file_info.h.
Definition at line 325 of file file_info.cpp.
t_size file_info::meta_calc_total_value_count | ( | ) | const |
Definition at line 331 of file file_info.cpp.
|
pure virtual |
Retrieves the name of metadata entry of specified index. Return value is a null-terminated UTF-8 encoded string.
Implemented in file_info_impl, and file_info_const_impl.
|
pure virtual |
Retrieves specified value from specified metadata entry. Return value is a null-terminated UTF-8 encoded string.
Implemented in file_info_impl, and file_info_const_impl.
Retrieves count of values in metadata entry of specified index. The value is always equal to or greater than 1.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 155 of file file_info.h.
bool file_info::meta_exists_ex | ( | const char * | p_name, |
t_size | p_name_length | ||
) | const |
Definition at line 18 of file file_info.cpp.
|
inline |
Definition at line 154 of file file_info.h.
Finds index of metadata entry of specified name. Returns infinite when not found.
Reimplemented in file_info_const_impl.
Definition at line 8 of file file_info.cpp.
bool file_info::meta_format | ( | const char * | p_name, |
pfc::string_base & | p_out, | ||
const char * | separator = ", " |
||
) | const |
Definition at line 387 of file file_info.cpp.
void file_info::meta_format_entry | ( | t_size | index, |
pfc::string_base & | p_out, | ||
const char * | separator = ", " |
||
) | const |
Definition at line 376 of file file_info.cpp.
|
inline |
Definition at line 160 of file file_info.h.
|
pure virtual |
Retrieves count of metadata entries.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 161 of file file_info.h.
Definition at line 45 of file file_info.cpp.
const char * file_info::meta_get_ex | ( | const char * | p_name, |
t_size | p_name_length, | ||
t_size | p_index | ||
) | const |
Definition at line 177 of file file_info.cpp.
|
inline |
Definition at line 158 of file file_info.h.
|
pure virtual |
Inserts a new value into specified metadata entry.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 163 of file file_info.h.
|
pure virtual |
Alters specified value in specified metadata entry.
Implemented in file_info_impl, and file_info_const_impl.
void file_info::meta_remove_all | ( | ) |
Definition at line 35 of file file_info.cpp.
|
inline |
Definition at line 156 of file file_info.h.
void file_info::meta_remove_field_ex | ( | const char * | p_name, |
t_size | p_name_length | ||
) |
Definition at line 23 of file file_info.cpp.
void file_info::meta_remove_index | ( | t_size | p_index | ) |
Definition at line 30 of file file_info.cpp.
|
pure virtual |
Removes metadata entries according to specified bit mask.
Implemented in file_info_impl, and file_info_const_impl.
Definition at line 40 of file file_info.cpp.
|
pure virtual |
Removes values according to specified bit mask from specified metadata entry. If all values are removed, entire metadata entry is removed as well.
Implemented in file_info_impl, and file_info_const_impl.
|
pure virtual |
Reorders metadata entries according to specified permutation.
Implemented in file_info_impl, and file_info_const_impl.
|
inline |
Definition at line 157 of file file_info.h.
|
pure virtual |
Creates a new metadata entry of specified name with specified value. If an entry of same name already exists, it is erased. Return value is the index of newly created metadata entry.
Implemented in file_info_impl, and file_info_const_impl.
|
inlineprotected |
Definition at line 277 of file file_info.h.
|
protectedpure virtual |
Implemented in file_info_impl, and file_info_const_impl.
Definition at line 229 of file file_info.h.
void file_info::overwrite_info | ( | const file_info & | p_source | ) |
Definition at line 126 of file file_info_merge.cpp.
void file_info::overwrite_meta | ( | const file_info & | p_source | ) |
Definition at line 87 of file file_info.cpp.
void file_info::reset | ( | ) |
Definition at line 287 of file file_info.cpp.
void file_info::reset_replaygain | ( | ) |
Definition at line 295 of file file_info.cpp.
|
pure virtual |
Sets audio duration, in seconds.
Note that the reported duration should not be assumed to be the exact length of the track -
with many popular audio formats, exact duration is impossible to determine without performing a full decode pass;
with other formats, the decoded data may be shorter than reported due to truncation other damage.
Implemented in file_info_impl, and file_info_const_impl.
|
pure virtual |
Sets ReplayGain information.
Implemented in file_info_impl, and file_info_const_impl.
void file_info::to_console | ( | ) | const |
Definition at line 519 of file file_info.cpp.
void file_info::to_formatter | ( | pfc::string_formatter & | out | ) | const |
Definition at line 506 of file file_info.cpp.
void file_info::to_stream | ( | stream_writer * | stream, |
abort_callback & | abort | ||
) | const |
Definition at line 569 of file file_info.cpp.