From 4a0eeaa3aff652e8e6c1f6f9d6c1596fc91d8c9a Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Sun, 5 May 2024 17:00:15 +0200 Subject: [PATCH 1/2] [guilib][PVR] New GUI info labels: (ListItem|VideoPlayer|MusicPlayer).ChannelLogo --- xbmc/GUIInfoManager.cpp | 29 ++++++++++++++++++++++++++ xbmc/guilib/guiinfo/GUIInfoLabels.h | 7 +++++++ xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp | 22 +++++++++++++++++-- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index 50a46d148b7fa..8c58ad662a10b 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -2788,6 +2788,14 @@ const infomap musicpartymode[] = {{ "enabled", MUSICPM_ENABLED }, /// @return The channel name of the radio programme that's currently playing (PVR). ///

/// } +/// \table_row3{ `MusicPlayer.ChannelLogo`, +/// \anchor MusicPlayer_ChannelLogo +/// _string_, +/// @return The path for the logo of the currently playing radio channel\, if available (PVR). +///


+/// @skinning_v22 **[New Infolabel]** \link MusicPlayer_ChannelLogo `MusicPlayer.ChannelLogo`\endlink +///

+/// } /// \table_row3{ `MusicPlayer.ChannelNumberLabel`, /// \anchor MusicPlayer_ChannelNumberLabel /// _string_, @@ -2877,6 +2885,7 @@ const infomap musicpartymode[] = {{ "enabled", MUSICPM_ENABLED }, /// \table_end /// /// ----------------------------------------------------------------------------- +// clang-format off const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, { "album", MUSICPLAYER_ALBUM }, { "artist", MUSICPLAYER_ARTIST }, @@ -2911,6 +2920,7 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, { "playcount", MUSICPLAYER_PLAYCOUNT }, { "lastplayed", MUSICPLAYER_LASTPLAYED }, { "channelname", MUSICPLAYER_CHANNEL_NAME }, + { "channellogo", MUSICPLAYER_CHANNEL_LOGO }, { "channelnumberlabel", MUSICPLAYER_CHANNEL_NUMBER }, { "channelgroup", MUSICPLAYER_CHANNEL_GROUP }, { "dbid", MUSICPLAYER_DBID }, @@ -2922,6 +2932,7 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, { "totaldiscs", MUSICPLAYER_TOTALDISCS }, { "station", MUSICPLAYER_STATIONNAME } }; +// clang-format on /// \page modules__infolabels_boolean_conditions /// \subsection modules__infolabels_boolean_conditions_Videoplayer Video player @@ -3850,6 +3861,14 @@ const infomap musicplayer[] = {{ "title", MUSICPLAYER_TITLE }, /// @return The name of the currently tuned channel (PVR). ///

/// } +/// \table_row3{ `VideoPlayer.ChannelLogo`, +/// \anchor VideoPlayer_ChannelLogo +/// _string_, +/// @return The path for the logo of the currently playing TV channel\, if available (PVR). +///


+/// @skinning_v22 **[New Infolabel]** \link VideoPlayer_ChannelLogo `VideoPlayer.ChannelLogo`\endlink +///

+/// } /// \table_row3{ `VideoPlayer.ChannelNumberLabel`, /// \anchor VideoPlayer_ChannelNumberLabel /// _string_, @@ -3996,6 +4015,7 @@ const infomap videoplayer[] = {{ "title", VIDEOPLAYER_TITLE }, { "nextendtime", VIDEOPLAYER_NEXT_ENDTIME }, { "nextduration", VIDEOPLAYER_NEXT_DURATION }, { "channelname", VIDEOPLAYER_CHANNEL_NAME }, + { "channellogo", VIDEOPLAYER_CHANNEL_LOGO }, { "channelnumberlabel", VIDEOPLAYER_CHANNEL_NUMBER }, { "channelgroup", VIDEOPLAYER_CHANNEL_GROUP }, { "hasepg", VIDEOPLAYER_HAS_EPG }, @@ -5974,6 +5994,14 @@ const infomap container_str[] = {{ "property", CONTAINER_PROPERTY }, /// @return The name of current selected TV channel in a container. ///

/// } +/// \table_row3{ `ListItem.ChannelLogo`, +/// \anchor ListItem_ChannelLogo +/// _string_, +/// @return The path for the logo of the currently selected radio or TV channel\, if available (PVR). +///


+/// @skinning_v22 **[New Infolabel]** \link ListItem_ChannelLogo `ListItem.ChannelLogo`\endlink +///

+/// } /// \table_row3{ `ListItem.VideoCodec`, /// \anchor ListItem_VideoCodec /// _string_, @@ -7127,6 +7155,7 @@ const infomap listitem_labels[]= {{ "thumb", LISTITEM_THUMB }, { "nextenddate", LISTITEM_NEXT_ENDDATE }, { "nextduration", LISTITEM_NEXT_DURATION }, { "channelname", LISTITEM_CHANNEL_NAME }, + { "channellogo", LISTITEM_CHANNEL_LOGO }, { "channelnumberlabel", LISTITEM_CHANNEL_NUMBER }, { "channelgroup", LISTITEM_CHANNEL_GROUP }, { "hasepg", LISTITEM_HAS_EPG }, diff --git a/xbmc/guilib/guiinfo/GUIInfoLabels.h b/xbmc/guilib/guiinfo/GUIInfoLabels.h index fe866fe0928bc..b926d860e9b79 100644 --- a/xbmc/guilib/guiinfo/GUIInfoLabels.h +++ b/xbmc/guilib/guiinfo/GUIInfoLabels.h @@ -224,6 +224,9 @@ #define MUSICPLAYER_CONTENT 246 #define MUSICPLAYER_ISMULTIDISC 247 +// More Musicplayer infolabels +#define MUSICPLAYER_CHANNEL_LOGO 248 + // Videoplayer infolabels #define VIDEOPLAYER_HDR_TYPE 249 // Keep videoplayer infolabels that work with offset and position together @@ -318,6 +321,9 @@ #define RETROPLAYER_STRETCH_MODE 331 #define RETROPLAYER_VIDEO_ROTATION 332 +// More PVR infolabels +#define VIDEOPLAYER_CHANNEL_LOGO 333 + #define CONTAINER_HAS_PARENT_ITEM 341 #define CONTAINER_CAN_FILTER 342 #define CONTAINER_CAN_FILTERADVANCED 343 @@ -981,6 +987,7 @@ static constexpr unsigned int SYSTEM_LOCALE = 1012; #define LISTITEM_HASVIDEOEXTRAS (LISTITEM_START + 216) #define LISTITEM_PVR_CLIENT_NAME (LISTITEM_START + 217) #define LISTITEM_PVR_INSTANCE_NAME (LISTITEM_START + 218) +#define LISTITEM_CHANNEL_LOGO (LISTITEM_START + 219) #define LISTITEM_END (LISTITEM_START + 2500) diff --git a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp index d6859b5a2f9cd..fb09aba999dc7 100644 --- a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp +++ b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp @@ -425,6 +425,9 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, case LISTITEM_CHANNEL_NAME: strValue = timer->ChannelName(); return true; + case LISTITEM_CHANNEL_LOGO: + strValue = timer->ChannelIcon(); + return true; case LISTITEM_PVR_CLIENT_NAME: strValue = CServiceBroker::GetPVRManager().GetClient(timer->ClientID())->GetClientName(); return true; @@ -485,7 +488,6 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, if (recording->HasExpirationTime()) { strValue = GetAsLocalizedTimeString(recording->ExpirationTimeAsLocalTime()); - ; return true; } break; @@ -523,6 +525,18 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, } break; } + case VIDEOPLAYER_CHANNEL_LOGO: + case LISTITEM_CHANNEL_LOGO: + { + const std::shared_ptr groupMember = + CServiceBroker::GetPVRManager().Get().GetChannelGroupMember(*item); + if (groupMember) + { + strValue = groupMember->Channel()->IconPath(); + return true; + } + break; + } case LISTITEM_ICON: if (recording->ClientIconPath().empty() && recording->ClientThumbnailPath().empty() && // Only use a fallback if there is more than a single provider available @@ -815,13 +829,17 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, if (!strValue.empty()) return true; } - // fall-thru is intended [[fallthrough]]; } case VIDEOPLAYER_CHANNEL_NAME: case LISTITEM_CHANNEL_NAME: strValue = channel->ChannelName(); return true; + case MUSICPLAYER_CHANNEL_LOGO: + case VIDEOPLAYER_CHANNEL_LOGO: + case LISTITEM_CHANNEL_LOGO: + strValue = channel->IconPath(); + return true; case MUSICPLAYER_CHANNEL_NUMBER: case VIDEOPLAYER_CHANNEL_NUMBER: case LISTITEM_CHANNEL_NUMBER: From 4bd3e88fa399790522f048cba92fbb61b1fbe7d9 Mon Sep 17 00:00:00 2001 From: ksooo <3226626+ksooo@users.noreply.github.com> Date: Sun, 5 May 2024 15:31:49 +0200 Subject: [PATCH 2/2] [Estuary][PVR] Guide window: If both channel icon and programme thumbnail are available, show both, like we already do in fullscreen OSD. --- addons/skin.estuary/xml/Includes_PVR.xml | 47 ++++++++++++++++++++ addons/skin.estuary/xml/MyPVRGuide.xml | 56 ++++++++---------------- 2 files changed, 66 insertions(+), 37 deletions(-) diff --git a/addons/skin.estuary/xml/Includes_PVR.xml b/addons/skin.estuary/xml/Includes_PVR.xml index 951cdfeeb8bcb..c482d2b7086e4 100644 --- a/addons/skin.estuary/xml/Includes_PVR.xml +++ b/addons/skin.estuary/xml/Includes_PVR.xml @@ -526,6 +526,53 @@ !String.IsEmpty(PVR.ChannelNumberInput) + + + + 0 + 350 + $PARAM[right] + + 100% + 30 + + + + 35 + 100% + 30 + + + + + 350 + 85 + $PARAM[right] + 130 + justify + + Skin.HasSetting(AutoScroll) + + + 220 + 350 + + 0 + 25% + 30 + + + + 0 + $PARAM[right] + 75% + 30 + right + + + + + diff --git a/addons/skin.estuary/xml/MyPVRGuide.xml b/addons/skin.estuary/xml/MyPVRGuide.xml index c84b51c15a9e8..80e866422fbf4 100644 --- a/addons/skin.estuary/xml/MyPVRGuide.xml +++ b/addons/skin.estuary/xml/MyPVRGuide.xml @@ -178,47 +178,29 @@ 250 keep 400 - $INFO[ListItem.Icon] + $INFO[ListItem.ChannelLogo] - 0 - 350 - - 70% - 30 - - - - 0 - 30 - 30% - 30 - right - - - - 35 - 60% - 30 - - - - 35 - 30 - 40% - 30 - right - - + String.IsEmpty(ListItem.EpgEventIcon) + + + - - 350 - 85 + + !String.IsEmpty(ListItem.EpgEventIcon) + + + + + + 10 30 - 170 - justify - - Skin.HasSetting(AutoScroll) + 290 + 250 + keep + 400 + $INFO[ListItem.EpgEventIcon] + !String.IsEmpty(ListItem.EpgEventIcon)