9 format_meta(
const file_info & p_source,
const char * p_name,
bool p_allow_space =
true)
12 m_buffer.replace_byte(
'\"',
'\'');
14 if (!p_allow_space) m_buffer.replace_byte(
' ',
'_');
15 m_buffer.replace_nontext_chars();
17 inline operator const char*()
const {
return m_buffer;}
28 iter = p_list.
first();
30 if (!iter->m_infos.meta_format(p_meta,reference))
return false;
33 if (!iter->m_infos.meta_format(p_meta,temp))
return false;
34 if (strcmp(temp,reference)!=0)
return false;
39 static const char g_eol[] =
"\r\n";
58 p_out <<
"REM GENRE " << format_meta(p_data.
first()->m_infos,
"genre") << g_eol;
61 p_out <<
"REM DATE " << format_meta(p_data.
first()->m_infos,
"date") << g_eol;
64 p_out <<
"REM DISCID " << format_meta(p_data.
first()->m_infos,
"discid") << g_eol;
67 p_out <<
"REM COMMENT " << format_meta(p_data.
first()->m_infos,
"comment") << g_eol;
70 p_out <<
"CATALOG " << format_meta(p_data.
first()->m_infos,
"catalog") << g_eol;
72 if (songwriter_global) {
73 p_out <<
"SONGWRITER \"" << format_meta(p_data.
first()->m_infos,
"songwriter") <<
"\"" << g_eol;
76 if (album_artist_global)
78 p_out <<
"PERFORMER \"" << format_meta(p_data.
first()->m_infos,
"album artist") <<
"\"" << g_eol;
79 artist_global =
false;
81 else if (artist_global)
83 p_out <<
"PERFORMER \"" << format_meta(p_data.
first()->m_infos,
"artist") <<
"\"" << g_eol;
87 p_out <<
"TITLE \"" << format_meta(p_data.
first()->m_infos,
"album") <<
"\"" << g_eol;
94 p_out <<
"REM REPLAYGAIN_ALBUM_GAIN " << rgbuffer << g_eol;
96 p_out <<
"REM REPLAYGAIN_ALBUM_PEAK " << rgbuffer << g_eol;
103 if (strcmp(last_file,iter->m_file) != 0)
105 p_out <<
"FILE \"" << iter->m_file <<
"\" WAVE" <<
g_eol;
106 last_file = iter->m_file;
111 if (iter->m_infos.meta_find(
"title") != pfc_infinite)
112 p_out <<
" TITLE \"" << format_meta(iter->m_infos,
"title") <<
"\"" <<
g_eol;
114 if (!artist_global && iter->m_infos.meta_find(
"artist") != pfc_infinite)
115 p_out <<
" PERFORMER \"" << format_meta(iter->m_infos,
"artist") <<
"\"" <<
g_eol;
117 if (!songwriter_global && iter->m_infos.meta_find(
"songwriter") != pfc_infinite) {
118 p_out <<
" SONGWRITER \"" << format_meta(iter->m_infos,
"songwriter") <<
"\"" <<
g_eol;
121 if (iter->m_infos.meta_find(
"isrc") != pfc_infinite) {
122 p_out <<
" ISRC " << format_meta(iter->m_infos,
"isrc") <<
g_eol;
125 if (!date_global && iter->m_infos.meta_find(
"date") != pfc_infinite) {
126 p_out <<
" REM DATE " << format_meta(iter->m_infos,
"date") <<
g_eol;
135 p_out <<
" REM REPLAYGAIN_TRACK_GAIN " << rgbuffer << g_eol;
137 p_out <<
" REM REPLAYGAIN_TRACK_PEAK " << rgbuffer << g_eol;
140 if (!iter->m_flags.is_empty()) {
141 p_out <<
" FLAGS " << iter->m_flags <<
g_eol;
144 if (iter->m_index_list.m_positions[0] < iter->m_index_list.m_positions[1])
146 if (iter->m_index_list.m_positions[0] < 0)
164 void t_entry::set_simple_index(
double p_time)
166 m_index_list.reset();
167 m_index_list.m_positions[0] = m_index_list.m_positions[1] = p_time;
169 void t_entry::set_index01(
double index0,
double index1) {
170 PFC_ASSERT( index0 <= index1 );
171 m_index_list.reset();
172 m_index_list.m_positions[0] = index0;
173 m_index_list.m_positions[1] = index1;
static const char g_eol[]
bool format_track_gain(char p_buffer[text_buffer_size]) const
Differences between chain_list_v2_t<> and old chain_list_t<>: Iterators pointing to removed items as...
bool format_album_peak(char p_buffer[text_buffer_size]) const
Structure containing ReplayGain scan results from some playable object, also providing various helper...
Main interface class for information about some playable object.
bool format_track_peak(char p_buffer[text_buffer_size]) const
void create(pfc::string_formatter &p_out, const t_entry_list &p_data)
bool format_album_gain(char p_buffer[text_buffer_size]) const
bool meta_format(const char *p_name, pfc::string_base &p_out, const char *separator=", ") const
t_size uReplaceString(pfc::string_base &out, const char *src, t_size src_len, const char *s1, t_size len1, const char *s2, t_size len2, bool casesens)
static bool is_meta_same_everywhere(const cue_creator::t_entry_list &p_list, const char *p_meta)
string8_t< pfc::alloc_fast_aggressive > string8_fastalloc
char t_text_buffer[text_buffer_size]