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/epg/EpgContainer.h" 15 #include "pvr/guilib/PVRGUIActionListener.h" 16 #include "pvr/settings/PVRSettings.h" 17 #include "threads/CriticalSection.h" 18 #include "threads/Event.h" 19 #include "threads/Thread.h" 20 #include "utils/EventStream.h" 32 class CPVRChannelGroup;
33 class CPVRChannelGroupsContainer;
39 class CPVRGUIProgressHandler;
40 class CPVRManagerJobQueue;
41 class CPVRPlaybackState;
57 ChannelPlaybackStopped,
61 ChannelGroupInvalidated,
62 ChannelGroupsInvalidated,
66 RecordingsInvalidated,
82 SavedSearchesInvalidated,
105 void Announce(ANNOUNCEMENT::AnnouncementFlag flag,
106 const std::string& sender,
107 const std::string& message,
117 return *m_components->GetComponent<T>();
124 std::shared_ptr<CPVRProviders> Providers()
const;
130 std::shared_ptr<CPVRChannelGroupsContainer> ChannelGroups()
const;
136 std::shared_ptr<CPVRRecordings> Recordings()
const;
142 std::shared_ptr<CPVRTimers> Timers()
const;
148 std::shared_ptr<CPVRClients> Clients()
const;
155 std::shared_ptr<CPVRClient> GetClient(
const CFileItem& item)
const;
162 std::shared_ptr<CPVRClient> GetClient(
int iClientId)
const;
168 std::shared_ptr<CPVRPlaybackState> PlaybackState()
const;
189 void Stop(
bool bRestart =
false);
215 std::shared_ptr<CPVRDatabase> GetTVDatabase()
const;
221 bool IsStarted()
const {
return GetState() == ManagerState::STATE_STARTED; }
227 bool EpgsCreated()
const;
233 void OnPlaybackStarted(
const CFileItem& item);
239 void OnPlaybackStopped(
const CFileItem& item);
245 void OnPlaybackEnded(
const CFileItem& item);
250 void TriggerEpgsCreate();
256 void TriggerRecordingsUpdate(
int clientId);
257 void TriggerRecordingsUpdate();
262 void TriggerRecordingsSizeInProgressUpdate();
268 void TriggerTimersUpdate(
int clientId);
269 void TriggerTimersUpdate();
275 void TriggerChannelsUpdate(
int clientId);
276 void TriggerChannelsUpdate();
282 void TriggerProvidersUpdate(
int clientId);
283 void TriggerProvidersUpdate();
289 void TriggerChannelGroupsUpdate(
int clientId);
290 void TriggerChannelGroupsUpdate();
295 void TriggerSearchMissingChannelIcons();
300 void TriggerCleanupCachedImages();
306 void TriggerSearchMissingChannelIcons(
const std::shared_ptr<CPVRChannelGroup>&
group);
311 void LocalizationChanged();
318 bool IsParentalLocked(
const std::shared_ptr<CPVRChannel>& channel)
const;
325 bool IsParentalLocked(
const std::shared_ptr<CPVREpgInfoTag>& epgTag)
const;
330 void RestartParentalTimer();
336 bool CreateChannelEpgs();
341 void ConnectionStateChange(
CPVRClient* client,
342 const std::string& connectString,
344 const std::string& message);
355 void PublishEvent(PVREvent state);
361 void Process()
override;
367 bool SetWakeupCommand();
369 enum class ManagerState
382 bool IsInitialising()
const {
return GetState() == ManagerState::STATE_STARTING; }
388 bool IsStopped()
const {
return GetState() == ManagerState::STATE_STOPPED; }
394 ManagerState GetState()
const;
400 void SetState(ManagerState state);
406 void UpdateComponents(ManagerState stateToCheck);
414 bool UpdateComponents(ManagerState stateToCheck,
415 const std::unique_ptr<CPVRGUIProgressHandler>& progressHandler);
420 void UnloadComponents();
426 bool IsKnownClient(
int clientID)
const;
431 void ResetProperties();
441 void TriggerPlayChannelOnStartup();
443 bool IsCurrentlyParentalLocked(
const std::shared_ptr<CPVRChannel>& channel,
444 bool bGenerallyLocked)
const;
450 std::shared_ptr<CPVRProviders> m_providers;
451 std::shared_ptr<CPVRChannelGroupsContainer>
453 std::shared_ptr<CPVRRecordings> m_recordings;
454 std::shared_ptr<CPVRTimers> m_timers;
455 std::shared_ptr<CPVRClients> m_addons;
456 std::unique_ptr<CPVRGUIInfo> m_guiInfo;
457 std::shared_ptr<CPVRComponentRegistration> m_components;
461 std::vector<std::shared_ptr<CPVRClient>> m_knownClients;
462 std::unique_ptr<CPVRManagerJobQueue> m_pendingUpdates;
463 std::shared_ptr<CPVRDatabase> m_database;
464 mutable CCriticalSection
466 bool m_bFirstStart =
true;
467 bool m_bEpgsCreated =
false;
469 mutable CCriticalSection m_managerStateMutex;
470 ManagerState m_managerState = ManagerState::STATE_STOPPED;
471 std::unique_ptr<CStopWatch> m_parentalTimer;
476 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:221
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:115
CEventStream< PVREvent > & Events()
Query the events available for CEventStream.
Definition: PVRManager.h:349
Definition: SmartPlayList.cpp:137
Definition: PVRManager.h:92
Definition: PVRClient.h:51
Definition: PVRSettings.h:27
Represents a file on a share.
Definition: FileItem.h:102