Mercurial > foo_out_sdl
comparison foosdk/sdk/foobar2000/SDK/file_info.h @ 1:20d02a178406 default tip
*: check in everything else
yay
| author | Paper <paper@tflc.us> |
|---|---|
| date | Mon, 05 Jan 2026 02:15:46 -0500 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 0:e9bb126753e7 | 1:20d02a178406 |
|---|---|
| 1 #pragma once | |
| 2 #include "audio_chunk.h" | |
| 3 #include <functional> | |
| 4 | |
| 5 //! Structure containing ReplayGain scan results from some playable object, also providing various helper methods to manipulate those results. | |
| 6 struct replaygain_info | |
| 7 { | |
| 8 static constexpr float peak_invalid = -1, gain_invalid = -1000; | |
| 9 | |
| 10 float m_album_gain = gain_invalid, m_track_gain = gain_invalid; | |
| 11 float m_album_peak = peak_invalid, m_track_peak = peak_invalid; | |
| 12 | |
| 13 enum {text_buffer_size = 16 }; | |
| 14 typedef char t_text_buffer[text_buffer_size]; | |
| 15 | |
| 16 | |
| 17 static bool g_format_gain(float p_value,char p_buffer[text_buffer_size]); | |
| 18 static bool g_format_peak(float p_value,char p_buffer[text_buffer_size]); | |
| 19 static bool g_format_peak_db(float p_value, char p_buffer[text_buffer_size]); | |
| 20 | |
| 21 inline bool format_album_gain(char p_buffer[text_buffer_size]) const {return g_format_gain(m_album_gain,p_buffer);} | |
| 22 inline bool format_track_gain(char p_buffer[text_buffer_size]) const {return g_format_gain(m_track_gain,p_buffer);} | |
| 23 inline bool format_album_peak(char p_buffer[text_buffer_size]) const {return g_format_peak(m_album_peak,p_buffer);} | |
| 24 inline bool format_track_peak(char p_buffer[text_buffer_size]) const {return g_format_peak(m_track_peak,p_buffer);} | |
| 25 | |
| 26 | |
| 27 typedef std::function<void(const char*, const char*)> for_each_t; | |
| 28 void for_each(for_each_t) const; | |
| 29 | |
| 30 static float g_parse_gain_text(const char * p_text, t_size p_text_len = SIZE_MAX); | |
| 31 void set_album_gain_text(const char * p_text,t_size p_text_len = SIZE_MAX); | |
| 32 void set_track_gain_text(const char * p_text,t_size p_text_len = SIZE_MAX); | |
| 33 void set_album_peak_text(const char * p_text,t_size p_text_len = SIZE_MAX); | |
| 34 void set_track_peak_text(const char * p_text,t_size p_text_len = SIZE_MAX); | |
| 35 | |
| 36 static bool g_is_meta_replaygain(const char * p_name,t_size p_name_len = SIZE_MAX); | |
| 37 bool set_from_meta_ex(const char * p_name,t_size p_name_len,const char * p_value,t_size p_value_len); | |
| 38 inline bool set_from_meta(const char * p_name,const char * p_value) {return set_from_meta_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 39 | |
| 40 inline bool is_album_gain_present() const {return m_album_gain != gain_invalid;} | |
| 41 inline bool is_track_gain_present() const {return m_track_gain != gain_invalid;} | |
| 42 inline bool is_album_peak_present() const {return m_album_peak != peak_invalid;} | |
| 43 inline bool is_track_peak_present() const {return m_track_peak != peak_invalid;} | |
| 44 | |
| 45 inline void remove_album_gain() {m_album_gain = gain_invalid;} | |
| 46 inline void remove_track_gain() {m_track_gain = gain_invalid;} | |
| 47 inline void remove_album_peak() {m_album_peak = peak_invalid;} | |
| 48 inline void remove_track_peak() {m_track_peak = peak_invalid;} | |
| 49 | |
| 50 float anyGain(bool bPreferAlbum = false) const; | |
| 51 | |
| 52 t_size get_value_count(); | |
| 53 | |
| 54 static replaygain_info g_merge(replaygain_info r1,replaygain_info r2); | |
| 55 | |
| 56 static bool g_equalLoose( const replaygain_info & item1, const replaygain_info & item2); | |
| 57 static bool g_equal(const replaygain_info & item1,const replaygain_info & item2); | |
| 58 | |
| 59 void reset(); | |
| 60 void clear() { reset(); } | |
| 61 void clear_gain() { m_album_gain = m_track_gain = gain_invalid; } | |
| 62 void clear_peak() { m_album_peak = m_track_peak = peak_invalid; } | |
| 63 | |
| 64 // Alter gain/peak info, if available, by <delta> dB - after file gain has been altered by other means | |
| 65 void adjust(double deltaDB); | |
| 66 }; | |
| 67 | |
| 68 class format_rg_gain { | |
| 69 public: | |
| 70 format_rg_gain(float val) {replaygain_info::g_format_gain(val, m_buffer);} | |
| 71 | |
| 72 operator const char * () const {return m_buffer;} | |
| 73 const char * c_str() const { return m_buffer; } | |
| 74 private: | |
| 75 replaygain_info::t_text_buffer m_buffer; | |
| 76 }; | |
| 77 | |
| 78 class format_rg_peak { | |
| 79 public: | |
| 80 format_rg_peak(float val) {replaygain_info::g_format_peak(val, m_buffer);} | |
| 81 | |
| 82 operator const char * () const {return m_buffer;} | |
| 83 const char * c_str() const { return m_buffer; } | |
| 84 private: | |
| 85 replaygain_info::t_text_buffer m_buffer; | |
| 86 }; | |
| 87 | |
| 88 inline bool operator==(const replaygain_info & item1,const replaygain_info & item2) {return replaygain_info::g_equal(item1,item2);} | |
| 89 inline bool operator!=(const replaygain_info & item1,const replaygain_info & item2) {return !replaygain_info::g_equal(item1,item2);} | |
| 90 | |
| 91 static const replaygain_info replaygain_info_invalid = {replaygain_info::gain_invalid,replaygain_info::gain_invalid,replaygain_info::peak_invalid,replaygain_info::peak_invalid}; | |
| 92 | |
| 93 | |
| 94 //! Main interface class for information about some playable object. | |
| 95 class NOVTABLE file_info { | |
| 96 public: | |
| 97 //! Retrieves audio duration, in seconds. \n | |
| 98 //! Note that the reported duration should not be assumed to be the exact length of the track -\n | |
| 99 //! with many popular audio formats, exact duration is impossible to determine without performing a full decode pass;\n | |
| 100 //! with other formats, the decoded data may be shorter than reported due to truncation other damage. \n | |
| 101 //! Length of 0 indicates unknown or infinite (no seekbar shown). | |
| 102 virtual double get_length() const = 0; | |
| 103 //! Sets audio duration, in seconds. \n | |
| 104 //! Note that the reported duration should not be assumed to be the exact length of the track -\n | |
| 105 //! with many popular audio formats, exact duration is impossible to determine without performing a full decode pass;\n | |
| 106 //! with other formats, the decoded data may be shorter than reported due to truncation other damage. \n | |
| 107 //! Length of 0 indicates unknown or infinite (no seekbar shown). | |
| 108 virtual void set_length(double p_length) = 0; | |
| 109 | |
| 110 //! Sets ReplayGain information. | |
| 111 virtual void set_replaygain(const replaygain_info & p_info) = 0; | |
| 112 //! Retrieves ReplayGain information. | |
| 113 virtual replaygain_info get_replaygain() const = 0; | |
| 114 | |
| 115 //! Retrieves count of metadata entries. | |
| 116 virtual t_size meta_get_count() const = 0; | |
| 117 //! Retrieves the name of metadata entry of specified index. Return value is a null-terminated UTF-8 encoded string. | |
| 118 virtual const char* meta_enum_name(t_size p_index) const = 0; | |
| 119 //! Retrieves count of values in metadata entry of specified index. The value is always equal to or greater than 1. | |
| 120 virtual t_size meta_enum_value_count(t_size p_index) const = 0; | |
| 121 //! Retrieves specified value from specified metadata entry. Return value is a null-terminated UTF-8 encoded string. | |
| 122 virtual const char* meta_enum_value(t_size p_index,t_size p_value_number) const = 0; | |
| 123 //! Finds index of metadata entry of specified name. Returns infinite when not found. | |
| 124 virtual t_size meta_find_ex(const char * p_name,t_size p_name_length) const; | |
| 125 //! 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. | |
| 126 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; | |
| 127 //! Inserts a new value into specified metadata entry. | |
| 128 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; | |
| 129 //! Removes metadata entries according to specified bit mask. | |
| 130 virtual void meta_remove_mask(const bit_array & p_mask) = 0; | |
| 131 //! Reorders metadata entries according to specified permutation. | |
| 132 virtual void meta_reorder(const t_size * p_order) = 0; | |
| 133 //! Removes values according to specified bit mask from specified metadata entry. If all values are removed, entire metadata entry is removed as well. | |
| 134 virtual void meta_remove_values(t_size p_index,const bit_array & p_mask) = 0; | |
| 135 //! Alters specified value in specified metadata entry. | |
| 136 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; | |
| 137 | |
| 138 //! Retrieves number of technical info entries. | |
| 139 virtual t_size info_get_count() const = 0; | |
| 140 //! Retrieves the name of specified technical info entry. Return value is a null-terminated UTF-8 encoded string. | |
| 141 virtual const char* info_enum_name(t_size p_index) const = 0; | |
| 142 //! Retrieves the value of specified technical info entry. Return value is a null-terminated UTF-8 encoded string. | |
| 143 virtual const char* info_enum_value(t_size p_index) const = 0; | |
| 144 //! 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. | |
| 145 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; | |
| 146 //! Removes technical info entries indicated by specified bit mask. | |
| 147 virtual void info_remove_mask(const bit_array & p_mask) = 0; | |
| 148 //! Finds technical info entry of specified name. Returns index of found entry on success, infinite on failure. | |
| 149 virtual t_size info_find_ex(const char * p_name,t_size p_name_length) const; | |
| 150 | |
| 151 //! Copies entire file_info contents from specified file_info object. | |
| 152 virtual void copy(const file_info & p_source);//virtualized for performance reasons, can be faster in two-pass | |
| 153 //! Copies metadata from specified file_info object. | |
| 154 virtual void copy_meta(const file_info & p_source);//virtualized for performance reasons, can be faster in two-pass | |
| 155 //! Copies technical info from specified file_info object. | |
| 156 virtual void copy_info(const file_info & p_source);//virtualized for performance reasons, can be faster in two-pass | |
| 157 | |
| 158 bool meta_exists_ex(const char * p_name,t_size p_name_length) const; | |
| 159 void meta_remove_field_ex(const char * p_name,t_size p_name_length); | |
| 160 void meta_remove_index(t_size p_index); | |
| 161 void meta_remove_all(); | |
| 162 void meta_remove_value(t_size p_index,t_size p_value); | |
| 163 const char * meta_get_ex(const char * p_name,t_size p_name_length,t_size p_index) const; | |
| 164 t_size meta_get_count_by_name_ex(const char * p_name,t_size p_name_length) const; | |
| 165 void meta_add_value_ex(t_size p_index,const char * p_value,t_size p_value_length); | |
| 166 t_size meta_add_ex(const char * p_name,t_size p_name_length,const char * p_value,t_size p_value_length); | |
| 167 t_size meta_calc_total_value_count() const; | |
| 168 bool meta_format(const char * p_name,pfc::string_base & p_out, const char * separator = ", ") const; | |
| 169 void meta_format_entry(t_size index, pfc::string_base & p_out, const char * separator = ", ") const;//same as meta_format but takes index instead of meta name. | |
| 170 | |
| 171 typedef std::function<void(const char*, const char*)> meta_enumerate_t; | |
| 172 void meta_enumerate(meta_enumerate_t) const; | |
| 173 | |
| 174 bool info_exists_ex(const char * p_name,t_size p_name_length) const; | |
| 175 void info_remove_index(t_size p_index); | |
| 176 void info_remove_all(); | |
| 177 bool info_remove_ex(const char * p_name,t_size p_name_length); | |
| 178 const char * info_get_ex(const char * p_name,t_size p_name_length) const; | |
| 179 | |
| 180 inline t_size meta_find(const char* p_name) const { PFC_ASSERT(p_name != nullptr); return meta_find_ex(p_name, SIZE_MAX); } | |
| 181 inline bool meta_exists(const char* p_name) const { PFC_ASSERT(p_name != nullptr); return meta_exists_ex(p_name, SIZE_MAX); } | |
| 182 bool meta_value_exists( const char * name, const char * value, bool insensitive = false ) const; | |
| 183 inline void meta_remove_field(const char* p_name) { PFC_ASSERT(p_name != nullptr); meta_remove_field_ex(p_name, SIZE_MAX); } | |
| 184 inline t_size meta_set(const char* p_name, const char* p_value) { PFC_ASSERT(p_name != nullptr && p_value != nullptr); return meta_set_ex(p_name, SIZE_MAX, p_value, SIZE_MAX); } | |
| 185 inline void meta_insert_value(t_size p_index,t_size p_value_index,const char * p_value) {meta_insert_value_ex(p_index,p_value_index,p_value,SIZE_MAX);} | |
| 186 inline void meta_add_value(t_size p_index,const char * p_value) {meta_add_value_ex(p_index,p_value,SIZE_MAX);} | |
| 187 inline const char* meta_get(const char* p_name, t_size p_index) const { PFC_ASSERT(p_name != nullptr); return meta_get_ex(p_name, SIZE_MAX, p_index); } | |
| 188 inline t_size meta_get_count_by_name(const char* p_name) const { PFC_ASSERT(p_name != nullptr); return meta_get_count_by_name_ex(p_name, SIZE_MAX); } | |
| 189 inline t_size meta_add(const char* p_name, const char* p_value) { PFC_ASSERT(p_name != nullptr && p_value != nullptr); return meta_add_ex(p_name, SIZE_MAX, p_value, SIZE_MAX); } | |
| 190 inline void meta_modify_value(t_size p_index,t_size p_value_index,const char * p_value) {meta_modify_value_ex(p_index,p_value_index,p_value,SIZE_MAX);} | |
| 191 | |
| 192 | |
| 193 | |
| 194 inline t_size info_set(const char * p_name,const char * p_value) {return info_set_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 195 inline t_size info_find(const char * p_name) const {return info_find_ex(p_name,SIZE_MAX);} | |
| 196 inline bool info_exists(const char * p_name) const {return info_exists_ex(p_name,SIZE_MAX);} | |
| 197 inline bool info_remove(const char * p_name) {return info_remove_ex(p_name,SIZE_MAX);} | |
| 198 inline const char * info_get(const char * p_name) const {return info_get_ex(p_name,SIZE_MAX);} | |
| 199 | |
| 200 bool info_set_replaygain_ex(const char * p_name,t_size p_name_len,const char * p_value,t_size p_value_len); | |
| 201 inline bool info_set_replaygain(const char * p_name,const char * p_value) {return info_set_replaygain_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 202 void info_set_replaygain_auto_ex(const char * p_name,t_size p_name_len,const char * p_value,t_size p_value_len); | |
| 203 inline void info_set_replaygain_auto(const char * p_name,const char * p_value) {info_set_replaygain_auto_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 204 | |
| 205 | |
| 206 | |
| 207 void copy_meta_single(const file_info & p_source,t_size p_index); | |
| 208 void copy_info_single(const file_info & p_source,t_size p_index); | |
| 209 void copy_meta_single_by_name_ex(const file_info & p_source,const char * p_name,t_size p_name_length); | |
| 210 void copy_info_single_by_name_ex(const file_info & p_source,const char * p_name,t_size p_name_length); | |
| 211 inline void copy_meta_single_by_name(const file_info & p_source,const char * p_name) {copy_meta_single_by_name_ex(p_source,p_name,SIZE_MAX);} | |
| 212 inline void copy_info_single_by_name(const file_info & p_source,const char * p_name) {copy_info_single_by_name_ex(p_source,p_name,SIZE_MAX);} | |
| 213 void reset(); | |
| 214 void reset_replaygain(); | |
| 215 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); | |
| 216 inline void copy_meta_single_rename(const file_info & p_source,t_size p_index,const char * p_new_name) {copy_meta_single_rename_ex(p_source,p_index,p_new_name,SIZE_MAX);} | |
| 217 void overwrite_info(const file_info & p_source); | |
| 218 void overwrite_meta(const file_info & p_source); | |
| 219 bool overwrite_meta_if_changed( const file_info & source ); | |
| 220 | |
| 221 t_int64 info_get_int(const char * name) const; | |
| 222 t_int64 info_get_length_samples() const; | |
| 223 double info_get_float(const char * name) const; | |
| 224 void info_set_int(const char * name,t_int64 value); | |
| 225 void info_set_float(const char * name,double value,unsigned precision,bool force_sign = false,const char * unit = 0); | |
| 226 void info_set_replaygain_track_gain(float value); | |
| 227 void info_set_replaygain_album_gain(float value); | |
| 228 void info_set_replaygain_track_peak(float value); | |
| 229 void info_set_replaygain_album_peak(float value); | |
| 230 | |
| 231 inline t_int64 info_get_bitrate_vbr() const {return info_get_int("bitrate_dynamic");} | |
| 232 inline void info_set_bitrate_vbr(t_int64 val_kbps) {info_set_int("bitrate_dynamic",val_kbps);} | |
| 233 inline t_int64 info_get_bitrate() const {return info_get_int("bitrate");} | |
| 234 inline void info_set_bitrate(t_int64 val_kbps) { PFC_ASSERT(val_kbps > 0); info_set_int("bitrate", val_kbps); } | |
| 235 | |
| 236 | |
| 237 //! Set number of channels | |
| 238 void info_set_channels(uint32_t); | |
| 239 //! Set number of channels and channel mask. Channel mask info will only be set if it's not plain mono or stereo. | |
| 240 void info_set_channels_ex(uint32_t channels, uint32_t mask); | |
| 241 | |
| 242 //! Tidy channel mask info. If channel mask is invalid or plain mono/stereo, it will be dropped. | |
| 243 void info_tidy_channels(); | |
| 244 | |
| 245 //! Set just channel mask info. Typically coupled with info_set_channels(). See also: info_set_channels_ex(). | |
| 246 void info_set_wfx_chanMask(uint32_t val); | |
| 247 //! Returns channel mask value. 0 if not set, use default for the channel count then. | |
| 248 uint32_t info_get_wfx_chanMask() const; | |
| 249 | |
| 250 //! Is a lossy codec? | |
| 251 bool is_encoding_lossy() const; | |
| 252 //! Is explicitly reported as lossless codec? | |
| 253 bool is_encoding_lossless() const; | |
| 254 //! Is lossless/PCM that can't be sanely represented in this fb2k build due to audio_sample limitations? \n | |
| 255 //! Always returns false in 64-bit fb2k. | |
| 256 bool is_encoding_overkill() const; | |
| 257 //! Floating-point PCM used? | |
| 258 bool is_encoding_float() const; | |
| 259 //! Helper; sets bit depth of lossless/PCM format. | |
| 260 void info_set_bitspersample(uint32_t val, bool isFloat = false); | |
| 261 | |
| 262 //! Sets bitrate value using file size in bytes and duration. | |
| 263 void info_calculate_bitrate(uint64_t p_filesize,double p_length); | |
| 264 | |
| 265 //! Returns decoder-output bit depth - what sample format is being converted to foobar2000 audio_sample. 0 if unknown. | |
| 266 unsigned info_get_decoded_bps() const; | |
| 267 | |
| 268 //! Foramts long codec name ( codec + profile ) | |
| 269 bool info_get_codec_long( pfc::string_base & out, const char * delim = " / ") const; | |
| 270 | |
| 271 //! Simplified title getter, returns fallback value if title not set, useful for debugging. | |
| 272 const char * meta_get_title( const char * fallback = "(untitled)") const; | |
| 273 | |
| 274 private: | |
| 275 void merge(const pfc::list_base_const_t<const file_info*> & p_sources); | |
| 276 public: | |
| 277 | |
| 278 void _set_tag(const file_info & tag); | |
| 279 void _add_tag(const file_info & otherTag); | |
| 280 | |
| 281 void merge_fallback(const file_info & fallback); | |
| 282 | |
| 283 bool are_meta_fields_identical(t_size p_index1,t_size p_index2) const; | |
| 284 | |
| 285 inline const file_info & operator=(const file_info & p_source) {copy(p_source);return *this;} | |
| 286 | |
| 287 static bool g_is_meta_equal(const file_info & p_item1,const file_info & p_item2); | |
| 288 static bool g_is_meta_equal_debug(const file_info & p_item1,const file_info & p_item2); | |
| 289 static bool g_is_info_equal(const file_info & p_item1,const file_info & p_item2); | |
| 290 static bool g_is_meta_subset_debug(const file_info& superset, const file_info& subset); | |
| 291 | |
| 292 //! 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. | |
| 293 t_size __meta_add_unsafe_ex(const char * p_name,t_size p_name_length,const char * p_value,t_size p_value_length) {return meta_set_nocheck_ex(p_name,p_name_length,p_value,p_value_length);} | |
| 294 //! 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. | |
| 295 t_size __meta_add_unsafe(const char * p_name,const char * p_value) {return meta_set_nocheck_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 296 | |
| 297 //! 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. | |
| 298 t_size __info_add_unsafe_ex(const char * p_name,t_size p_name_length,const char * p_value,t_size p_value_length) {return info_set_nocheck_ex(p_name,p_name_length,p_value,p_value_length);} | |
| 299 //! 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. | |
| 300 t_size __info_add_unsafe(const char * p_name,const char * p_value) {return info_set_nocheck_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 301 | |
| 302 void _copy_meta_single_nocheck(const file_info & p_source,t_size p_index) {copy_meta_single_nocheck(p_source, p_index);} | |
| 303 | |
| 304 static bool g_is_valid_field_name(const char * p_name,t_size p_length = SIZE_MAX); | |
| 305 //typedef pfc::comparator_stricmp_ascii field_name_comparator; | |
| 306 typedef pfc::string::comparatorCaseInsensitiveASCII field_name_comparator; | |
| 307 | |
| 308 static bool field_name_equals(const char * n1, const char * n2) {return field_name_comparator::compare(n1, n2) == 0;} | |
| 309 static bool field_value_equals(const file_info& i1, size_t meta1, const file_info& i2, size_t meta2); | |
| 310 | |
| 311 void to_console() const; | |
| 312 void to_formatter(pfc::string_formatter&) const; | |
| 313 static bool field_is_person(const char * fieldName); | |
| 314 static bool field_is_title(const char * fieldName); | |
| 315 | |
| 316 void to_stream( stream_writer * stream, abort_callback & abort ) const; | |
| 317 void from_stream( stream_reader * stream, abort_callback & abort ); | |
| 318 void from_mem( const void * memPtr, size_t memSize); | |
| 319 | |
| 320 //! Returns ESTIMATED audio chunk spec from what has been put in the file_info. \n | |
| 321 //! Provided for convenience. Do not rely on it for processing decoded data. | |
| 322 audio_chunk::spec_t audio_chunk_spec() const; | |
| 323 | |
| 324 void set_audio_chunk_spec(audio_chunk::spec_t); | |
| 325 | |
| 326 //! Normalize values to Unicode form C | |
| 327 //! @returns true if changed, false otherwise | |
| 328 bool unicode_normalize_C(); | |
| 329 | |
| 330 | |
| 331 #ifdef FOOBAR2000_MOBILE | |
| 332 void info_set_pictures( const GUID * guids, size_t size ); | |
| 333 pfc::array_t<GUID> info_get_pictures( ) const; | |
| 334 bool info_have_picture(const GUID&) const; | |
| 335 uint64_t makeMetaHash() const; | |
| 336 #endif | |
| 337 protected: | |
| 338 file_info() {} | |
| 339 ~file_info() {} | |
| 340 void copy_meta_single_nocheck(const file_info & p_source,t_size p_index); | |
| 341 void copy_info_single_nocheck(const file_info & p_source,t_size p_index); | |
| 342 void copy_meta_single_by_name_nocheck_ex(const file_info & p_source,const char * p_name,t_size p_name_length); | |
| 343 void copy_info_single_by_name_nocheck_ex(const file_info & p_source,const char * p_name,t_size p_name_length); | |
| 344 inline void copy_meta_single_by_name_nocheck(const file_info & p_source,const char * p_name) {copy_meta_single_by_name_nocheck_ex(p_source,p_name,SIZE_MAX);} | |
| 345 inline void copy_info_single_by_name_nocheck(const file_info & p_source,const char * p_name) {copy_info_single_by_name_nocheck_ex(p_source,p_name,SIZE_MAX);} | |
| 346 | |
| 347 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; | |
| 348 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; | |
| 349 inline t_size meta_set_nocheck(const char * p_name,const char * p_value) {return meta_set_nocheck_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 350 inline t_size info_set_nocheck(const char * p_name,const char * p_value) {return info_set_nocheck_ex(p_name,SIZE_MAX,p_value,SIZE_MAX);} | |
| 351 }; |
