本文整理汇总了C++中metadb_handle_ptr::format_title_legacy方法的典型用法代码示例。如果您正苦于以下问题:C++ metadb_handle_ptr::format_title_legacy方法的具体用法?C++ metadb_handle_ptr::format_title_legacy怎么用?C++ metadb_handle_ptr::format_title_legacy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类metadb_handle_ptr
的用法示例。
在下文中一共展示了metadb_handle_ptr::format_title_legacy方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: format_filename
void create_directory_helper::format_filename(const metadb_handle_ptr & handle,titleformat_hook * p_hook,const char * spec,pfc::string8 & out)
{
pfc::string8 temp;
handle->format_title_legacy(p_hook,temp,spec,&titleformat_text_filter_impl_createdir());
temp.replace_char('/','\\');
temp.fix_filename_chars('_','\\');
out = temp;
}
示例2: on_playback_new_track
virtual void on_playback_new_track(metadb_handle_ptr track)
{
pfc::string8 out = "";
pfc::string8 fullTitle = "";
pfc::string8 artist = "";
pfc::string8 title = "";
char songTitle[1024] = "";
char songTitle2[1024] = "";
static char currentTitle[1024] = "";
int windowTitle = 1;
char newTitle[2046] = "";
if (track != NULL) {
track->metadb_lock();
const file_info * info;
track->get_info_async_locked(info);
if (info) {
freeComment();
int numInfos = info->meta_get_count();
for (int i=0;i<numInfos;i++) {
const char *pName = info->meta_enum_name(i);
const char *pValue = info->meta_enum_value(i,0);
char *buffer;
int bufferlen = 0;
bufferlen = strlen(pName) + strlen(pValue) + strlen("=") + 1;
buffer = (char *)calloc(1, bufferlen);
sprintf(buffer, "%s=%s", pName, pValue);
pfc::string8 theout = "";
theout.add_string(buffer);
addComment((char *)(const char *)pfc::stringcvt::string_ansi_from_utf8(theout));
free(buffer);
if (pName) {
if (!stricmp(pName, "ARTIST")) {
if (pValue) {
artist.add_string(pValue);
}
}
if (!stricmp(pName, "TITLE")) {
if (pValue) {
title.add_string(" - ");
title.add_string(pValue);
}
}
}
}
if (numInfos == 0) {
static const char * TITLE_FORMAT = "%_filename%";
track->format_title_legacy(0,fullTitle,TITLE_FORMAT,0);
}
else {
fullTitle.add_string(artist);
fullTitle.add_string(title);
/*
track->handle_query_meta_field("ARTIST", 0, out);
fullTitle.add_string(out);
track->handle_query_meta_field("TITLE", 0, out);
fullTitle.add_string(" - ");
fullTitle.add_string(out);
*/
;
}
setMetadataFromMediaPlayer((char *)(const char *)pfc::stringcvt::string_ansi_from_utf8(fullTitle));
}
track->metadb_unlock();
}
}