diff options
author | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2022-09-24 10:50:51 +0200 |
---|---|---|
committer | Kai Sommerfeld <kai.sommerfeld@gmx.com> | 2022-09-27 13:17:58 +0200 |
commit | 3f7472fdabc1145c5092c56043b518048ec1057b (patch) | |
tree | 7deb92d2af3b60ede60bb133abda5977ee1f38e1 | |
parent | 5f81f2fc403779f0887e59711cc6911e7911b91a (diff) |
[PVR] Add CPVRGUIActionsChannels to PVR components.
-rw-r--r-- | xbmc/FileItem.cpp | 7 | ||||
-rw-r--r-- | xbmc/application/ApplicationPowerHandling.cpp | 3 | ||||
-rw-r--r-- | xbmc/input/WindowTranslator.cpp | 20 | ||||
-rw-r--r-- | xbmc/interfaces/builtins/PlayerBuiltins.cpp | 4 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/PVROperations.cpp | 9 | ||||
-rw-r--r-- | xbmc/interfaces/json-rpc/PlayerOperations.cpp | 3 | ||||
-rw-r--r-- | xbmc/pvr/PVRComponentRegistration.cpp | 4 | ||||
-rw-r--r-- | xbmc/pvr/PVRManager.cpp | 5 | ||||
-rw-r--r-- | xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp | 6 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionListener.cpp | 38 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActions.h | 4 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsChannels.cpp | 4 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsChannels.h | 9 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp | 7 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsTimers.cpp | 5 | ||||
-rw-r--r-- | xbmc/pvr/guilib/PVRGUIActionsUtils.cpp | 5 | ||||
-rw-r--r-- | xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp | 16 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIWindowPVRChannels.cpp | 9 | ||||
-rw-r--r-- | xbmc/pvr/windows/GUIWindowPVRGuide.cpp | 6 |
19 files changed, 111 insertions, 53 deletions
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index a018f465a1..77cac5bb9b 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -39,7 +39,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/epg/EpgSearchFilter.h" -#include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecording.h" #include "pvr/timers/PVRTimerInfoTag.h" #include "settings/AdvancedSettings.h" @@ -175,7 +175,8 @@ CFileItem::CFileItem(const std::shared_ptr<PVR::CPVREpgInfoTag>& tag, std::shared_ptr<CPVRChannelGroupMember> groupMember = groupMemberIn; if (!groupMember) - groupMember = CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*this); + groupMember = + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*this); if (!tag->IconPath().empty()) SetArt("icon", tag->IconPath()); @@ -3910,7 +3911,7 @@ CFileItem CFileItem::GetItemToPlay() const if (HasEPGInfoTag()) { const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*this); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*this); if (groupMember) return CFileItem(groupMember); } diff --git a/xbmc/application/ApplicationPowerHandling.cpp b/xbmc/application/ApplicationPowerHandling.cpp index f84a8b6bdf..6899bb3f19 100644 --- a/xbmc/application/ApplicationPowerHandling.cpp +++ b/xbmc/application/ApplicationPowerHandling.cpp @@ -26,6 +26,7 @@ #include "profiles/ProfileManager.h" #include "pvr/PVRManager.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "settings/Settings.h" #include "settings/SettingsComponent.h" #include "utils/AlarmClock.h" @@ -400,7 +401,7 @@ void CApplicationPowerHandling::ActivateScreenSaver(bool forceType /*= false */) else if (m_appPlayer.IsPlayingVideo() && settings->GetBool(CSettings::SETTING_SCREENSAVER_USEDIMONPAUSE)) bUseDim = true; - else if (CServiceBroker::GetPVRManager().GUIActions()->IsRunningChannelScan()) + else if (CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().IsRunningChannelScan()) bUseDim = true; if (bUseDim) diff --git a/xbmc/input/WindowTranslator.cpp b/xbmc/input/WindowTranslator.cpp index ac5714d5ac..fe2dd468a7 100644 --- a/xbmc/input/WindowTranslator.cpp +++ b/xbmc/input/WindowTranslator.cpp @@ -12,7 +12,7 @@ #include "application/Application.h" #include "guilib/WindowIDs.h" #include "pvr/PVRManager.h" -#include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "utils/StringUtils.h" #include "utils/log.h" @@ -294,11 +294,14 @@ int CWindowTranslator::GetVirtualWindow(int windowId) else if (g_application.CurrentFileItem().HasPVRChannelInfoTag()) { if (CServiceBroker::GetPVRManager() - .GUIActions() - ->GetChannelNumberInputHandler() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() .HasChannelNumber()) return WINDOW_FULLSCREEN_LIVETV_INPUT; - else if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().IsPreview()) + else if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .IsPreview()) return WINDOW_FULLSCREEN_LIVETV_PREVIEW; else return WINDOW_FULLSCREEN_LIVETV; @@ -313,11 +316,14 @@ int CWindowTranslator::GetVirtualWindow(int windowId) if (g_application.CurrentFileItem().HasPVRChannelInfoTag()) { if (CServiceBroker::GetPVRManager() - .GUIActions() - ->GetChannelNumberInputHandler() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() .HasChannelNumber()) return WINDOW_FULLSCREEN_RADIO_INPUT; - else if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().IsPreview()) + else if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .IsPreview()) return WINDOW_FULLSCREEN_RADIO_PREVIEW; else return WINDOW_FULLSCREEN_RADIO; diff --git a/xbmc/interfaces/builtins/PlayerBuiltins.cpp b/xbmc/interfaces/builtins/PlayerBuiltins.cpp index 80ea8b0785..2b9891af47 100644 --- a/xbmc/interfaces/builtins/PlayerBuiltins.cpp +++ b/xbmc/interfaces/builtins/PlayerBuiltins.cpp @@ -21,7 +21,7 @@ #include "guilib/GUIWindowManager.h" #include "pvr/PVRManager.h" #include "pvr/channels/PVRChannel.h" -#include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecording.h" #include "settings/MediaSettings.h" #include "settings/Settings.h" @@ -371,7 +371,7 @@ static int PlayerControl(const std::vector<std::string>& params) if (channel) { const std::shared_ptr<PVR::CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(channel); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(channel); if (!groupMember) { CLog::Log(LOGERROR, "ResumeLiveTv could not obtain channel group member for channel: {}", diff --git a/xbmc/interfaces/json-rpc/PVROperations.cpp b/xbmc/interfaces/json-rpc/PVROperations.cpp index 46ff382324..06ee28aa82 100644 --- a/xbmc/interfaces/json-rpc/PVROperations.cpp +++ b/xbmc/interfaces/json-rpc/PVROperations.cpp @@ -20,6 +20,7 @@ #include "pvr/epg/EpgContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecordings.h" #include "pvr/timers/PVRTimerInfoTag.h" #include "pvr/timers/PVRTimers.h" @@ -144,7 +145,7 @@ JSONRPC_STATUS CPVROperations::GetChannelDetails(const std::string &method, ITra return InvalidParams; const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(channel); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(channel); if (!groupMember) return InvalidParams; @@ -292,13 +293,13 @@ JSONRPC_STATUS CPVROperations::Scan(const std::string &method, ITransportLayer * if (parameterObject.isMember("clientid")) { - if (CServiceBroker::GetPVRManager().GUIActions()->StartChannelScan( + if (CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().StartChannelScan( parameterObject["clientid"].asInteger())) return ACK; } else { - if (CServiceBroker::GetPVRManager().GUIActions()->StartChannelScan()) + if (CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().StartChannelScan()) return ACK; } @@ -321,7 +322,7 @@ JSONRPC_STATUS CPVROperations::GetPropertyValue(const std::string &property, CVa else if (property == "scanning") { if (started) - result = CServiceBroker::GetPVRManager().GUIActions()->IsRunningChannelScan(); + result = CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().IsRunningChannelScan(); else result = false; } diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.cpp b/xbmc/interfaces/json-rpc/PlayerOperations.cpp index bca574611b..cf1415efe1 100644 --- a/xbmc/interfaces/json-rpc/PlayerOperations.cpp +++ b/xbmc/interfaces/json-rpc/PlayerOperations.cpp @@ -34,6 +34,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecordings.h" #include "settings/DisplaySettings.h" #include "utils/Variant.h" @@ -748,7 +749,7 @@ JSONRPC_STATUS CPlayerOperations::Open(const std::string &method, ITransportLaye return InvalidParams; const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(channel); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(channel); if (!groupMember) return InvalidParams; diff --git a/xbmc/pvr/PVRComponentRegistration.cpp b/xbmc/pvr/PVRComponentRegistration.cpp index 74076fc1e2..71ac975934 100644 --- a/xbmc/pvr/PVRComponentRegistration.cpp +++ b/xbmc/pvr/PVRComponentRegistration.cpp @@ -8,14 +8,18 @@ #include "PVRComponentRegistration.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" + #include <memory> using namespace PVR; CPVRComponentRegistration::CPVRComponentRegistration() { + RegisterComponent(std::make_shared<CPVRGUIActionsChannels>()); } CPVRComponentRegistration::~CPVRComponentRegistration() { + DeregisterComponent(typeid(CPVRGUIActionsChannels)); } diff --git a/xbmc/pvr/PVRManager.cpp b/xbmc/pvr/PVRManager.cpp index 33049fffca..1ea3d917ea 100644 --- a/xbmc/pvr/PVRManager.cpp +++ b/xbmc/pvr/PVRManager.cpp @@ -24,6 +24,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/guilib/PVRGUIChannelIconUpdater.h" #include "pvr/guilib/PVRGUIProgressHandler.h" #include "pvr/guilib/guiinfo/PVRGUIInfo.h" @@ -827,7 +828,7 @@ bool CPVRManager::IsCurrentlyParentalLocked(const std::shared_ptr<CPVRChannel>& void CPVRManager::OnPlaybackStarted(const CFileItemPtr& item) { m_playbackState->OnPlaybackStarted(item); - m_guiActions->OnPlaybackStarted(item); + Get<PVR::GUI::Channels>().OnPlaybackStarted(item); m_epgContainer.OnPlaybackStarted(); } @@ -837,7 +838,7 @@ void CPVRManager::OnPlaybackStopped(const CFileItemPtr& item) if (m_playbackState->OnPlaybackStopped(item)) PublishEvent(PVREvent::ChannelPlaybackStopped); - m_guiActions->OnPlaybackStopped(item); + Get<PVR::GUI::Channels>().OnPlaybackStopped(item); m_epgContainer.OnPlaybackStopped(); } diff --git a/xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp b/xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp index 3ce4a05359..bfbdce8896 100644 --- a/xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp +++ b/xbmc/pvr/dialogs/GUIDialogPVRChannelsOSD.cpp @@ -24,6 +24,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgContainer.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "settings/Settings.h" #include "settings/SettingsComponent.h" @@ -105,7 +106,10 @@ bool CGUIDialogPVRChannelsOSD::OnAction(const CAction& action) case ACTION_MOUSE_LEFT_CLICK: { // If direct channel number input is active, select the entered channel. - if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().CheckInputAndExecuteAction()) + if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .CheckInputAndExecuteAction()) return true; if (m_viewControl.HasControl(GetFocusedControlID())) diff --git a/xbmc/pvr/guilib/PVRGUIActionListener.cpp b/xbmc/pvr/guilib/PVRGUIActionListener.cpp index fec4e08e0e..302148537d 100644 --- a/xbmc/pvr/guilib/PVRGUIActionListener.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionListener.cpp @@ -25,6 +25,7 @@ #include "pvr/channels/PVRChannelGroups.h" #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "settings/Settings.h" #include "settings/SettingsComponent.h" #include "settings/lib/Setting.h" @@ -162,7 +163,10 @@ bool CPVRGUIActionListener::OnAction(const CAction& action) int iRemote = bIsJumpSMS ? action.GetID() - (ACTION_JUMP_SMS2 - REMOTE_2) : action.GetID(); cCharacter = static_cast<char>(iRemote - REMOTE_0) + '0'; } - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().AppendChannelNumberCharacter(cCharacter); + CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .AppendChannelNumberCharacter(cCharacter); return true; } return false; @@ -173,7 +177,7 @@ bool CPVRGUIActionListener::OnAction(const CAction& action) if (!bIsPlayingPVR) return false; - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().ToggleInfo(); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelNavigator().ToggleInfo(); return true; } @@ -183,15 +187,25 @@ bool CPVRGUIActionListener::OnAction(const CAction& action) return false; // If the button that caused this action matches action "Select" ... - if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool(CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH) && - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().IsPreview()) + if (CServiceBroker::GetSettingsComponent()->GetSettings()->GetBool( + CSettings::SETTING_PVRPLAYBACK_CONFIRMCHANNELSWITCH) && + CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .IsPreview()) { // ... and if "confirm channel switch" setting is active and a channel // preview is currently shown, switch to the currently previewed channel. - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().SwitchToCurrentChannel(); + CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .SwitchToCurrentChannel(); return true; } - else if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().CheckInputAndExecuteAction()) + else if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .CheckInputAndExecuteAction()) { // ... or if the action was processed by direct channel number input, we're done. return true; @@ -223,7 +237,10 @@ bool CPVRGUIActionListener::OnAction(const CAction& action) if (!bIsPlayingPVR) return false; - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().SelectNextChannel(GetChannelSwitchMode(action.GetID())); + CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .SelectNextChannel(GetChannelSwitchMode(action.GetID())); return true; } @@ -233,7 +250,10 @@ bool CPVRGUIActionListener::OnAction(const CAction& action) if (!bIsPlayingPVR) return false; - CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().SelectPreviousChannel(GetChannelSwitchMode(action.GetID())); + CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .SelectPreviousChannel(GetChannelSwitchMode(action.GetID())); return true; } @@ -352,7 +372,7 @@ void CPVRGUIActionListener::OnSettingAction(const std::shared_ptr<const CSetting } else if (settingId == CSettings::SETTING_PVRMANAGER_CHANNELSCAN) { - CServiceBroker::GetPVRManager().GUIActions()->StartChannelScan(); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().StartChannelScan(); } else if (settingId == CSettings::SETTING_PVRMENU_SEARCHICONS) { diff --git a/xbmc/pvr/guilib/PVRGUIActions.h b/xbmc/pvr/guilib/PVRGUIActions.h index 5a4a3403c7..f47a9ffd45 100644 --- a/xbmc/pvr/guilib/PVRGUIActions.h +++ b/xbmc/pvr/guilib/PVRGUIActions.h @@ -8,7 +8,6 @@ #pragma once -#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/guilib/PVRGUIActionsClients.h" #include "pvr/guilib/PVRGUIActionsDatabase.h" #include "pvr/guilib/PVRGUIActionsEPG.h" @@ -21,8 +20,7 @@ namespace PVR { -class CPVRGUIActions : public CPVRGUIActionsChannels, - public CPVRGUIActionsClients, +class CPVRGUIActions : public CPVRGUIActionsClients, public CPVRGUIActionsDatabase, public CPVRGUIActionsEPG, public CPVRGUIActionsParentalControl, diff --git a/xbmc/pvr/guilib/PVRGUIActionsChannels.cpp b/xbmc/pvr/guilib/PVRGUIActionsChannels.cpp index 40211e658c..2f59fc9d9d 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsChannels.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionsChannels.cpp @@ -326,9 +326,7 @@ CPVRGUIChannelNavigator& CPVRGUIActionsChannels::GetChannelNavigator() void CPVRGUIActionsChannels::OnPlaybackStarted(const CFileItemPtr& item) { - //! @todo decouple - const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*item); + const std::shared_ptr<CPVRChannelGroupMember> groupMember = GetChannelGroupMember(*item); if (groupMember) { m_channelNavigator.SetPlayingChannel(groupMember); diff --git a/xbmc/pvr/guilib/PVRGUIActionsChannels.h b/xbmc/pvr/guilib/PVRGUIActionsChannels.h index cf035cc5d9..91fa781839 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsChannels.h +++ b/xbmc/pvr/guilib/PVRGUIActionsChannels.h @@ -8,6 +8,7 @@ #pragma once +#include "pvr/IPVRComponent.h" #include "pvr/PVRChannelNumberInputHandler.h" #include "pvr/guilib/PVRGUIChannelNavigator.h" @@ -43,7 +44,7 @@ private: void SwitchToPreviousChannel(); }; -class CPVRGUIActionsChannels +class CPVRGUIActionsChannels : public IPVRComponent { public: CPVRGUIActionsChannels() = default; @@ -124,4 +125,10 @@ private: CPVRGUIChannelNavigator m_channelNavigator; }; +namespace GUI +{ +// pretty scope and name +using Channels = CPVRGUIActionsChannels; +} // namespace GUI + } // namespace PVR diff --git a/xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp b/xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp index 2df63233cd..df676ce433 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionsPlayback.cpp @@ -32,6 +32,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" //! @todo decouple +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecording.h" #include "pvr/recordings/PVRRecordings.h" #include "settings/MediaSettings.h" @@ -222,9 +223,8 @@ bool CPVRGUIActionsPlayback::PlayEpgTag(const CFileItemPtr& item) const CFileItem* itemToPlay = nullptr; if (props.EPGPlaybackAsLive()) { - //! @todo decouple const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*item); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*item); if (!groupMember) return false; @@ -316,9 +316,8 @@ bool CPVRGUIActionsPlayback::SwitchToChannel(const CFileItemPtr& item, bool bChe bFullscreen = true; break; } - //! @todo decouple const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*item); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*item); if (!groupMember) return false; diff --git a/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp b/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp index eb0dfcdd6c..ee2429665b 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionsTimers.cpp @@ -29,6 +29,7 @@ #include "pvr/dialogs/GUIDialogPVRTimerSettings.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" //! @todo decouple +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecording.h" #include "pvr/timers/PVRTimerInfoTag.h" #include "pvr/timers/PVRTimers.h" @@ -976,9 +977,9 @@ void CPVRGUIActionsTimers::AnnounceReminder(const std::shared_ptr<CPVRTimerInfoT if (bSwitch) { - //! @todo decouple const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(timer->Channel()); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember( + timer->Channel()); if (groupMember) { //! @todo decouple diff --git a/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp b/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp index d5a35973c9..3e7b4060c4 100644 --- a/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp +++ b/xbmc/pvr/guilib/PVRGUIActionsUtils.cpp @@ -18,6 +18,7 @@ #include "pvr/channels/PVRChannelGroupsContainer.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/PVRGUIActions.h" //! @todo decouple +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "settings/Settings.h" #include <memory> @@ -49,7 +50,7 @@ std::string CPVRGUIActionsUtils::GetSelectedItemPath(bool bRadio) const // if preselect playing channel is activated, return the path of the playing channel, if any. const std::shared_ptr<CPVRChannel> playingChannel = mgr.PlaybackState()->GetPlayingChannel(); if (playingChannel && playingChannel->IsRadio() == bRadio) - return mgr.GUIActions()->GetChannelGroupMember(playingChannel)->Path(); + return mgr.Get<PVR::GUI::Channels>().GetChannelGroupMember(playingChannel)->Path(); const std::shared_ptr<CPVREpgInfoTag> playingTag = mgr.PlaybackState()->GetPlayingEpgTag(); if (playingTag && playingTag->IsRadio() == bRadio) @@ -57,7 +58,7 @@ std::string CPVRGUIActionsUtils::GetSelectedItemPath(bool bRadio) const const std::shared_ptr<CPVRChannel> channel = mgr.ChannelGroups()->GetChannelForEpgTag(playingTag); if (channel) - return mgr.GUIActions()->GetChannelGroupMember(channel)->Path(); + return mgr.Get<PVR::GUI::Channels>().GetChannelGroupMember(channel)->Path(); } } diff --git a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp index 9c18269643..aa926cd8af 100644 --- a/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp +++ b/xbmc/pvr/guilib/guiinfo/PVRGUIInfo.cpp @@ -28,7 +28,7 @@ #include "pvr/channels/PVRRadioRDSInfoTag.h" #include "pvr/epg/EpgInfoTag.h" #include "pvr/epg/EpgSearchFilter.h" -#include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/providers/PVRProvider.h" #include "pvr/providers/PVRProviders.h" #include "pvr/recordings/PVRRecording.h" @@ -471,7 +471,7 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, const CGUIInf case LISTITEM_CHANNEL_NUMBER: { const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*item); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*item); if (groupMember) { strValue = groupMember->ChannelNumber().FormattedChannelNumber(); @@ -765,7 +765,7 @@ bool CPVRGUIInfo::GetListItemAndPlayerLabel(const CFileItem* item, const CGUIInf case LISTITEM_CHANNEL_NUMBER: { const std::shared_ptr<CPVRChannelGroupMember> groupMember = - CServiceBroker::GetPVRManager().GUIActions()->GetChannelGroupMember(*item); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().GetChannelGroupMember(*item); if (groupMember) { strValue = groupMember->ChannelNumber().FormattedChannelNumber(); @@ -995,7 +995,10 @@ bool CPVRGUIInfo::GetPVRLabel(const CFileItem* item, const CGUIInfo& info, std:: CharInfoTotalDiskSpace(strValue); return true; case PVR_CHANNEL_NUMBER_INPUT: - strValue = CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().GetChannelNumberLabel(); + strValue = CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .GetChannelNumberLabel(); return true; } @@ -1525,7 +1528,10 @@ bool CPVRGUIInfo::GetListItemAndPlayerBool(const CFileItem* item, const CGUIInfo case PLAYER_IS_CHANNEL_PREVIEW_ACTIVE: if (item->IsPVRChannel()) { - if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNavigator().IsPreviewAndShowInfo()) + if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNavigator() + .IsPreviewAndShowInfo()) { bValue = true; } diff --git a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp index 11715153bb..123f9383c8 100644 --- a/xbmc/pvr/windows/GUIWindowPVRChannels.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRChannels.cpp @@ -33,6 +33,7 @@ #include "pvr/epg/Epg.h" #include "pvr/epg/EpgContainer.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "utils/StringUtils.h" #include "utils/Variant.h" @@ -147,7 +148,10 @@ bool CGUIWindowPVRChannelsBase::OnMessage(CGUIMessage& message) message.GetParam1() == ACTION_MOUSE_LEFT_CLICK) { // If direct channel number input is active, select the entered channel. - if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().CheckInputAndExecuteAction()) + if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .CheckInputAndExecuteAction()) { bReturn = true; break; @@ -169,7 +173,8 @@ bool CGUIWindowPVRChannelsBase::OnMessage(CGUIMessage& message) CServiceBroker::GetPVRManager().GUIActions()->ShowEPGInfo(m_vecItems->Get(iItem)); break; case ACTION_DELETE_ITEM: - CServiceBroker::GetPVRManager().GUIActions()->HideChannel(m_vecItems->Get(iItem)); + CServiceBroker::GetPVRManager().Get<PVR::GUI::Channels>().HideChannel( + m_vecItems->Get(iItem)); break; case ACTION_CONTEXT_MENU: case ACTION_MOUSE_RIGHT_CLICK: diff --git a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp index 720e1dffb5..66d29924b2 100644 --- a/xbmc/pvr/windows/GUIWindowPVRGuide.cpp +++ b/xbmc/pvr/windows/GUIWindowPVRGuide.cpp @@ -35,6 +35,7 @@ #include "pvr/epg/EpgInfoTag.h" #include "pvr/guilib/GUIEPGGridContainer.h" #include "pvr/guilib/PVRGUIActions.h" +#include "pvr/guilib/PVRGUIActionsChannels.h" #include "pvr/recordings/PVRRecordings.h" #include "pvr/timers/PVRTimers.h" #include "settings/Settings.h" @@ -410,7 +411,10 @@ bool CGUIWindowPVRGuideBase::OnMessage(CGUIMessage& message) message.GetParam1() == ACTION_MOUSE_LEFT_CLICK) { // If direct channel number input is active, select the entered channel. - if (CServiceBroker::GetPVRManager().GUIActions()->GetChannelNumberInputHandler().CheckInputAndExecuteAction()) + if (CServiceBroker::GetPVRManager() + .Get<PVR::GUI::Channels>() + .GetChannelNumberInputHandler() + .CheckInputAndExecuteAction()) { bReturn = true; break; |