本文整理汇总了C++中CMusicDatabaseDirectory::GetLabel方法的典型用法代码示例。如果您正苦于以下问题:C++ CMusicDatabaseDirectory::GetLabel方法的具体用法?C++ CMusicDatabaseDirectory::GetLabel怎么用?C++ CMusicDatabaseDirectory::GetLabel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMusicDatabaseDirectory
的用法示例。
在下文中一共展示了CMusicDatabaseDirectory::GetLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateButtons
void CGUIWindowMusicNav::UpdateButtons()
{
CGUIWindowMusicBase::UpdateButtons();
// Update object count
int iItems = m_vecItems->Size();
if (iItems)
{
// check for parent dir and "all" items
// should always be the first two items
for (int i = 0; i <= (iItems>=2 ? 1 : 0); i++)
{
CFileItemPtr pItem = m_vecItems->Get(i);
if (pItem->IsParentFolder()) iItems--;
if (pItem->m_strPath.Left(4).Equals("/-1/")) iItems--;
}
// or the last item
if (m_vecItems->Size() > 2 &&
m_vecItems->Get(m_vecItems->Size()-1)->m_strPath.Left(4).Equals("/-1/"))
iItems--;
}
CStdString items;
items.Format("%i %s", iItems, g_localizeStrings.Get(127).c_str());
SET_CONTROL_LABEL(CONTROL_LABELFILES, items);
// set the filter label
CStdString strLabel;
// "Playlists"
if (m_vecItems->m_strPath.Equals("special://musicplaylists/"))
strLabel = g_localizeStrings.Get(136);
// "{Playlist Name}"
else if (m_vecItems->IsPlayList())
{
// get playlist name from path
CStdString strDummy;
CUtil::Split(m_vecItems->m_strPath, strDummy, strLabel);
}
// everything else is from a musicdb:// path
else
{
CMusicDatabaseDirectory dir;
dir.GetLabel(m_vecItems->m_strPath, strLabel);
}
SET_CONTROL_LABEL(CONTROL_FILTER, strLabel);
#ifndef _BOXEE_
SET_CONTROL_SELECTED(GetID(),CONTROL_BTNPARTYMODE, g_partyModeManager.IsEnabled());
#endif
SET_CONTROL_SELECTED(GetID(),CONTROL_BTN_FILTER, !m_filter.IsEmpty());
SET_CONTROL_LABEL2(CONTROL_BTN_FILTER, m_filter);
}
示例2: UpdateButtons
void CGUIWindowMusicNav::UpdateButtons()
{
CGUIWindowMusicBase::UpdateButtons();
// Update object count
int iItems = m_vecItems->Size();
if (iItems)
{
// check for parent dir and "all" items
// should always be the first two items
for (int i = 0; i <= (iItems>=2 ? 1 : 0); i++)
{
CFileItemPtr pItem = m_vecItems->Get(i);
if (pItem->IsParentFolder()) iItems--;
if (StringUtils::StartsWith(pItem->GetPath(), "/-1/")) iItems--;
}
// or the last item
if (m_vecItems->Size() > 2 &&
StringUtils::StartsWith(m_vecItems->Get(m_vecItems->Size()-1)->GetPath(), "/-1/"))
iItems--;
}
CStdString items;
items.Format("%i %s", iItems, g_localizeStrings.Get(127).c_str());
SET_CONTROL_LABEL(CONTROL_LABELFILES, items);
// set the filter label
CStdString strLabel;
// "Playlists"
if (m_vecItems->GetPath().Equals("special://musicplaylists/"))
strLabel = g_localizeStrings.Get(136);
// "{Playlist Name}"
else if (m_vecItems->IsPlayList())
{
// get playlist name from path
CStdString strDummy;
URIUtils::Split(m_vecItems->GetPath(), strDummy, strLabel);
}
// everything else is from a musicdb:// path
else
{
CMusicDatabaseDirectory dir;
dir.GetLabel(m_vecItems->GetPath(), strLabel);
}
SET_CONTROL_LABEL(CONTROL_FILTER, strLabel);
SET_CONTROL_SELECTED(GetID(),CONTROL_BTNPARTYMODE, g_partyModeManager.IsEnabled());
CONTROL_ENABLE_ON_CONDITION(CONTROL_UPDATE_LIBRARY, !m_vecItems->IsAddonsPath() && !m_vecItems->IsPlugin() && !m_vecItems->IsScript());
}