diff options
Diffstat (limited to 'xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp')
-rw-r--r-- | xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp | 72 |
1 files changed, 48 insertions, 24 deletions
diff --git a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp index 03b5ef0bdd..fb09aba999 100644 --- a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp +++ b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp @@ -425,6 +425,15 @@ 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; + case LISTITEM_PVR_INSTANCE_NAME: + strValue = CServiceBroker::GetPVRManager().GetClient(timer->ClientID())->GetInstanceName(); + return true; case LISTITEM_EPG_EVENT_TITLE: case LISTITEM_EPG_EVENT_ICON: case LISTITEM_GENRE: @@ -439,14 +448,6 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, case LISTITEM_CHANNEL_NUMBER: case LISTITEM_PREMIERED: break; // obtain value from channel/epg - case LISTITEM_BACKEND_INSTANCE_NAME: - { - strValue = CServiceBroker::GetPVRManager() - .Clients() - ->GetCreatedClient(timer->ClientID()) - ->GetInstanceName(); - return true; - } default: return false; } @@ -487,7 +488,6 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, if (recording->HasExpirationTime()) { strValue = GetAsLocalizedTimeString(recording->ExpirationTimeAsLocalTime()); - ; return true; } break; @@ -525,6 +525,18 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, } break; } + case VIDEOPLAYER_CHANNEL_LOGO: + case LISTITEM_CHANNEL_LOGO: + { + const std::shared_ptr<const CPVRChannelGroupMember> groupMember = + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().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 @@ -566,14 +578,14 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, return true; } return false; - case LISTITEM_BACKEND_INSTANCE_NAME: - { - strValue = CServiceBroker::GetPVRManager() - .Clients() - ->GetCreatedClient(recording->ClientID()) - ->GetInstanceName(); + case LISTITEM_PVR_CLIENT_NAME: + strValue = + CServiceBroker::GetPVRManager().GetClient(recording->ClientID())->GetClientName(); + return true; + case LISTITEM_PVR_INSTANCE_NAME: + strValue = + CServiceBroker::GetPVRManager().GetClient(recording->ClientID())->GetInstanceName(); return true; - } } return false; } @@ -771,14 +783,12 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, case LISTITEM_PARENTAL_RATING_CODE: strValue = epgTag->ParentalRatingCode(); return true; - case LISTITEM_BACKEND_INSTANCE_NAME: - { - strValue = CServiceBroker::GetPVRManager() - .Clients() - ->GetCreatedClient(epgTag->ClientID()) - ->GetInstanceName(); + case LISTITEM_PVR_CLIENT_NAME: + strValue = CServiceBroker::GetPVRManager().GetClient(epgTag->ClientID())->GetClientName(); + return true; + case LISTITEM_PVR_INSTANCE_NAME: + strValue = CServiceBroker::GetPVRManager().GetClient(epgTag->ClientID())->GetInstanceName(); return true; - } case VIDEOPLAYER_PREMIERED: case LISTITEM_PREMIERED: if (epgTag->FirstAired().IsValid()) @@ -819,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: @@ -849,6 +863,13 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, strValue = channel->IsRadio() ? m_strPlayingRadioGroup : m_strPlayingTVGroup; return true; } + case LISTITEM_PVR_CLIENT_NAME: + strValue = CServiceBroker::GetPVRManager().GetClient(channel->ClientID())->GetClientName(); + return true; + case LISTITEM_PVR_INSTANCE_NAME: + strValue = + CServiceBroker::GetPVRManager().GetClient(channel->ClientID())->GetInstanceName(); + return true; } } @@ -1339,6 +1360,9 @@ bool CPVRGUIInfo::GetPVRInt(const CFileItem* item, const CGUIInfo& info, int& iV else iValue = 0xFF; return true; + case PVR_CLIENT_COUNT: + iValue = CServiceBroker::GetPVRManager().Clients()->EnabledClientAmount(); + return true; } return false; } |