11 #include "XBDateTime.h" 12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_epg.h" 13 #include "pvr/epg/EpgTagsContainer.h" 14 #include "threads/CriticalSection.h" 15 #include "utils/EventStream.h" 27 class CPVREpgChannelData;
28 class CPVREpgDatabase;
44 const std::string& strName,
45 const std::string& strScraperName,
46 const std::shared_ptr<CPVREpgDatabase>& database);
57 const std::string& strName,
58 const std::string& strScraperName,
59 const std::shared_ptr<CPVREpgChannelData>& channelData,
60 const std::shared_ptr<CPVREpgDatabase>& database);
77 void SetChannelData(
const std::shared_ptr<CPVREpgChannelData>& data);
106 const std::string&
Name()
const;
129 std::shared_ptr<CPVREpgInfoTag>
GetTagNow()
const;
135 std::shared_ptr<CPVREpgInfoTag>
GetTagNext()
const;
157 std::shared_ptr<CPVREpgInfoTag>
GetTagByBroadcastId(
unsigned int iUniqueBroadcastId)
const;
192 bool Update(time_t start, time_t end,
int iUpdateTime,
int iPastDays,
const std::shared_ptr<CPVREpgDatabase>& database,
bool bForceUpdate =
false);
198 std::vector<std::shared_ptr<CPVREpgInfoTag>>
GetTags()
const;
267 void Lock() { m_critSection.lock(); }
272 void Unlock() { m_critSection.unlock(); }
299 bool UpdateFromScraper(time_t start, time_t end,
bool bForceUpdate);
306 bool UpdateEntries(
const CPVREpg& epg);
314 bool m_bChanged =
false;
315 std::atomic<bool> m_bUpdatePending = {
false};
317 std::string m_strName;
318 std::string m_strScraperName;
320 mutable CCriticalSection m_critSection;
321 bool m_bUpdateLastScanTime =
false;
322 std::shared_ptr<CPVREpgChannelData> m_channelData;
std::shared_ptr< CPVREpgInfoTag > GetTagNow() const
Get the event that is occurring now.
Definition: Epg.cpp:87
bool NeedsSave() const
Check whether this EPG has unsaved data.
Definition: Epg.cpp:525
std::shared_ptr< CPVREpgInfoTag > GetTagByDatabaseId(int iDatabaseId) const
Get the event matching the given database id.
Definition: Epg.cpp:122
int CleanupCachedImages(const std::shared_ptr< CPVREpgDatabase > &database)
Erase stale texture db entries and image files.
Definition: Epg.cpp:545
Definition: EpgDatabase.h:31
std::shared_ptr< CPVREpgInfoTag > GetTagBetween(const CDateTime &beginTime, const CDateTime &endTime, bool bUpdateFromClient=false)
Get the event that occurs between the given begin and end time.
Definition: Epg.cpp:128
Definition: ContextMenuManager.h:24
bool UpdatePending() const
Returns if there is a manual update pending for this EPG.
Definition: Epg.cpp:520
void Clear()
Remove all entries from this EPG.
Definition: Epg.cpp:69
int ChannelID() const
The id of the channel associated with this EPG.
Definition: Epg.cpp:496
"C" PVR add-on channel group member.
Definition: pvr_epg.h:622
void RemovedFromContainer()
Called to inform the EPG that it has been removed from the EPG container.
Definition: Epg.cpp:540
int EpgID() const
Get the database ID of this table.
Definition: Epg.cpp:514
void Unlock()
Unlock the instance. Other threads may get access to this EPG again.
Definition: Epg.h:272
std::shared_ptr< CPVREpgInfoTag > GetTagNext() const
Get the event that will occur next.
Definition: Epg.cpp:93
void Lock()
Lock the instance. No other thread gets access to this EPG until Unlock was called.
Definition: Epg.h:267
static const std::string & ConvertGenreIdToString(int iID, int iSubID)
Convert a genre id and subid to a human readable name.
Definition: Epg.cpp:435
const std::string & Name() const
Get the name of this table.
Definition: Epg.cpp:508
bool CheckPlayingEvent()
Notify observers when the currently active tag changed.
Definition: Epg.cpp:105
bool QueuePersistQuery(const std::shared_ptr< CPVREpgDatabase > &database)
Write the query to persist data into given database's queue.
Definition: Epg.cpp:324
bool UpdateEntry(const EPG_TAG *data, int iClientId)
Update an entry in this EPG.
Definition: Epg.cpp:195
void Cleanup(const CDateTime &time)
Remove all entries from this EPG that finished before the given time.
Definition: Epg.cpp:81
CEventStream< PVREvent > & Events()
Query the events available for CEventStream.
Definition: Epg.h:262
const std::string & ScraperName() const
Get the name of the scraper to use for this table.
Definition: Epg.cpp:502
void ForceUpdate()
Clear the current tags and schedule manual update.
Definition: Epg.cpp:63
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
bool Update(time_t start, time_t end, int iUpdateTime, int iPastDays, const std::shared_ptr< CPVREpgDatabase > &database, bool bForceUpdate=false)
Update the EPG from 'start' till 'end'.
Definition: Epg.cpp:248
bool QueueDeleteQueries(const std::shared_ptr< CPVREpgDatabase > &database)
Write the delete queries into the given database's queue.
Definition: Epg.cpp:357
std::pair< CDateTime, CDateTime > GetFirstAndLastUncommitedEPGDate() const
Get the start and end time of the last not yet commited entry in this table.
Definition: Epg.cpp:381
std::shared_ptr< CPVREpgInfoTag > GetTagByBroadcastId(unsigned int iUniqueBroadcastId) const
Get the event matching the given unique broadcast id.
Definition: Epg.cpp:116
bool IsValid() const
Check whether this EPG is valid.
Definition: Epg.cpp:531
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetTags() const
Get all EPG tags.
Definition: Epg.cpp:318
std::shared_ptr< CPVREpgChannelData > GetChannelData() const
Get data for the channel associated with this EPG.
Definition: Epg.cpp:483
std::shared_ptr< CPVREpgInfoTag > GetTagPrevious() const
Get the event that occurred previously.
Definition: Epg.cpp:99
EPG_EVENT_STATE
Definition: pvr_epg.h:601
virtual ~CPVREpg()
Destroy this EPG instance.
Definition: Epg.cpp:58
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetTimeline(const CDateTime &timelineStart, const CDateTime &timelineEnd, const CDateTime &minEventEnd, const CDateTime &maxEventStart) const
Get all EPG tags for the given time frame, including "gap" tags.
Definition: Epg.cpp:155
void SetChannelData(const std::shared_ptr< CPVREpgChannelData > &data)
Set data for the channel associated with this EPG.
Definition: Epg.cpp:489