13 static bool g_format_peak(
float p_value,
char p_buffer[text_buffer_size]);
52 operator const char * ()
const {
return m_buffer;}
61 operator const char * ()
const {
return m_buffer;}
79 virtual double get_length()
const = 0;
84 virtual void set_length(
double p_length) = 0;
92 virtual t_size meta_get_count()
const = 0;
94 virtual const char* meta_enum_name(
t_size p_index)
const = 0;
96 virtual t_size meta_enum_value_count(
t_size p_index)
const = 0;
98 virtual const char* meta_enum_value(
t_size p_index,
t_size p_value_number)
const = 0;
100 virtual t_size meta_find_ex(
const char * p_name,
t_size p_name_length)
const;
102 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;
104 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;
106 virtual void meta_remove_mask(
const bit_array & p_mask) = 0;
108 virtual void meta_reorder(
const t_size * p_order) = 0;
110 virtual void meta_remove_values(
t_size p_index,
const bit_array & p_mask) = 0;
112 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;
115 virtual t_size info_get_count()
const = 0;
117 virtual const char* info_enum_name(
t_size p_index)
const = 0;
119 virtual const char* info_enum_value(
t_size p_index)
const = 0;
121 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;
123 virtual void info_remove_mask(
const bit_array & p_mask) = 0;
125 virtual t_size info_find_ex(
const char * p_name,
t_size p_name_length)
const;
130 virtual void copy_meta(
const file_info & p_source);
132 virtual void copy_info(
const file_info & p_source);
134 bool meta_exists_ex(
const char * p_name,
t_size p_name_length)
const;
135 void meta_remove_field_ex(
const char * p_name,
t_size p_name_length);
136 void meta_remove_index(
t_size p_index);
137 void meta_remove_all();
139 const char * meta_get_ex(
const char * p_name,
t_size p_name_length,
t_size p_index)
const;
140 t_size meta_get_count_by_name_ex(
const char * p_name,
t_size p_name_length)
const;
141 void meta_add_value_ex(
t_size p_index,
const char * p_value,
t_size p_value_length);
142 t_size meta_add_ex(
const char * p_name,
t_size p_name_length,
const char * p_value,
t_size p_value_length);
143 t_size meta_calc_total_value_count()
const;
144 bool meta_format(
const char * p_name,
pfc::string_base & p_out,
const char * separator =
", ")
const;
148 bool info_exists_ex(
const char * p_name,
t_size p_name_length)
const;
149 void info_remove_index(
t_size p_index);
150 void info_remove_all();
151 bool info_remove_ex(
const char * p_name,
t_size p_name_length);
152 const char * info_get_ex(
const char * p_name,
t_size p_name_length)
const;
154 inline t_size meta_find(
const char * p_name)
const {
return meta_find_ex(p_name,pfc_infinite);}
155 inline bool meta_exists(
const char * p_name)
const {
return meta_exists_ex(p_name,pfc_infinite);}
157 inline t_size meta_set(
const char * p_name,
const char * p_value) {
return meta_set_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
159 inline void meta_add_value(
t_size p_index,
const char * p_value) {meta_add_value_ex(p_index,p_value,pfc_infinite);}
160 inline const char*
meta_get(
const char * p_name,
t_size p_index)
const {
return meta_get_ex(p_name,pfc_infinite,p_index);}
162 inline t_size meta_add(
const char * p_name,
const char * p_value) {
return meta_add_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
167 inline t_size info_set(
const char * p_name,
const char * p_value) {
return info_set_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
168 inline t_size info_find(
const char * p_name)
const {
return info_find_ex(p_name,pfc_infinite);}
169 inline bool info_exists(
const char * p_name)
const {
return info_exists_ex(p_name,pfc_infinite);}
170 inline bool info_remove(
const char * p_name) {
return info_remove_ex(p_name,pfc_infinite);}
171 inline const char *
info_get(
const char * p_name)
const {
return info_get_ex(p_name,pfc_infinite);}
173 bool info_set_replaygain_ex(
const char * p_name,
t_size p_name_len,
const char * p_value,
t_size p_value_len);
174 inline bool info_set_replaygain(
const char * p_name,
const char * p_value) {
return info_set_replaygain_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
175 void info_set_replaygain_auto_ex(
const char * p_name,
t_size p_name_len,
const char * p_value,
t_size p_value_len);
176 inline void info_set_replaygain_auto(
const char * p_name,
const char * p_value) {info_set_replaygain_auto_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
182 void copy_meta_single_by_name_ex(
const file_info & p_source,
const char * p_name,
t_size p_name_length);
183 void copy_info_single_by_name_ex(
const file_info & p_source,
const char * p_name,
t_size p_name_length);
187 void reset_replaygain();
188 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);
190 void overwrite_info(
const file_info & p_source);
191 void overwrite_meta(
const file_info & p_source);
193 t_int64 info_get_int(
const char * name)
const;
194 t_int64 info_get_length_samples()
const;
195 double info_get_float(
const char * name)
const;
196 void info_set_int(
const char * name,
t_int64 value);
197 void info_set_float(
const char * name,
double value,
unsigned precision,
bool force_sign =
false,
const char * unit = 0);
198 void info_set_replaygain_track_gain(
float value);
199 void info_set_replaygain_album_gain(
float value);
200 void info_set_replaygain_track_peak(
float value);
201 void info_set_replaygain_album_peak(
float value);
208 void info_set_wfx_chanMask(uint32_t val);
209 uint32_t info_get_wfx_chanMask()
const;
211 bool is_encoding_lossy()
const;
214 void info_calculate_bitrate(
t_filesize p_filesize,
double p_length);
216 unsigned info_get_decoded_bps()
const;
223 void _add_tag(
const file_info & otherTag);
225 void merge_fallback(
const file_info & fallback);
227 bool are_meta_fields_identical(
t_size p_index1,
t_size p_index2)
const;
232 static bool g_is_meta_equal_debug(
const file_info & p_item1,
const file_info & p_item2);
238 t_size __meta_add_unsafe(
const char * p_name,
const char * p_value) {
return meta_set_nocheck_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
243 t_size __info_add_unsafe(
const char * p_name,
const char * p_value) {
return info_set_nocheck_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
247 static bool g_is_valid_field_name(
const char * p_name,
t_size p_length = pfc_infinite);
253 void to_console()
const;
255 static bool field_is_person(
const char * fieldName);
256 static bool field_is_title(
const char * fieldName);
260 void from_mem(
const void * memPtr,
size_t memSize);
268 void copy_meta_single_nocheck(
const file_info & p_source,
t_size p_index);
269 void copy_info_single_nocheck(
const file_info & p_source,
t_size p_index);
270 void copy_meta_single_by_name_nocheck_ex(
const file_info & p_source,
const char * p_name,
t_size p_name_length);
271 void copy_info_single_by_name_nocheck_ex(
const file_info & p_source,
const char * p_name,
t_size p_name_length);
275 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;
276 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;
277 inline t_size meta_set_nocheck(
const char * p_name,
const char * p_value) {
return meta_set_nocheck_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
278 inline t_size info_set_nocheck(
const char * p_name,
const char * p_value) {
return info_set_nocheck_ex(p_name,pfc_infinite,p_value,pfc_infinite);}
void info_set_bitrate(t_int64 val)
void meta_modify_value(t_size p_index, t_size p_value_index, const char *p_value)
void set_album_gain_text(const char *p_text, t_size p_text_len=pfc_infinite)
void copy_meta_single_rename(const file_info &p_source, t_size p_index, const char *p_new_name)
void info_set_bitrate_vbr(t_int64 val)
bool is_track_peak_present() const
t_int64 info_get_bitrate_vbr() const
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 - c...
bool format_track_gain(char p_buffer[text_buffer_size]) const
bool set_from_meta(const char *p_name, const char *p_value)
t_size meta_add(const char *p_name, const char *p_value)
bool info_exists(const char *p_name) const
static bool g_format_peak(float p_value, char p_buffer[text_buffer_size])
Bit array interface class, constant version (you can only retrieve values). Range of valid indexes d...
int compare(t1 const &p1, t2 const &p2)
const char * info_get(const char *p_name) const
void copy_meta_single_by_name(const file_info &p_source, const char *p_name)
bool info_remove(const char *p_name)
static bool g_equal(const replaygain_info &item1, const replaygain_info &item2)
static const replaygain_info replaygain_info_invalid
void meta_add_value(t_size p_index, const char *p_value)
bool format_album_peak(char p_buffer[text_buffer_size]) const
Structure containing ReplayGain scan results from some playable object, also providing various helper...
bool info_set_replaygain(const char *p_name, const char *p_value)
t_size meta_set_nocheck(const char *p_name, const char *p_value)
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 - c...
void copy_meta_single_by_name_nocheck(const file_info &p_source, const char *p_name)
const char * meta_get(const char *p_name, t_size p_index) const
Main interface class for information about some playable object.
void _copy_meta_single_nocheck(const file_info &p_source, t_size p_index)
void meta_remove_field(const char *p_name)
string8_fastalloc string_formatter
t_size info_set_nocheck(const char *p_name, const char *p_value)
static bool g_is_meta_replaygain(const char *p_name, t_size p_name_len=pfc_infinite)
static bool g_format_gain(float p_value, char p_buffer[text_buffer_size])
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 - c...
bool format_track_peak(char p_buffer[text_buffer_size]) const
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 - c...
t_size info_set(const char *p_name, const char *p_value)
void set_album_peak_text(const char *p_text, t_size p_text_len=pfc_infinite)
void set_track_peak_text(const char *p_text, t_size p_text_len=pfc_infinite)
bool operator==(const replaygain_info &item1, const replaygain_info &item2)
t_int64 info_get_bitrate() const
bool meta_exists(const char *p_name) const
t_size meta_get_count_by_name(const char *p_name) const
void meta_insert_value(t_size p_index, t_size p_value_index, const char *p_value)
void copy_info_single_by_name(const file_info &p_source, const char *p_name)
static replaygain_info g_merge(replaygain_info r1, replaygain_info r2)
t_size info_find(const char *p_name) const
bool format_album_gain(char p_buffer[text_buffer_size]) const
t_uint64 t_filesize
Type used for file size related variables.
static bool field_name_equals(const char *n1, const char *n2)
bool is_album_peak_present() const
bool is_track_gain_present() const
bool set_from_meta_ex(const char *p_name, t_size p_name_len, const char *p_value, t_size p_value_len)
bool operator!=(const replaygain_info &item1, const replaygain_info &item2)
t_size meta_set(const char *p_name, const char *p_value)
bool is_album_gain_present() const
This is free and unencumbered software released into the public domain Anyone is free to copy
const file_info & operator=(const file_info &p_source)
void info_set_replaygain_auto(const char *p_name, const char *p_value)
pfc::string::comparatorCaseInsensitiveASCII field_name_comparator
void copy_info_single_by_name_nocheck(const file_info &p_source, const char *p_name)
void set_track_gain_text(const char *p_text, t_size p_text_len=pfc_infinite)
t_size meta_find(const char *p_name) const
char t_text_buffer[text_buffer_size]