Skip to content
Browse files

gui: add Player.Title to replace VideoPlayer.Title and MusicPlayer.Title

  • Loading branch information...
1 parent 2bb3252 commit e887df72a05bccfa6efe092b9c4bcc7809d8ae28 @elupus committed Oct 27, 2012
Showing with 30 additions and 23 deletions.
  1. +30 −23 xbmc/GUIInfoManager.cpp
View
53 xbmc/GUIInfoManager.cpp
@@ -1380,10 +1380,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:
@@ -3529,7 +3554,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(); }
@@ -3607,25 +3632,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)
{

0 comments on commit e887df7

Please sign in to comment.
Something went wrong with that request. Please try again.