Skip to content

Commit

Permalink
gui: allow reporting of playback time for a non av player
Browse files Browse the repository at this point in the history
Shows info for a upnp remote player
  • Loading branch information
elupus committed Jan 20, 2013
1 parent 05a8c6a commit f72980b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions addons/skin.confluence/720p/includes.xml
Expand Up @@ -588,7 +588,7 @@
<textcolor>blue</textcolor>
<align>center</align>
<aligny>center</aligny>
<visible>[Player.HasAudio | Player.HasVideo]</visible>
<visible>Player.HasMedia</visible>
<include>VisibleFadeEffect</include>
</control>
<control type="button" id="610">
Expand Down Expand Up @@ -681,7 +681,7 @@
</control>
</control>
<control type="group" id="9005">
<visible>[Player.HasAudio | Player.HasVideo]</visible>
<visible>Player.HasMedia</visible>
<visible>!VideoPlayer.Content(LiveTV)</visible>
<include>VisibleFadeEffect</include>
<width>250</width>
Expand Down
14 changes: 8 additions & 6 deletions xbmc/GUIInfoManager.cpp
Expand Up @@ -3476,7 +3476,7 @@ CStdString CGUIInfoManager::GetPlaylistLabel(int item) const

CStdString CGUIInfoManager::GetMusicLabel(int item)
{
if (!g_application.IsPlayingAudio() || !m_currentFile->HasMusicInfoTag()) return "";
if (!g_application.IsPlaying() || !m_currentFile->HasMusicInfoTag()) return "";
switch (item)
{
case MUSICPLAYER_PLAYLISTLEN:
Expand Down Expand Up @@ -3555,7 +3555,8 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item)
switch (info)
{
case MUSICPLAYER_TITLE:
return GetLabel(PLAYER_TITLE);
if(g_application.IsPlayingAudio())
return GetLabel(PLAYER_TITLE);
break;
case MUSICPLAYER_ALBUM:
if (tag.GetAlbum().size()) { return tag.GetAlbum(); }
Expand Down Expand Up @@ -3628,12 +3629,13 @@ CStdString CGUIInfoManager::GetMusicTagLabel(int info, const CFileItem *item)

CStdString CGUIInfoManager::GetVideoLabel(int item)
{
if (!g_application.IsPlayingVideo())
if (!g_application.IsPlaying())
return "";

if (item == VIDEOPLAYER_TITLE)
{
return GetLabel(PLAYER_TITLE);
if(g_application.IsPlayingVideo())
return GetLabel(PLAYER_TITLE);
}
else if (item == VIDEOPLAYER_PLAYLISTLEN)
{
Expand Down Expand Up @@ -3863,7 +3865,7 @@ CStdString CGUIInfoManager::GetCurrentPlayTime(TIME_FORMAT format) const
{
if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600)
format = TIME_FORMAT_HH_MM_SS;
if (g_application.IsPlayingAudio() || g_application.IsPlayingVideo())
if (g_application.IsPlaying())
return StringUtils::SecondsToTimeString((int)(GetPlayTime()/1000), format);
return "";
}
Expand Down Expand Up @@ -3893,7 +3895,7 @@ CStdString CGUIInfoManager::GetCurrentPlayTimeRemaining(TIME_FORMAT format) cons
if (format == TIME_FORMAT_GUESS && GetTotalPlayTime() >= 3600)
format = TIME_FORMAT_HH_MM_SS;
int timeRemaining = GetPlayTimeRemaining();
if (timeRemaining && (g_application.IsPlayingAudio() || g_application.IsPlayingVideo()))
if (timeRemaining && g_application.IsPlaying())
return StringUtils::SecondsToTimeString(timeRemaining, format);
return "";
}
Expand Down

0 comments on commit f72980b

Please sign in to comment.