5 "ALBUM",
"ALBUM ARTIST",
"ARTIST",
"Album",
"Album Artist",
"Artist",
"COMMENT",
"Comment",
"DATE",
"DISCNUMBER",
"Date",
6 "Discnumber",
"GENRE",
"Genre",
"TITLE",
"TOTALTRACKS",
"TRACKNUMBER",
"Title",
"TotalTracks",
"Totaltracks",
"TrackNumber",
7 "Tracknumber",
"album",
"album artist",
"artist",
"comment",
"date",
"discnumber",
"genre",
"title",
"totaltracks",
"tracknumber",
12 "bitrate",
"bitspersample",
"channels",
"codec",
"codec_profile",
"encoding",
"samplerate",
"tagtype",
"tool",
40 while(*value) *(buffer++) = *(value++);
45 #ifdef __file_info_const_impl_have_hintmap__ 52 : m_meta(p_meta), m_hintmap(p_hintmap)
59 return pfc::stricmp_ascii(m_meta[m_hintmap[p_index1]].m_name,m_meta[m_hintmap[p_index2]].m_name);
64 pfc::swap_t<file_info_const_impl::t_index>(m_hintmap[p_index1],m_hintmap[p_index2]);
71 class bsearch_callback_hintmap_impl
74 bsearch_callback_hintmap_impl(
79 : m_meta(p_meta), m_hintmap(p_hintmap), m_name(p_name), m_name_length(p_name_length)
96 #endif//__file_info_const_impl_have_hintmap__ 104 t_size stringbuffer_size = 0;
105 #ifdef __file_info_const_impl_have_hintmap__ 109 const char * optbuf[64];
115 m_meta_count = pfc::downcast_guarded<t_index>(p_source.
meta_get_count());
116 meta_size = m_meta_count *
sizeof(
meta_entry);
117 #ifdef __file_info_const_impl_have_hintmap__ 118 hintmap_size = (m_meta_count > hintmap_cutoff) ? m_meta_count *
sizeof(
t_index) : 0;
119 #endif//__file_info_const_impl_have_hintmap__ 120 for(index = 0; index < m_meta_count; index++ )
125 if (optwalk < _countof(optbuf)) optbuf[optwalk++] = opt;
126 if (opt == NULL) stringbuffer_size += strlen(name) + 1;
137 valuemap_size += val_max *
sizeof(
char*);
139 for(val = 0; val < val_max; val++ )
146 m_info_count = pfc::downcast_guarded<t_index>(p_source.
info_get_count());
147 info_size = m_info_count *
sizeof(
info_entry);
148 for(index = 0; index < m_info_count; index++ )
152 if (optwalk < _countof(optbuf)) optbuf[optwalk++] = opt;
153 if (opt == NULL) stringbuffer_size += strlen(name) + 1;
162 #ifdef __file_info_const_impl_have_hintmap__
165 meta_size + info_size + valuemap_size + stringbuffer_size);
168 char * walk = m_buffer.get_ptr();
170 #ifdef __file_info_const_impl_have_hintmap__ 172 walk += hintmap_size;
176 char ** valuemap = (
char**) walk;
177 walk += valuemap_size;
180 char * stringbuffer = walk;
184 #ifdef __file_info_const_impl_have_hintmap__ 192 for( index = 0; index < m_meta_count; index ++ )
198 const char * name_opt;
200 if (optwalk < _countof(optbuf)) name_opt = optbuf[optwalk++];
203 if (name_opt == NULL)
206 meta[index].
m_name = name_opt;
218 for( val = 0; val < val_max ; val ++ )
223 for( index = 0; index < m_info_count; index ++ )
226 const char * name_opt;
228 if (optwalk < _countof(optbuf)) name_opt = optbuf[optwalk++];
231 if (name_opt == NULL)
234 info[index].
m_name = name_opt;
241 #ifdef __file_info_const_impl_have_hintmap__ 242 if (hintmap != NULL) {
244 for(
t_size n=0;n<m_meta_count;n++) hintmap[n]=n;
245 pfc::sort(sort_callback_hintmap_impl(meta,hintmap),m_meta_count);
247 #endif//__file_info_const_impl_have_hintmap__ 253 m_meta_count = m_info_count = 0; m_length = 0; m_replaygain.reset();
258 #ifdef __file_info_const_impl_have_hintmap__ 259 if (m_hintmap != NULL) {
261 if (!
pfc::bsearch_inline_t(m_meta_count,bsearch_callback_hintmap_impl(m_meta,m_hintmap,p_name,p_name_length),result))
return ~0;
262 else return m_hintmap[result];
274 return m_meta[p_index].m_valuecount;
281 return reinterpret_cast<const char*
>(entry.
m_valuemap);
void sort(pfc::sort_callback &p_callback, t_size p_num)
virtual double get_length() const =0
Retrieves audio duration, in seconds. Note that the reported duration should not be assumed to be th...
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...
virtual int compare(t_size p_index1, t_size p_index2) const =0
int stricmp_ascii_ex(const char *const s1, t_size const len1, const char *const s2, t_size const len2)
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 const char *const standard_fieldnames[]
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...
bool bsearch_inline_t(t_size p_count, const t_callback &p_callback, t_size &p_result)
Main interface class for information about some playable object.
static char * stringbuffer_append(char *&buffer, const char *value)
static const char * optimize_infoname(const char *p_string)
virtual t_size meta_get_count() const =0
Retrieves count of metadata entries.
t_size meta_enum_value_count(t_size p_index) const
Retrieves count of values in metadata entry of specified index. The value is always equal to or great...
const char * meta_enum_value(t_size p_index, t_size p_value_number) const
Retrieves specified value from specified metadata entry. Return value is a null-terminated UTF-8 enco...
void copy(const file_info &p_source)
Copies entire file_info contents from specified file_info object.
const char *const * m_valuemap
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. ...
static const char * optimize_fieldname(const char *p_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 void swap(t_size p_index1, t_size p_index2)=0
int stricmp_ascii(const char *s1, const char *s2)
static const char *const standard_infonames[]
virtual replaygain_info get_replaygain() const =0
Retrieves ReplayGain information.
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...
virtual t_size info_get_count() const =0
Retrieves number of technical info 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 enco...