Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3586 from Montellese/nowplaying_fix

"Now playling..." fix
  • Loading branch information...
commit 08bfbb2ce40d2a1a513d36a441fb94b76eebac18 2 parents f397c8b + 8059b24
@jmarshallnz jmarshallnz authored
View
7 addons/skin.confluence/720p/includes.xml
@@ -30,8 +30,8 @@
<value condition="IsEmpty(ListItem.Art(poster))">$INFO[ListItem.Icon]</value>
</variable>
<variable name="PlayList">
- <value condition="Player.HasVideo">ActivateWindow(videoplaylist)</value>
- <value condition="Player.HasAudio">ActivateWindow(musicplaylist)</value>
+ <value condition="Window.IsActive(videolibrary) + !StringCompare(Playlist.Length(video),0)">ActivateWindow(videoplaylist)</value>
+ <value condition="[Window.IsActive(musiclibrary) | Window.IsActive(musicfiles)] + !StringCompare(Playlist.Length(music),0)">ActivateWindow(musicplaylist)</value>
</variable>
<include name="BehindDialogFadeOut">
@@ -896,8 +896,7 @@
<include>ButtonCommonValues</include>
<label>13350</label>
<onclick>$VAR[PlayList]</onclick>
- <visible>Player.HasMedia</visible>
- <visible>!VideoPlayer.Content(LiveTV)</visible>
+ <visible>[Window.IsActive(videolibrary) + !StringCompare(Playlist.Length(video),0)] | [[Window.IsActive(musiclibrary) | Window.IsActive(musicfiles)] + !StringCompare(Playlist.Length(music),0)]</visible>
<visible>!Window.IsVisible(MusicPlaylist) + !Window.IsVisible(VideoPlaylist)</visible>
</control>
</include>
View
63 xbmc/GUIInfoManager.cpp
@@ -1173,10 +1173,30 @@ int CGUIInfoManager::TranslateSingleString(const CStdString &strCondition)
}
else if (cat.name == "playlist")
{
+ int ret = -1;
for (size_t i = 0; i < sizeof(playlist) / sizeof(infomap); i++)
{
if (prop.name == playlist[i].str)
- return playlist[i].val;
+ {
+ ret = playlist[i].val;
+ break;
+ }
+ }
+ if (ret >= 0)
+ {
+ if (prop.num_params() <= 0)
+ return ret;
+ else
+ {
+ int playlistid = PLAYLIST_NONE;
+ if (prop.param().Equals("video"))
+ playlistid = PLAYLIST_VIDEO;
+ else if (prop.param().Equals("music"))
+ playlistid = PLAYLIST_MUSIC;
+
+ if (playlistid > PLAYLIST_NONE)
+ return AddMultiInfo(GUIInfo(ret, playlistid));
+ }
}
}
else if (cat.name == "pvr")
@@ -2993,6 +3013,30 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c
bReturn = (index >= 0 && index < g_playlistPlayer.GetPlaylist(PLAYLIST_MUSIC).size());
}
break;
+
+ case PLAYLIST_ISRANDOM:
+ {
+ int playlistid = info.GetData1();
+ if (playlistid > PLAYLIST_NONE)
+ bReturn = g_playlistPlayer.IsShuffled(playlistid);
+ }
+ break;
+
+ case PLAYLIST_ISREPEAT:
+ {
+ int playlistid = info.GetData1();
+ if (playlistid > PLAYLIST_NONE)
+ bReturn = g_playlistPlayer.GetRepeat(playlistid) == PLAYLIST::REPEAT_ALL;
+ }
+ break;
+
+ case PLAYLIST_ISREPEATONE:
+ {
+ int playlistid = info.GetData1();
+ if (playlistid > PLAYLIST_NONE)
+ bReturn = g_playlistPlayer.GetRepeat(playlistid) == PLAYLIST::REPEAT_ONE;
+ }
+ break;
}
}
return (info.m_info < 0) ? !bReturn : bReturn;
@@ -3232,6 +3276,15 @@ CStdString CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextWi
if (addon && info.m_info == SYSTEM_ADDON_VERSION)
return addon->Version().c_str();
}
+ else if (info.m_info == PLAYLIST_LENGTH ||
+ info.m_info == PLAYLIST_POSITION ||
+ info.m_info == PLAYLIST_RANDOM ||
+ info.m_info == PLAYLIST_REPEAT)
+ {
+ int playlistid = info.GetData1();
+ if (playlistid > PLAYLIST_NONE)
+ return GetPlaylistLabel(info.m_info, playlistid);
+ }
return StringUtils::EmptyString;
}
@@ -3467,10 +3520,12 @@ const CStdString CGUIInfoManager::GetMusicPlaylistInfo(const GUIInfo& info)
return GetMusicTagLabel(info.m_info, playlistItem.get());
}
-CStdString CGUIInfoManager::GetPlaylistLabel(int item) const
+CStdString CGUIInfoManager::GetPlaylistLabel(int item, int playlistid /* = PLAYLIST_NONE */) const
{
- if (!g_application.m_pPlayer->IsPlaying()) return "";
- int iPlaylist = g_playlistPlayer.GetCurrentPlaylist();
+ if (playlistid <= PLAYLIST_NONE && !g_application.m_pPlayer->IsPlaying())
+ return "";
+
+ int iPlaylist = playlistid == PLAYLIST_NONE ? g_playlistPlayer.GetCurrentPlaylist() : playlistid;
switch (item)
{
case PLAYLIST_LENGTH:
View
2  xbmc/GUIInfoManager.h
@@ -777,7 +777,7 @@ class CGUIInfoManager : public IMsgTargetCallback, public Observable
CStdString GetMusicLabel(int item);
CStdString GetMusicTagLabel(int info, const CFileItem *item);
CStdString GetVideoLabel(int item);
- CStdString GetPlaylistLabel(int item) const;
+ CStdString GetPlaylistLabel(int item, int playlistid = -1 /* PLAYLIST_NONE */) const;
CStdString GetMusicPartyModeLabel(int item);
const CStdString GetMusicPlaylistInfo(const GUIInfo& info);
CStdString GetPictureLabel(int item);
Please sign in to comment.
Something went wrong with that request. Please try again.