11 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_general.h" 12 #include "interfaces/IAnnouncer.h" 13 #include "pvr/PVRComponentRegistration.h" 14 #include "pvr/guilib/PVRGUIActionListener.h" 15 #include "pvr/settings/PVRSettings.h" 16 #include "threads/CriticalSection.h" 17 #include "threads/Event.h" 18 #include "threads/Thread.h" 19 #include "utils/EventStream.h" 31 class CPVRChannelGroup;
32 class CPVRChannelGroupsContainer;
38 class CPVRGUIProgressHandler;
39 class CPVRManagerJobQueue;
40 class CPVRPlaybackState;
44 class CPVREpgContainer;
58 ChannelPlaybackStopped,
62 ChannelGroupInvalidated,
63 ChannelGroupsInvalidated,
66 RecordingsInvalidated,
74 ClientsPrioritiesInvalidated,
86 SavedSearchesInvalidated,
109 void Announce(ANNOUNCEMENT::AnnouncementFlag flag,
110 const std::string& sender,
111 const std::string& message,
121 return *m_components->GetComponent<T>();
128 std::shared_ptr<CPVRProviders> Providers()
const;
134 std::shared_ptr<CPVRChannelGroupsContainer> ChannelGroups()
const;
140 std::shared_ptr<CPVRRecordings> Recordings()
const;
146 std::shared_ptr<CPVRTimers> Timers()
const;
152 std::shared_ptr<CPVRClients> Clients()
const;
159 std::shared_ptr<CPVRClient> GetClient(
const CFileItem& item)
const;
166 std::shared_ptr<CPVRClient> GetClient(
int iClientId)
const;
172 std::shared_ptr<CPVRPlaybackState> PlaybackState()
const;
193 void Stop(
bool bRestart =
false);
219 std::shared_ptr<CPVRDatabase> GetTVDatabase()
const;
225 bool IsStarted()
const {
return GetState() == ManagerState::STATE_STARTED; }
231 void OnPlaybackStarted(
const CFileItem& item);
237 void OnPlaybackStopped(
const CFileItem& item);
243 void OnPlaybackEnded(
const CFileItem& item);
249 void TriggerRecordingsUpdate(
int clientId);
250 void TriggerRecordingsUpdate();
255 void TriggerRecordingsSizeInProgressUpdate();
261 void TriggerTimersUpdate(
int clientId);
262 void TriggerTimersUpdate();
268 void TriggerChannelsUpdate(
int clientId);
269 void TriggerChannelsUpdate();
275 void TriggerProvidersUpdate(
int clientId);
276 void TriggerProvidersUpdate();
282 void TriggerChannelGroupsUpdate(
int clientId);
283 void TriggerChannelGroupsUpdate();
288 void TriggerSearchMissingChannelIcons();
293 void TriggerCleanupCachedImages();
299 void TriggerSearchMissingChannelIcons(
const std::shared_ptr<CPVRChannelGroup>&
group);
304 void LocalizationChanged();
311 bool IsParentalLocked(
const std::shared_ptr<const CPVRChannel>& channel)
const;
318 bool IsParentalLocked(
const std::shared_ptr<const CPVREpgInfoTag>& epgTag)
const;
323 void RestartParentalTimer();
328 void ConnectionStateChange(
CPVRClient* client,
329 const std::string& connectString,
331 const std::string& message);
342 void PublishEvent(PVREvent state);
348 void Process()
override;
354 bool SetWakeupCommand();
356 enum class ManagerState
369 bool IsInitialising()
const {
return GetState() == ManagerState::STATE_STARTING; }
375 bool IsStopped()
const {
return GetState() == ManagerState::STATE_STOPPED; }
381 ManagerState GetState()
const;
387 void SetState(ManagerState state);
393 void UpdateComponents(ManagerState stateToCheck);
401 bool UpdateComponents(ManagerState stateToCheck,
402 const std::unique_ptr<CPVRGUIProgressHandler>& progressHandler);
407 void UnloadComponents();
413 bool IsKnownClient(
int clientID)
const;
418 void ResetProperties();
428 void TriggerPlayChannelOnStartup();
430 bool IsCurrentlyParentalLocked(
const std::shared_ptr<const CPVRChannel>& channel,
431 bool bGenerallyLocked)
const;
437 std::shared_ptr<CPVRProviders> m_providers;
438 std::shared_ptr<CPVRChannelGroupsContainer>
440 std::shared_ptr<CPVRRecordings> m_recordings;
441 std::shared_ptr<CPVRTimers> m_timers;
442 std::shared_ptr<CPVRClients> m_addons;
443 std::unique_ptr<CPVRGUIInfo> m_guiInfo;
444 std::shared_ptr<CPVRComponentRegistration> m_components;
445 std::unique_ptr<CPVREpgContainer> m_epgContainer;
448 std::vector<std::shared_ptr<CPVRClient>> m_knownClients;
449 std::unique_ptr<CPVRManagerJobQueue> m_pendingUpdates;
450 std::shared_ptr<CPVRDatabase> m_database;
451 mutable CCriticalSection
453 bool m_bFirstStart =
true;
455 mutable CCriticalSection m_managerStateMutex;
456 ManagerState m_managerState = ManagerState::STATE_STOPPED;
457 std::unique_ptr<CStopWatch> m_parentalTimer;
462 const std::shared_ptr<CPVRPlaybackState> m_playbackState;
Definition: Stopwatch.h:14
Definition: EpgContainer.h:42
Definition: ContextMenuManager.h:24
bool IsStarted() const
Check whether the PVRManager has fully started.
Definition: PVRManager.h:225
Definition: IAnnouncer.h:70
Definition: PVRGUIActionListener.h:21
PVR_CONNECTION_STATE
Definition: pvr_general.h:81
T & Get()
Get a PVR component.
Definition: PVRManager.h:119
CEventStream< PVREvent > & Events()
Query the events available for CEventStream.
Definition: PVRManager.h:336
Definition: SmartPlayList.cpp:137
Definition: PVRManager.h:96
Definition: PVRClient.h:52
Definition: PVRSettings.h:27
Represents a file on a share.
Definition: FileItem.h:102