Skip to content

Commit

Permalink
gui: add Player.Title to replace VideoPlayer.Title and MusicPlayer.Title
Browse files Browse the repository at this point in the history
  • Loading branch information
elupus committed Jan 20, 2013
1 parent 87b1736 commit e921d86
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -1381,10 +1381,35 @@ CStdString CGUIInfoManager::GetLabel(int info, int contextWindow, CStdString *fa
break;
case PLAYER_TITLE:
{
if (g_application.IsPlayingVideo())
strLabel = GetLabel(VIDEOPLAYER_TITLE);
if(m_currentFile)
{
if (m_currentFile->HasPVRChannelInfoTag())
{
CEpgInfoTag tag;
return m_currentFile->GetPVRChannelInfoTag()->GetEPGNow(tag) ?
tag.Title() :
g_guiSettings.GetBool("epg.hidenoinfoavailable") ?
StringUtils::EmptyString :
g_localizeStrings.Get(19055); // no information available
}
if (m_currentFile->HasPVRRecordingInfoTag() && !m_currentFile->GetPVRRecordingInfoTag()->m_strTitle.IsEmpty())
return m_currentFile->GetPVRRecordingInfoTag()->m_strTitle;
if (m_currentFile->HasVideoInfoTag() && !m_currentFile->GetVideoInfoTag()->m_strTitle.IsEmpty())
return m_currentFile->GetVideoInfoTag()->m_strTitle;
if (m_currentFile->HasMusicInfoTag() && !m_currentFile->GetMusicInfoTag()->GetTitle().IsEmpty())
return m_currentFile->GetMusicInfoTag()->GetTitle();
// don't have the title, so use dvdplayer, label, or drop down to title from path
if (g_application.m_pPlayer && !g_application.m_pPlayer->GetPlayingTitle().IsEmpty())
return g_application.m_pPlayer->GetPlayingTitle();
if (!m_currentFile->GetLabel().IsEmpty())
return m_currentFile->GetLabel();
return CUtil::GetTitleFromPath(m_currentFile->GetPath());
}
else
strLabel = GetLabel(MUSICPLAYER_TITLE);
{
if (g_application.m_pPlayer && !g_application.m_pPlayer->GetPlayingTitle().IsEmpty())
return g_application.m_pPlayer->GetPlayingTitle();
}
}
break;
case MUSICPLAYER_TITLE:
Expand Down Expand Up @@ -3530,7 +3555,7 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item)
switch (info)
{
case MUSICPLAYER_TITLE:
if (tag.GetTitle().size()) { return tag.GetTitle(); }
return GetLabel(PLAYER_TITLE);
break;
case MUSICPLAYER_ALBUM:
if (tag.GetAlbum().size()) { return tag.GetAlbum(); }
Expand Down Expand Up @@ -3608,25 +3633,7 @@ CStdString CGUIInfoManager::GetVideoLabel(int item)

if (item == VIDEOPLAYER_TITLE)
{
if (m_currentFile->HasPVRChannelInfoTag())
{
CEpgInfoTag tag;
return m_currentFile->GetPVRChannelInfoTag()->GetEPGNow(tag) ?
tag.Title() :
g_guiSettings.GetBool("epg.hidenoinfoavailable") ?
StringUtils::EmptyString :
g_localizeStrings.Get(19055); // no information available
}
if (m_currentFile->HasPVRRecordingInfoTag() && !m_currentFile->GetPVRRecordingInfoTag()->m_strTitle.IsEmpty())
return m_currentFile->GetPVRRecordingInfoTag()->m_strTitle;
if (m_currentFile->HasVideoInfoTag() && !m_currentFile->GetVideoInfoTag()->m_strTitle.IsEmpty())
return m_currentFile->GetVideoInfoTag()->m_strTitle;
// don't have the title, so use dvdplayer, label, or drop down to title from path
if (!g_application.m_pPlayer->GetPlayingTitle().IsEmpty())
return g_application.m_pPlayer->GetPlayingTitle();
if (!m_currentFile->GetLabel().IsEmpty())
return m_currentFile->GetLabel();
return CUtil::GetTitleFromPath(m_currentFile->GetPath());
return GetLabel(PLAYER_TITLE);
}
else if (item == VIDEOPLAYER_PLAYLISTLEN)
{
Expand Down

0 comments on commit e921d86

Please sign in to comment.