本文整理汇总了C++中mpd::Song::getHash方法的典型用法代码示例。如果您正苦于以下问题:C++ Song::getHash方法的具体用法?C++ Song::getHash怎么用?C++ Song::getHash使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mpd::Song
的用法示例。
在下文中一共展示了Song::getHash方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LocateSong
void Browser::LocateSong(const MPD::Song &s)
{
if (s.getDirectory().empty())
return;
itsBrowseLocally = !s.isFromDatabase();
if (myScreen != this)
switchTo();
if (itsBrowsedDir != s.getDirectory())
GetDirectory(s.getDirectory());
for (size_t i = 0; i < w.size(); ++i)
{
if (w[i].value().type == itSong && s.getHash() == w[i].value().song->getHash())
{
w.highlight(i);
break;
}
}
drawHeader();
}
示例2: LocateSong
void MediaLibrary::LocateSong(const MPD::Song &s)
{
std::string primary_tag = s.get(Config.media_lib_primary_tag);
if (primary_tag.empty())
{
std::string item_type = boost::locale::to_lower(
tagTypeToString(Config.media_lib_primary_tag));
Statusbar::msg("Can't use this function because the song has no %s tag set", item_type.c_str());
return;
}
if (myScreen != this)
switchTo();
Statusbar::put() << "Jumping to song...";
Global::wFooter->refresh();
if (!hasTwoColumns)
{
Tags.showAll();
if (Tags.empty())
update();
if (primary_tag != Tags.current().value().tag())
{
for (size_t i = 0; i < Tags.size(); ++i)
{
if (primary_tag == Tags[i].value().tag())
{
Tags.highlight(i);
Albums.clear();
Songs.clear();
break;
}
}
}
}
Albums.showAll();
if (Albums.empty())
update();
std::string album = s.getAlbum();
std::string date = s.getDate();
if ((hasTwoColumns && Albums.current().value().entry().tag() != primary_tag)
|| album != Albums.current().value().entry().album()
|| date != Albums.current().value().entry().date())
{
for (size_t i = 0; i < Albums.size(); ++i)
{
if ((!hasTwoColumns || Albums[i].value().entry().tag() == primary_tag)
&& album == Albums[i].value().entry().album()
&& date == Albums[i].value().entry().date())
{
Albums.highlight(i);
Songs.clear();
break;
}
}
}
Songs.showAll();
if (Songs.empty())
update();
if (s.getHash() != Songs.current().value().getHash())
{
for (size_t i = 0; i < Songs.size(); ++i)
{
if (s.getHash() == Songs[i].value().getHash())
{
Songs.highlight(i);
break;
}
}
}
Tags.setHighlightColor(Config.main_highlight_color);
Albums.setHighlightColor(Config.main_highlight_color);
Songs.setHighlightColor(Config.active_column_color);
w = &Songs;
refresh();
}