file_info Class Reference

Main interface class for information about some playable object. More...

#include <file_info.h>

Inheritance diagram for file_info:

file_info_const_impl file_info_impl

List of all members.

Public Types

typedef
pfc::comparator_stricmp_ascii 
field_name_comparator

Public Member Functions

virtual double get_length () const =0
 Retrieves length, in seconds.
virtual void set_length (double p_length)=0
 Sets length, in seconds.
virtual void set_replaygain (const replaygain_info &p_info)=0
 Sets ReplayGain information.
virtual replaygain_info get_replaygain () const =0
 Retrieves ReplayGain information.
virtual t_size meta_get_count () const =0
 Retrieves count of metadata entries.
virtual const char * meta_enum_name (t_size p_index) const =0
 Retrieves the name of metadata entry of specified index. Return value is a null-terminated UTF-8 encoded string.
virtual t_size meta_enum_value_count (t_size p_index) const =0
 Retrieves count of values in metadata entry of specified index. The value is always equal to or greater than 1.
virtual const char * meta_enum_value (t_size p_index, t_size p_value_number) const =0
 Retrieves specified value from specified metadata entry. Return value is a null-terminated UTF-8 encoded string.
virtual t_size meta_find_ex (const char *p_name, t_size p_name_length) const
 Finds index of metadata entry of specified name. Returns infinite when not found.
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
 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.
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
 Inserts a new value into specified metadata entry.
virtual void meta_remove_mask (const bit_array &p_mask)=0
 Removes metadata entries according to specified bit mask.
virtual void meta_reorder (const t_size *p_order)=0
 Reorders metadata entries according to specified permutation.
virtual void meta_remove_values (t_size p_index, const bit_array &p_mask)=0
 Removes values according to specified bit mask from specified metadata entry. If all values are removed, entire metadata entry is removed as well.
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
 Alters specified value in specified metadata entry.
virtual t_size info_get_count () const =0
 Retrieves number of technical info entries.
virtual const char * info_enum_name (t_size p_index) const =0
 Retrieves the name of specified technical info entry. Return value is a null-terminated UTF-8 encoded string.
virtual const char * info_enum_value (t_size p_index) const =0
 Retrieves the value of specified technical info entry. Return value is a null-terminated UTF-8 encoded string.
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
 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.
virtual void info_remove_mask (const bit_array &p_mask)=0
 Removes technical info entries indicated by specified bit mask.
virtual t_size info_find_ex (const char *p_name, t_size p_name_length) const
 Finds technical info entry of specified name. Returns index of found entry on success, infinite on failure.
virtual void copy (const file_info &p_source)
 Copies entire file_info contents from specified file_info object.
virtual void copy_meta (const file_info &p_source)
 Copies metadata from specified file_info object.
virtual void copy_info (const file_info &p_source)
 Copies technical info from specified file_info object.
bool meta_exists_ex (const char *p_name, t_size p_name_length) const
void meta_remove_field_ex (const char *p_name, t_size p_name_length)
void meta_remove_index (t_size p_index)
void meta_remove_all ()
void meta_remove_value (t_size p_index, t_size p_value)
const char * meta_get_ex (const char *p_name, t_size p_name_length, t_size p_index) const
t_size meta_get_count_by_name_ex (const char *p_name, t_size p_name_length) const
void meta_add_value_ex (t_size p_index, const char *p_value, t_size p_value_length)
t_size meta_add_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)
t_size meta_calc_total_value_count () const
bool meta_format (const char *p_name, pfc::string_base &p_out) const
bool info_exists_ex (const char *p_name, t_size p_name_length) const
void info_remove_index (t_size p_index)
void info_remove_all ()
bool info_remove_ex (const char *p_name, t_size p_name_length)
const char * info_get_ex (const char *p_name, t_size p_name_length) const
t_size meta_find (const char *p_name) const
bool meta_exists (const char *p_name) const
void meta_remove_field (const char *p_name)
t_size meta_set (const char *p_name, const char *p_value)
void meta_insert_value (t_size p_index, t_size p_value_index, const char *p_value)
void meta_add_value (t_size p_index, const char *p_value)
const char * meta_get (const char *p_name, t_size p_index) const
t_size meta_get_count_by_name (const char *p_name) const
t_size meta_add (const char *p_name, const char *p_value)
void meta_modify_value (t_size p_index, t_size p_value_index, const char *p_value)
t_size info_set (const char *p_name, const char *p_value)
t_size info_find (const char *p_name) const
t_size info_exists (const char *p_name) const
bool info_remove (const char *p_name)
const char * info_get (const char *p_name) const
bool info_set_replaygain_ex (const char *p_name, t_size p_name_len, const char *p_value, t_size p_value_len)
bool info_set_replaygain (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)
void info_set_replaygain_auto (const char *p_name, const char *p_value)
void copy_meta_single (const file_info &p_source, t_size p_index)
void copy_info_single (const file_info &p_source, t_size p_index)
void copy_meta_single_by_name_ex (const file_info &p_source, const char *p_name, t_size p_name_length)
void copy_info_single_by_name_ex (const file_info &p_source, const char *p_name, t_size p_name_length)
void copy_meta_single_by_name (const file_info &p_source, const char *p_name)
void copy_info_single_by_name (const file_info &p_source, const char *p_name)
void reset ()
void reset_replaygain ()
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 copy_meta_single_rename (const file_info &p_source, t_size p_index, const char *p_new_name)
void overwrite_info (const file_info &p_source)
t_int64 info_get_int (const char *name) const
t_int64 info_get_length_samples () const
double info_get_float (const char *name) const
void info_set_int (const char *name, t_int64 value)
void info_set_float (const char *name, double value, unsigned precision, bool force_sign=false, const char *unit=0)
void info_set_replaygain_track_gain (float value)
void info_set_replaygain_album_gain (float value)
void info_set_replaygain_track_peak (float value)
void info_set_replaygain_album_peak (float value)
t_int64 info_get_bitrate_vbr () const
void info_set_bitrate_vbr (t_int64 val)
t_int64 info_get_bitrate () const
void info_set_bitrate (t_int64 val)
bool is_encoding_lossy () const
void info_calculate_bitrate (t_filesize p_filesize, double p_length)
unsigned info_get_decoded_bps () const
void merge (const pfc::list_base_const_t< const file_info * > &p_sources)
bool are_meta_fields_identical (t_size p_index1, t_size p_index2) const
const file_infooperator= (const file_info &p_source)
t_size __meta_add_unsafe_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)
 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.
