| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
#include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h" |
| 12 |
#include "guilib/guiinfo/GUIInfoProvider.h" |
| 13 |
#include "pvr/addons/PVRClients.h" |
| 14 |
#include "pvr/guilib/guiinfo/PVRGUITimerInfo.h" |
| 15 |
#include "pvr/guilib/guiinfo/PVRGUITimesInfo.h" |
| 16 |
#include "threads/CriticalSection.h" |
| 17 |
#include "threads/Thread.h" |
| 18 |
|
| 19 |
#include <atomic> |
| 20 |
#include <string> |
| 21 |
#include <vector> |
| 22 |
|
| 23 |
class CFileItem; |
| 24 |
|
| 25 |
namespace KODI |
| 26 |
{ |
| 27 |
namespace GUILIB |
| 28 |
{ |
| 29 |
namespace GUIINFO |
| 30 |
{ |
| 31 |
class CGUIInfo; |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|
| 36 |
namespace PVR |
| 37 |
{ |
| 38 |
enum class PVREvent; |
| 39 |
struct PVRChannelNumberInputChangedEvent; |
| 40 |
struct PVRPreviewAndPlayerShowInfoChangedEvent; |
| 41 |
|
| 42 |
class CPVRGUIInfo : public KODI::GUILIB::GUIINFO::CGUIInfoProvider, private CThread |
| 43 |
{ |
| 44 |
public: |
| 45 |
CPVRGUIInfo(); |
| 46 |
~CPVRGUIInfo() override = default; |
| 47 |
|
| 48 |
void Start(); |
| 49 |
void Stop(); |
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
void Notify(const PVREvent& event); |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
void Notify(const PVRChannelNumberInputChangedEvent& event); |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
void Notify(const PVRPreviewAndPlayerShowInfoChangedEvent& event); |
| 68 |
|
| 69 |
|
| 70 |
bool InitCurrentItem(CFileItem* item) override; |
| 71 |
bool GetLabel(std::string& value, |
| 72 |
const CFileItem* item, |
| 73 |
int contextWindow, |
| 74 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 75 |
std::string* fallback) const override; |
| 76 |
bool GetFallbackLabel(std::string& value, |
| 77 |
const CFileItem* item, |
| 78 |
int contextWindow, |
| 79 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 80 |
std::string* fallback) override; |
| 81 |
bool GetInt(int& value, |
| 82 |
const CGUIListItem* item, |
| 83 |
int contextWindow, |
| 84 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info) const override; |
| 85 |
bool GetBool(bool& value, |
| 86 |
const CGUIListItem* item, |
| 87 |
int contextWindow, |
| 88 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info) const override; |
| 89 |
|
| 90 |
private: |
| 91 |
void ResetProperties(); |
| 92 |
void ClearQualityInfo(PVR_SIGNAL_STATUS& qualityInfo); |
| 93 |
void ClearDescrambleInfo(PVR_DESCRAMBLE_INFO& descrambleInfo); |
| 94 |
|
| 95 |
void Process() override; |
| 96 |
|
| 97 |
void UpdateTimersCache(); |
| 98 |
void UpdateBackendCache(); |
| 99 |
void UpdateQualityData(); |
| 100 |
void UpdateDescrambleData(); |
| 101 |
void UpdateMisc(); |
| 102 |
void UpdateNextTimer(); |
| 103 |
void UpdateTimeshiftData(); |
| 104 |
void UpdateTimeshiftProgressData(); |
| 105 |
|
| 106 |
void UpdateTimersToggle(); |
| 107 |
|
| 108 |
bool GetListItemAndPlayerLabel(const CFileItem* item, |
| 109 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 110 |
std::string& strValue) const; |
| 111 |
bool GetPVRLabel(const CFileItem* item, |
| 112 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 113 |
std::string& strValue) const; |
| 114 |
bool GetRadioRDSLabel(const CFileItem* item, |
| 115 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 116 |
std::string& strValue) const; |
| 117 |
|
| 118 |
bool GetListItemAndPlayerInt(const CFileItem* item, |
| 119 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 120 |
int& iValue) const; |
| 121 |
bool GetPVRInt(const CFileItem* item, |
| 122 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 123 |
int& iValue) const; |
| 124 |
int GetTimeShiftSeekPercent() const; |
| 125 |
|
| 126 |
bool GetListItemAndPlayerBool(const CFileItem* item, |
| 127 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 128 |
bool& bValue) const; |
| 129 |
bool GetPVRBool(const CFileItem* item, |
| 130 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 131 |
bool& bValue) const; |
| 132 |
bool GetRadioRDSBool(const CFileItem* item, |
| 133 |
const KODI::GUILIB::GUIINFO::CGUIInfo& info, |
| 134 |
bool& bValue) const; |
| 135 |
|
| 136 |
void CharInfoBackendNumber(std::string& strValue) const; |
| 137 |
void CharInfoTotalDiskSpace(std::string& strValue) const; |
| 138 |
void CharInfoSignal(std::string& strValue) const; |
| 139 |
void CharInfoSNR(std::string& strValue) const; |
| 140 |
void CharInfoBER(std::string& strValue) const; |
| 141 |
void CharInfoUNC(std::string& strValue) const; |
| 142 |
void CharInfoFrontendName(std::string& strValue) const; |
| 143 |
void CharInfoFrontendStatus(std::string& strValue) const; |
| 144 |
void CharInfoBackendName(std::string& strValue) const; |
| 145 |
void CharInfoBackendVersion(std::string& strValue) const; |
| 146 |
void CharInfoBackendHost(std::string& strValue) const; |
| 147 |
void CharInfoBackendDiskspace(std::string& strValue) const; |
| 148 |
void CharInfoBackendProviders(std::string& strValue) const; |
| 149 |
void CharInfoBackendChannelGroups(std::string& strValue) const; |
| 150 |
void CharInfoBackendChannels(std::string& strValue) const; |
| 151 |
void CharInfoBackendTimers(std::string& strValue) const; |
| 152 |
void CharInfoBackendRecordings(std::string& strValue) const; |
| 153 |
void CharInfoBackendDeletedRecordings(std::string& strValue) const; |
| 154 |
void CharInfoPlayingClientName(std::string& strValue) const; |
| 155 |
void CharInfoEncryption(std::string& strValue) const; |
| 156 |
void CharInfoService(std::string& strValue) const; |
| 157 |
void CharInfoMux(std::string& strValue) const; |
| 158 |
void CharInfoProvider(std::string& strValue) const; |
| 159 |
|
| 160 |
|
| 161 |
|
| 162 |
CPVRGUIAnyTimerInfo m_anyTimersInfo; |
| 163 |
CPVRGUITVTimerInfo m_tvTimersInfo; |
| 164 |
CPVRGUIRadioTimerInfo m_radioTimersInfo; |
| 165 |
|
| 166 |
CPVRGUITimesInfo m_timesInfo; |
| 167 |
|
| 168 |
bool m_bHasTVRecordings; |
| 169 |
bool m_bHasRadioRecordings; |
| 170 |
unsigned int m_iCurrentActiveClient; |
| 171 |
std::string m_strPlayingClientName; |
| 172 |
std::string m_strBackendName; |
| 173 |
std::string m_strBackendVersion; |
| 174 |
std::string m_strBackendHost; |
| 175 |
std::string m_strBackendTimers; |
| 176 |
std::string m_strBackendRecordings; |
| 177 |
std::string m_strBackendDeletedRecordings; |
| 178 |
std::string m_strBackendProviders; |
| 179 |
std::string m_strBackendChannelGroups; |
| 180 |
std::string m_strBackendChannels; |
| 181 |
long long m_iBackendDiskTotal; |
| 182 |
long long m_iBackendDiskUsed; |
| 183 |
bool m_bIsPlayingTV; |
| 184 |
bool m_bIsPlayingRadio; |
| 185 |
bool m_bIsPlayingRecording; |
| 186 |
bool m_bIsPlayingEpgTag; |
| 187 |
bool m_bIsPlayingEncryptedStream; |
| 188 |
bool m_bHasTVChannels; |
| 189 |
bool m_bHasRadioChannels; |
| 190 |
bool m_bCanRecordPlayingChannel; |
| 191 |
bool m_bIsRecordingPlayingChannel; |
| 192 |
bool m_bIsPlayingActiveRecording; |
| 193 |
std::string m_strPlayingTVGroup; |
| 194 |
std::string m_strPlayingRadioGroup; |
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
PVR_SIGNAL_STATUS m_qualityInfo; |
| 199 |
PVR_DESCRAMBLE_INFO m_descrambleInfo; |
| 200 |
std::vector<SBackend> m_backendProperties; |
| 201 |
|
| 202 |
std::string m_channelNumberInput; |
| 203 |
bool m_previewAndPlayerShowInfo{false}; |
| 204 |
|
| 205 |
mutable CCriticalSection m_critSection; |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
|
| 211 |
|
| 212 |
|
| 213 |
mutable std::atomic<bool> m_updateBackendCacheRequested; |
| 214 |
|
| 215 |
bool m_bRegistered; |
| 216 |
}; |
| 217 |
} |