13 if (field_index != ~0) {
22 const char * val = from->
info_get(field);
28 struct meta_merge_entry {
29 meta_merge_entry() : m_rating(0) {}
34 class meta_merge_map_enumerator {
36 meta_merge_map_enumerator(
file_info & p_out) : m_out(p_out) {
37 m_out.meta_remove_all();
39 void operator() (
const char * p_name,
const meta_merge_entry & p_entry) {
40 if (p_entry.m_data.get_size() > 0) {
41 t_size index = m_out.__meta_add_unsafe(p_name,p_entry.m_data[0]);
42 for(
t_size walk = 1; walk < p_entry.m_data.get_size(); ++walk) {
43 m_out.meta_add_value(index,p_entry.m_data[walk]);
56 for(
t_size meta_walk = 0, meta_count = in.
meta_get_count(); meta_walk < meta_count; meta_walk++ ) {
59 if (rating > entry.m_rating) {
60 entry.m_rating = rating;
62 entry.m_data.set_size(value_count);
63 for(
t_size value_walk = 0; value_walk < value_count; value_walk++ ) {
70 meta_merge_map_enumerator en(p_out);
82 else if (in_count == 1)
90 overwrite_info(*info);
103 for(in_ptr = 0; in_ptr < in_count; in_ptr++ )
108 for(field_ptr = 0; field_ptr < field_max; field_ptr++ )
115 if (!tagtype.is_empty()) tagtype +=
"|";
116 tagtype += field_value;
121 if (!tagtype.is_empty()) info_set(
"tagtype",tagtype);
128 for(
t_size n=0;n<count;n++) {
136 if (get_length() <= 0) set_length(source.
get_length());
138 for(
t_size infoWalk = 0; infoWalk < count; ++infoWalk) {
140 if (!info_exists(name)) __info_add_unsafe(name, source.
info_enum_value(infoWalk));
143 for(
t_size metaWalk = 0; metaWalk < count; ++metaWalk) {
145 if (!meta_exists(name)) _copy_meta_single_nocheck(source, metaWalk);
152 this->copy_meta(tag);
155 if (tt) this->info_set(
_tagtype, tt);
161 const char * tt1 = this->info_get(
_tagtype);
165 this->info_set(
_tagtype, PFC_string_formatter() << tt1 <<
"|" << tt2);
virtual double get_length() const =0
Retrieves audio duration, in seconds. Note that the reported duration should not be assumed to be th...
void merge(const pfc::list_base_const_t< const file_info * > &p_sources)
void enumerate(t_callback &p_callback) const
void _set_tag(const file_info &tag)
void info(const char *p_message)
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 great...
const char * info_get(const char *p_name) const
static void merge_meta(file_info &p_out, const pfc::list_base_const_t< const file_info * > &p_in)
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 encode...
static void merge_tags_copy_info(const char *field, const file_info *from, file_info *to)
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 enco...
void merge_fallback(const file_info &fallback)
Structure containing ReplayGain scan results from some playable object, also providing various helper...
static t_size merge_tags_calc_rating_by_index(const file_info &p_info, t_size p_index)
t_storage_value & find_or_add(_t_key const &p_key)
Main interface class for information about some playable object.
static t_size merge_tags_calc_rating(const file_info &p_info, const char *p_field)
virtual t_size get_count() const =0
virtual t_size meta_get_count() const =0
Retrieves count of metadata entries.
t_size info_set(const char *p_name, const char *p_value)
static const char _tagtype[]
static replaygain_info g_merge(replaygain_info r1, replaygain_info r2)
void _add_tag(const file_info &otherTag)
int stricmp_ascii(const char *s1, const char *s2)
virtual replaygain_info get_replaygain() const =0
Retrieves ReplayGain information.
string8_t< pfc::alloc_fast_aggressive > string8_fastalloc
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...
t_size meta_find(const char *p_name) const
virtual t_size info_get_count() const =0
Retrieves number of technical info entries.
void overwrite_info(const file_info &p_source)
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 enco...