t_size __meta_add_unsafe (const char *p_name, const char *p_value)
 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.
t_size __info_add_unsafe_ex (const char *p_name, t_size p_name_length, const char *p_value, t_size p_value_length)
 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.
t_size __info_add_unsafe (const char *p_name, const char *p_value)
 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.

Static Public Member Functions

static bool g_is_meta_equal (const file_info &p_item1, const file_info &p_item2)
static bool g_is_info_equal (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=infinite)

Protected Member Functions

 file_info ()
 ~file_info ()
void copy_meta_single_nocheck (const file_info &p_source, t_size p_index)
void copy_info_single_nocheck (const file_info &p_source, t_size p_index)
void copy_meta_single_by_name_nocheck_ex (const file_info &p_source, const char *p_name, t_size p_name_length)
void copy_info_single_by_name_nocheck_ex (const file_info &p_source, const char *p_name, t_size p_name_length)
void copy_meta_single_by_name_nocheck (const file_info &p_source, const char *p_name)
void copy_info_single_by_name_nocheck (const file_info &p_source, const char *p_name)
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
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)
t_size info_set_nocheck (const char *p_name, const char *p_value)


Detailed Description

Main interface class for information about some playable object.

Member Typedef Documentation


Constructor & Destructor Documentation

file_info::file_info (  )  [inline, protected]

file_info::~file_info (  )  [inline, protected]


Member Function Documentation

virtual double file_info::get_length (  )  const [pure virtual]

Retrieves length, in seconds.

Implemented in file_info_impl, and file_info_const_impl.

virtual void file_info::set_length ( double  p_length  )  [pure virtual]

Sets length, in seconds.

Implemented in file_info_impl.

virtual void file_info::set_replaygain ( const replaygain_info p_info  )  [pure virtual]

Sets ReplayGain information.

Implemented in file_info_impl.

virtual replaygain_info file_info::get_replaygain (  )  const [pure virtual]

Retrieves ReplayGain information.

Implemented in file_info_impl, and file_info_const_impl.

virtual t_size file_info::meta_get_count (  )  const [pure virtual]

Retrieves count of metadata entries.

Implemented in file_info_impl, and file_info_const_impl.

