/
GUIWindowPVRBase.h
132 lines (110 loc) · 4.29 KB
/
GUIWindowPVRBase.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#pragma once
/*
* Copyright (C) 2012-2013 Team XBMC
* http://xbmc.org
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This Program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with XBMC; see the file COPYING. If not, see
* <http://www.gnu.org/licenses/>.
*
*/
#include "utils/Observer.h"
#include "windows/GUIMediaWindow.h"
#include "pvr/PVRTypes.h"
#define CONTROL_BTNVIEWASICONS 2
#define CONTROL_BTNSORTBY 3
#define CONTROL_BTNSORTASC 4
#define CONTROL_BTNGROUPITEMS 5
#define CONTROL_BTNSHOWHIDDEN 6
#define CONTROL_BTNSHOWDELETED 7
#define CONTROL_BTNHIDEDISABLEDTIMERS 8
#define CONTROL_BTNCHANNELGROUPS 28
#define CONTROL_BTNFILTERCHANNELS 31
#define CONTROL_LABEL_HEADER1 29
#define CONTROL_LABEL_HEADER2 30
class CGUIDialogProgressBarHandle;
namespace PVR
{
enum EPGSelectAction
{
EPG_SELECT_ACTION_CONTEXT_MENU = 0,
EPG_SELECT_ACTION_SWITCH = 1,
EPG_SELECT_ACTION_INFO = 2,
EPG_SELECT_ACTION_RECORD = 3,
EPG_SELECT_ACTION_PLAY_RECORDING = 4,
};
class CGUIWindowPVRBase : public CGUIMediaWindow, public Observer
{
public:
virtual ~CGUIWindowPVRBase(void);
virtual void OnInitWindow(void) override;
virtual void OnDeinitWindow(int nextWindowID) override;
virtual bool OnMessage(CGUIMessage& message) override;
virtual bool Update(const std::string &strDirectory, bool updateFilterPath = true) override;
virtual void UpdateButtons(void) override;
virtual bool OnAction(const CAction &action) override;
virtual bool OnBack(int actionID) override;
virtual bool OpenChannelGroupSelectionDialog(void);
virtual void Notify(const Observable &obs, const ObservableMessage msg) override;
virtual void SetInvalid() override;
virtual bool CanBeActivated() const override;
static std::string GetSelectedItemPath(bool bRadio);
static void SetSelectedItemPath(bool bRadio, const std::string &path);
/*!
* @brief Refresh window content.
* @return true, if refresh succeeded, false otherwise.
*/
bool DoRefresh(void) { return Refresh(true); }
protected:
CGUIWindowPVRBase(bool bRadio, int id, const std::string &xmlFile);
virtual std::string GetDirectoryPath(void) = 0;
virtual void ClearData();
/*!
* @brief Init this window's channel group with the currently active (the "playing") channel group.
* @return true if group could be set, false otherwise.
*/
bool InitChannelGroup(void);
/*!
* @brief Get the channel group for this window.
* @return the group or null, if no group set.
*/
virtual CPVRChannelGroupPtr GetChannelGroup(void);
/*!
* @brief Set a new channel group, start listening to this group, optionally update window content.
* @param group The new group.
* @param bUpdate if true, window content will be updated.
*/
void SetChannelGroup(const CPVRChannelGroupPtr &group, bool bUpdate = true);
virtual void UpdateSelectedItemPath();
void RegisterObservers(void);
void UnregisterObservers(void);
static CCriticalSection m_selectedItemPathsLock;
static std::string m_selectedItemPaths[2];
CCriticalSection m_critSection;
bool m_bRadio;
private:
/*!
* @brief Show or update the progress dialog.
* @param strText The current status.
* @param iProgress The current progress in %.
*/
void ShowProgressDialog(const std::string &strText, int iProgress);
/*!
* @brief Hide the progress dialog if it's visible.
*/
void HideProgressDialog(void);
CPVRChannelGroupPtr m_channelGroup;
XbmcThreads::EndTime m_refreshTimeout;
CGUIDialogProgressBarHandle *m_progressHandle; /*!< progress dialog that is displayed while the pvr manager is loading */
};
}