本文整理汇总了C++中metadb_handle_list_cref::get_item方法的典型用法代码示例。如果您正苦于以下问题:C++ metadb_handle_list_cref::get_item方法的具体用法?C++ metadb_handle_list_cref::get_item怎么用?C++ metadb_handle_list_cref::get_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类metadb_handle_list_cref
的用法示例。
在下文中一共展示了metadb_handle_list_cref::get_item方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: context_command
virtual void context_command(unsigned int p_index, metadb_handle_list_cref p_data, const GUID& p_caller)
{
if(p_index == 0 && p_data.get_count() == 1)
AlsongLyricLinkDialog::OpenLyricLinkDialog(core_api::get_main_window(), p_data.get_item(0));
else if(p_index == 1 && p_data.get_count() == 1)
LyricSyncDialog::Open(p_data.get_item(0), core_api::get_main_window());
}
示例2:
virtual void
context_command(
unsigned int index,
metadb_handle_list_cref tracks,
const GUID& /*caller*/
)
{
switch(index)
{
case Items::GetArtistTopTracks:
{
generateArtistPlaylist(tracks);
break;
}
case Items::GetSimilarTracks:
{
if(tracks.get_count() > 0)
{
generateSimilarTracksPlaylist(tracks.get_item(0));
}
break;
}
default:
{
uBugCheck();
}
}
}
示例3: calc_total_duration
double metadb_handle_list_helper::calc_total_duration(metadb_handle_list_cref p_list)
{
double ret = 0;
t_size n, m = p_list.get_count();
for(n=0;n<m;n++)
{
double temp = p_list.get_item(n)->get_length();
if (temp > 0) ret += temp;
}
return ret;
}
示例4: getMainArtist
virtual bool
context_get_display(
unsigned int index,
metadb_handle_list_cref tracks,
pfc::string_base& out,
unsigned int& displayflags,
const GUID& /*caller*/
)
{
switch(index)
{
case Items::GetArtistTopTracks:
{
const auto& mainArtist = getMainArtist(tracks);
const t_size stringLength = mainArtist.length();
if(stringLength > 0)
{
// We have found a main artist; set the display of the item to be of the form:
// "Artist's top tracks".
out = mainArtist.c_str();
// Grammar alert! Artists ending with "s" get just a "'" rather than "'s".
if(out[stringLength - 1] == 's')
{
out.add_string("' top tracks");
}
else
{
out.add_string("'s top tracks");
}
}
else
{
// Failed to find a main artist; return the normal, non-custom name for the item.
get_item_name(index, out);
}
return true;
}
case Items::GetSimilarTracks:
{
if(tracks.get_count() == 0)
{
displayflags = FLAG_DISABLED_GRAYED;
get_item_name(index, out);
}
else
{
out = "Get tracks similar to ";
out.add_string(getTitle(tracks.get_item(0)).c_str());
}
return true;
}
default:
{
// Nothing wants to customise the display of the item; let the regular name be displayed.
get_item_name(index, out);
return true;
}
}
}