virtual const char* file_info::meta_enum_name ( t_size  p_index  )  const [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.

virtual t_size file_info::meta_enum_value_count ( t_size  p_index  )  const [pure virtual]

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.

virtual const char* file_info::meta_enum_value ( t_size  p_index,
t_size  p_value_number 
) const [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.

virtual t_size file_info::meta_find_ex ( const char *  p_name,
t_size  p_name_length 
) const [virtual]

Finds index of metadata entry of specified name. Returns infinite when not found.

Reimplemented in file_info_const_impl.

virtual t_size file_info::meta_set_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [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.

virtual void file_info::meta_insert_value_ex ( t_size  p_index,
t_size  p_value_index,
const char *  p_value,
t_size  p_value_length 
) [pure virtual]

Inserts a new value into specified metadata entry.

Implemented in file_info_impl.

virtual void file_info::meta_remove_mask ( const bit_array p_mask  )  [pure virtual]

Removes metadata entries according to specified bit mask.

Implemented in file_info_impl.

virtual void file_info::meta_reorder ( const t_size p_order  )  [pure virtual]

Reorders metadata entries according to specified permutation.

Implemented in file_info_impl.

virtual void file_info::meta_remove_values ( t_size  p_index,
const bit_array p_mask 
) [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.

virtual void file_info::meta_modify_value_ex ( t_size  p_index,
t_size  p_value_index,
const char *  p_value,
t_size  p_value_length 
) [pure virtual]

Alters specified value in specified metadata entry.

Implemented in file_info_impl.

virtual t_size file_info::info_get_count (  )  const [pure virtual]

Retrieves number of technical info entries.

Implemented in file_info_impl, and file_info_const_impl.

virtual const char* file_info::info_enum_name ( t_size  p_index  )  const [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.

virtual const char* file_info::info_enum_value ( t_size  p_index  )  const [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.

virtual t_size file_info::info_set_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [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.

virtual void file_info::info_remove_mask ( const bit_array p_mask  )  [pure virtual]

Removes technical info entries indicated by specified bit mask.

Implemented in file_info_impl.

virtual t_size file_info::info_find_ex ( const char *  p_name,
t_size  p_name_length 
) const [virtual]

Finds technical info entry of specified name. Returns index of found entry on success, infinite on failure.

virtual void file_info::copy ( const file_info p_source  )  [virtual]

Copies entire file_info contents from specified file_info object.

Reimplemented in file_info_const_impl.

virtual void file_info::copy_meta ( const file_info p_source  )  [virtual]

Copies metadata from specified file_info object.

Reimplemented in file_info_impl.

virtual void file_info::copy_info ( const file_info p_source  )  [virtual]

Copies technical info from specified file_info object.

Reimplemented in file_info_impl.

bool file_info::meta_exists_ex ( const char *  p_name,
t_size  p_name_length 
) const

void file_info::meta_remove_field_ex ( const char *  p_name,
t_size  p_name_length 
)

void file_info::meta_remove_index ( t_size  p_index  ) 

void file_info::meta_remove_all (  ) 

void file_info::meta_remove_value ( t_size  p_index,
t_size  p_value 
)

const char* file_info::meta_get_ex ( const char *  p_name,
t_size  p_name_length,
t_size  p_index 
) const

t_size file_info::meta_get_count_by_name_ex ( const char *  p_name,
t_size  p_name_length 
) const

void file_info::meta_add_value_ex ( t_size  p_index,
const char *  p_value,
t_size  p_value_length 
)

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 
)

t_size file_info::meta_calc_total_value_count (  )  const

bool file_info::meta_format ( const char *  p_name,
pfc::string_base p_out 
) const

bool file_info::info_exists_ex ( const char *  p_name,
t_size  p_name_length 
) const

void file_info::info_remove_index ( t_size  p_index  ) 

void file_info::info_remove_all (  ) 

bool file_info::info_remove_ex ( const char *  p_name,
t_size  p_name_length 
)

const char* file_info::info_get_ex ( const char *  p_name,
t_size  p_name_length 
) const

t_size file_info::meta_find ( const char *  p_name  )  const [inline]

bool file_info::meta_exists ( const char *  p_name  )  const [inline]

void file_info::meta_remove_field ( const char *  p_name  )  [inline]

t_size file_info::meta_set ( const char *  p_name,
const char *  p_value 
) [inline]

void file_info::meta_insert_value ( t_size  p_index,
t_size  p_value_index,
const char *  p_value 
) [inline]

void file_info::meta_add_value ( t_size  p_index,
const char *  p_value 
) [inline]

const char* file_info::meta_get ( const char *  p_name,
t_size  p_index 
) const [inline]

t_size file_info::meta_get_count_by_name ( const char *  p_name  )  const [inline]

t_size file_info::meta_add ( const char *  p_name,
const char *  p_value 
) [inline]

void file_info::meta_modify_value ( t_size  p_index,
t_size  p_value_index,
const char *  p_value 
) [inline]

t_size file_info::info_set ( const char *  p_name,
const char *  p_value 
) [inline]

t_size file_info::info_find ( const char *  p_name  )  const [inline]

t_size file_info::info_exists ( const char *  p_name  )  const [inline]

bool file_info::info_remove ( const char *  p_name  )  [inline]

const char* file_info::info_get ( const char *  p_name  )  const [inline]

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 
)

bool file_info::info_set_replaygain ( const char *  p_name,
const char *  p_value 
) [inline]

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 
)

void file_info::info_set_replaygain_auto ( const char *  p_name,
const char *  p_value 
) [inline]

void file_info::copy_meta_single ( const file_info p_source,
t_size  p_index 
)

void file_info::copy_info_single ( const file_info p_source,
t_size  p_index 
)

void file_info::copy_meta_single_by_name_ex ( const file_info p_source,
const char *  p_name,
t_size  p_name_length 
)

void file_info::copy_info_single_by_name_ex ( const file_info p_source,
const char *  p_name,
t_size  p_name_length 
)

void file_info::copy_meta_single_by_name ( const file_info p_source,
const char *  p_name 
) [inline]

void file_info::copy_info_single_by_name ( const file_info p_source,
const char *  p_name 
) [inline]

void file_info::reset (  ) 

Reimplemented in file_info_const_impl.

void file_info::reset_replaygain (  ) 

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 
)

void file_info::copy_meta_single_rename ( const file_info p_source,
t_size  p_index,
const char *  p_new_name 
) [inline]

void file_info::overwrite_info ( const file_info p_source  ) 

t_int64 file_info::info_get_int ( const char *  name  )  const

t_int64 file_info::info_get_length_samples (  )  const

double file_info::info_get_float ( const char *  name  )  const

void file_info::info_set_int ( const char *  name,
t_int64  value 
)

void file_info::info_set_float ( const char *  name,
double  value,
unsigned  precision,
bool  force_sign = false,
const char *  unit = 0 
)

void file_info::info_set_replaygain_track_gain ( float  value  ) 

void file_info::info_set_replaygain_album_gain ( float  value  ) 

void file_info::info_set_replaygain_track_peak ( float  value  ) 

void file_info::info_set_replaygain_album_peak ( float  value  ) 

t_int64 file_info::info_get_bitrate_vbr (  )  const [inline]

void file_info::info_set_bitrate_vbr ( t_int64  val  )  [inline]

t_int64 file_info::info_get_bitrate (  )  const [inline]

void file_info::info_set_bitrate ( t_int64  val  )  [inline]

bool file_info::is_encoding_lossy (  )  const

void file_info::info_calculate_bitrate ( t_filesize  p_filesize,
double  p_length 
)

unsigned file_info::info_get_decoded_bps (  )  const

void file_info::merge ( const pfc::list_base_const_t< const file_info * > &  p_sources  ) 

bool file_info::are_meta_fields_identical ( t_size  p_index1,
t_size  p_index2 
) const

const file_info& file_info::operator= ( const file_info p_source  )  [inline]

Reimplemented in file_info_const_impl.

static bool file_info::g_is_meta_equal ( const file_info p_item1,
const file_info p_item2 
) [static]

static bool file_info::g_is_info_equal ( const file_info p_item1,
const file_info p_item2 
) [static]

t_size file_info::__meta_add_unsafe_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [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.

t_size file_info::__meta_add_unsafe ( const char *  p_name,
const char *  p_value 
) [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.

t_size file_info::__info_add_unsafe_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [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.

t_size file_info::__info_add_unsafe ( const char *  p_name,
const char *  p_value 
) [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.

static bool file_info::g_is_valid_field_name ( const char *  p_name,
t_size  p_length = infinite 
) [static]

void file_info::copy_meta_single_nocheck ( const file_info p_source,
t_size  p_index 
) [protected]

void file_info::copy_info_single_nocheck ( const file_info p_source,
t_size  p_index 
) [protected]

void file_info::copy_meta_single_by_name_nocheck_ex ( const file_info p_source,
const char *  p_name,
t_size  p_name_length 
) [protected]

void file_info::copy_info_single_by_name_nocheck_ex ( const file_info p_source,
const char *  p_name,
t_size  p_name_length 
) [protected]

void file_info::copy_meta_single_by_name_nocheck ( const file_info p_source,
const char *  p_name 
) [inline, protected]

void file_info::copy_info_single_by_name_nocheck ( const file_info p_source,
const char *  p_name 
) [inline, protected]

virtual t_size file_info::meta_set_nocheck_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [protected, pure virtual]

Implemented in file_info_impl.

virtual t_size file_info::info_set_nocheck_ex ( const char *  p_name,
t_size  p_name_length,
const char *  p_value,
t_size  p_value_length 
) [protected, pure virtual]

Implemented in file_info_impl.

t_size file_info::meta_set_nocheck ( const char *  p_name,
const char *  p_value 
) [inline, protected]

t_size file_info::info_set_nocheck ( const char *  p_name,
const char *  p_value 
) [inline, protected]


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

Generated on Fri Apr 18 13:56:51 2008 for foobar2000 SDK by  doxygen 1.5.5