[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / pvr / windows / GUIWindowPVRGuide.h
blob5ae5f54ab1facb6583d0fdc61eedde915f712d14
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include "pvr/PVRChannelNumberInputHandler.h"
12 #include "pvr/windows/GUIWindowPVRBase.h"
13 #include "threads/Event.h"
14 #include "threads/Thread.h"
16 #include <atomic>
17 #include <memory>
18 #include <string>
20 class CFileItemList;
21 class CGUIMessage;
23 namespace PVR
25 enum class PVREvent;
27 class CPVRChannelGroup;
28 class CGUIEPGGridContainer;
29 class CPVRRefreshTimelineItemsThread;
31 class CGUIWindowPVRGuideBase : public CGUIWindowPVRBase, public CPVRChannelNumberInputHandler
33 public:
34 CGUIWindowPVRGuideBase(bool bRadio, int id, const std::string& xmlFile);
35 ~CGUIWindowPVRGuideBase() override;
37 void OnInitWindow() override;
38 void OnDeinitWindow(int nextWindowID) override;
39 bool OnMessage(CGUIMessage& message) override;
40 bool OnAction(const CAction& action) override;
41 void GetContextButtons(int itemNumber, CContextButtons& buttons) override;
42 bool OnContextButton(int itemNumber, CONTEXT_BUTTON button) override;
43 void UpdateButtons() override;
44 void SetInvalid() override;
45 bool Update(const std::string& strDirectory, bool updateFilterPath = true) override;
47 void NotifyEvent(const PVREvent& event) override;
49 bool RefreshTimelineItems();
51 // CPVRChannelNumberInputHandler implementation
52 void GetChannelNumbers(std::vector<std::string>& channelNumbers) override;
53 void OnInputDone() override;
55 bool GotoBegin();
56 bool GotoEnd();
57 bool GotoCurrentProgramme();
58 bool GotoDate(int deltaHours);
59 bool OpenDateSelectionDialog();
60 bool Go12HoursBack();
61 bool Go12HoursForward();
62 bool GotoFirstChannel();
63 bool GotoLastChannel();
64 bool GotoPlayingChannel();
66 protected:
67 void UpdateSelectedItemPath() override;
68 std::string GetDirectoryPath() override { return ""; }
69 bool GetDirectory(const std::string& strDirectory, CFileItemList& items) override;
70 void FormatAndSort(CFileItemList& items) override;
71 CFileItemPtr GetCurrentListItem(int offset = 0) override;
73 void ClearData() override;
75 private:
76 CGUIEPGGridContainer* GetGridControl();
77 void InitEpgGridControl();
79 bool OnContextButtonNavigate(CONTEXT_BUTTON button);
81 bool ShouldNavigateToGridContainer(int iAction);
83 void StartRefreshTimelineItemsThread();
84 void StopRefreshTimelineItemsThread();
86 void RefreshView(CGUIMessage& message, bool bInitGridControl);
88 int GetCurrentListItemIndex(const std::shared_ptr<const CFileItem>& item);
90 std::unique_ptr<CPVRRefreshTimelineItemsThread> m_refreshTimelineItemsThread;
91 std::atomic_bool m_bRefreshTimelineItems{false};
92 std::atomic_bool m_bSyncRefreshTimelineItems{false};
94 std::shared_ptr<CPVRChannelGroup> m_cachedChannelGroup;
96 bool m_bChannelSelectionRestored{false};
99 class CGUIWindowPVRTVGuide : public CGUIWindowPVRGuideBase
101 public:
102 CGUIWindowPVRTVGuide() : CGUIWindowPVRGuideBase(false, WINDOW_TV_GUIDE, "MyPVRGuide.xml") {}
103 std::string GetRootPath() const override;
106 class CGUIWindowPVRRadioGuide : public CGUIWindowPVRGuideBase
108 public:
109 CGUIWindowPVRRadioGuide() : CGUIWindowPVRGuideBase(true, WINDOW_RADIO_GUIDE, "MyPVRGuide.xml") {}
110 std::string GetRootPath() const override;
113 class CPVRRefreshTimelineItemsThread : public CThread
115 public:
116 explicit CPVRRefreshTimelineItemsThread(CGUIWindowPVRGuideBase* pGuideWindow);
117 ~CPVRRefreshTimelineItemsThread() override;
119 void Process() override;
121 void DoRefresh(bool bWait);
122 void Stop();
124 private:
125 CGUIWindowPVRGuideBase* m_pGuideWindow;
126 CEvent m_ready;
127 CEvent m_done;
129 } // namespace PVR