本文整理汇总了C++中metadb_handle_ptr::metadb_lock方法的典型用法代码示例。如果您正苦于以下问题:C++ metadb_handle_ptr::metadb_lock方法的具体用法?C++ metadb_handle_ptr::metadb_lock怎么用?C++ metadb_handle_ptr::metadb_lock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类metadb_handle_ptr
的用法示例。
在下文中一共展示了metadb_handle_ptr::metadb_lock方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update_metadata
void stream_encoders::update_metadata(metadb_handle_ptr p_track){
if(p_track!=0){
p_track->metadb_lock();
const file_info*p_info;
if(p_track->get_info_async_locked(p_info))
update_metadata(*p_info);
p_track->metadb_unlock();
}
}
示例2: query_scale
audio_sample t_replaygain_config::query_scale(const metadb_handle_ptr & p_object) const
{
audio_sample rv = 1.0;
p_object->metadb_lock();
const file_info * info;
if (p_object->get_info_async_locked(info))
rv = query_scale(*info);
p_object->metadb_unlock();
return rv;
}
示例3: 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();
}
}