11 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_channels.h" 12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_providers.h" 13 #include "pvr/PVRCachedImage.h" 14 #include "pvr/channels/PVRChannelNumber.h" 15 #include "threads/CriticalSection.h" 16 #include "utils/ISerializable.h" 17 #include "utils/ISortable.h" 33 class CPVRRadioRDSInfoTag;
40 static const std::string IMAGE_OWNER_PATTERN;
43 CPVRChannel(
bool bRadio,
const std::string& iconPath);
57 void Serialize(
CVariant& value)
const override;
118 bool SetHidden(
bool bIsHidden,
bool bIsUserSetHidden =
false);
195 bool SetIconPath(
const std::string& strIconPath,
bool bIsUserSetIcon =
false);
208 bool SetChannelName(
const std::string& strChannelName,
bool bIsUserSetName =
false);
285 void ToSortable(SortItem& sortable, Field field)
const override;
290 std::pair<int, int>
StorageId()
const {
return std::make_pair(m_iClientId, m_iUniqueId); }
337 std::shared_ptr<CPVREpg>
GetEPG()
const;
343 std::vector<std::shared_ptr<CPVREpgInfoTag>>
GetEpgTags()
const;
375 std::shared_ptr<CPVREpgInfoTag>
GetEPGNow()
const;
395 std::shared_ptr<CPVREpgInfoTag>
GetEPGNext()
const;
430 bool CanRecord()
const;
432 static std::string GetEncryptionName(
int iCaid);
450 void Notify(
const PVREvent& event);
455 void Lock() { m_critSection.lock(); }
460 void Unlock() { m_critSection.unlock(); }
492 void UpdateEncryptionName();
504 bool SetClientProviderUid(
int iClientProviderUid);
509 int m_iChannelId = -1;
510 bool m_bIsRadio =
false;
511 bool m_bIsHidden =
false;
512 bool m_bIsUserSetName =
false;
513 bool m_bIsUserSetIcon =
false;
514 bool m_bIsUserSetHidden =
false;
515 bool m_bIsLocked =
false;
517 std::string m_strChannelName;
518 time_t m_iLastWatched = 0;
521 std::shared_ptr<CPVRRadioRDSInfoTag>
523 bool m_bHasArchive =
false;
530 bool m_bEPGEnabled =
false;
531 std::string m_strEPGScraper =
533 std::shared_ptr<CPVREpg> m_epg;
539 int m_iUniqueId = -1;
540 int m_iClientId = -1;
542 std::string m_strClientChannelName;
545 int m_iClientEncryptionSystem =
548 m_strClientEncryptionName;
549 int m_iClientOrder = 0;
550 int m_iClientProviderUid =
551 PVR_PROVIDER_INVALID_UID;
552 int m_lastWatchedGroupId{
556 mutable CCriticalSection m_critSection;
bool IsChanged() const
Check whether this channel has unpersisted data changes.
Definition: PVRChannel.cpp:740
std::shared_ptr< CPVREpgInfoTag > GetEPGNext() const
Get the EPG tag that will be next active on this channel.
Definition: PVRChannel.cpp:588
int ClientOrder() const
Get the client order for this channel.
Definition: PVRChannel.h:438
bool SetChannelID(int iDatabaseId)
Set the identifier for this channel.
Definition: PVRChannel.cpp:258
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetEpgTags() const
Get the EPG tags for this channel.
Definition: PVRChannel.cpp:536
int EncryptionSystem() const
Return the encryption system ID for this channel. 0 for FTA.
Definition: PVRChannel.cpp:787
bool IsUserSetName() const
Definition: PVRChannel.cpp:710
bool IsLocked() const
Definition: PVRChannel.cpp:686
bool IsHidden() const
Definition: PVRChannel.cpp:680
std::string MimeType() const
The stream input mime type.
Definition: PVRChannel.cpp:775
bool SetEPGScraper(const std::string &strScraper)
Set the name of the scraper to be used for this channel.
Definition: PVRChannel.cpp:633
Definition: PVRChannel.h:35
Definition: PVRCachedImage.h:16
bool IsRadio() const
Definition: PVRChannel.h:102
bool SetHidden(bool bIsHidden, bool bIsUserSetHidden=false)
Set to true to hide this channel. Set to false to unhide it.
Definition: PVRChannel.cpp:276
std::shared_ptr< CPVRProvider > GetProvider() const
Get the provider of this channel. This may be the default provider or a custom provider set by the cl...
Definition: PVRChannel.cpp:837
Definition: ContextMenuManager.h:24
bool UpdateFromClient(const std::shared_ptr< const CPVRChannel > &channel)
Update this channel tag with the data of the given channel tag.
Definition: PVRChannel.cpp:208
int ClientID() const
Definition: PVRChannel.cpp:757
bool IsNew() const
Definition: PVRChannel.cpp:674
std::string IconPath() const
Definition: PVRChannel.cpp:698
bool CreateEPG()
Create the EPG for this channel, if it does not yet exist.
Definition: PVRChannel.cpp:158
bool SetIconPath(const std::string &strIconPath, bool bIsUserSetIcon=false)
Set the path to the icon for this channel.
Definition: PVRChannel.cpp:346
"C" PVR add-on channel.
Definition: pvr_channels.h:40
std::string ChannelName() const
Definition: PVRChannel.cpp:728
bool IsEncrypted() const
Return true if this channel is encrypted.
Definition: PVRChannel.cpp:781
std::string ClientIconPath() const
Definition: PVRChannel.cpp:692
bool Persist()
Persists the changes in the database.
Definition: PVRChannel.cpp:234
std::shared_ptr< CPVREpgInfoTag > GetEPGPrevious() const
Get the EPG tag that was previously active on this channel.
Definition: PVRChannel.cpp:598
std::string ClientChannelName() const
Definition: PVRChannel.cpp:769
int ChannelID() const
Definition: PVRChannel.cpp:668
int LastWatchedGroupId() const
Definition: PVRChannel.cpp:722
std::shared_ptr< CPVREpgInfoTag > CreateEPGGapTag(const CDateTime &start, const CDateTime &end) const
Create a "gap" EPG tag.
Definition: PVRChannel.cpp:567
const CPVRChannelNumber & ClientChannelNumber() const
Definition: PVRChannel.cpp:763
void Unlock()
Unlock the instance. Other threads may get access to this channel again.
Definition: PVRChannel.h:460
std::string EncryptionName() const
Definition: PVRChannel.cpp:793
void Persisted()
reset changed flag after persist
Definition: PVRChannel.cpp:746
std::shared_ptr< CPVREpgInfoTag > GetEPGNow() const
Get the EPG tag that is now active on this channel.
Definition: PVRChannel.cpp:578
Definition: ISerializable.h:13
bool IsUserSetIcon() const
Definition: PVRChannel.cpp:704
void Notify(const PVREvent &event)
CEventStream callback for PVR events.
Definition: PVRChannel.cpp:184
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetEPGTimeline(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: PVRChannel.cpp:548
std::shared_ptr< CPVRRadioRDSInfoTag > GetRadioRDSInfoTag() const
Obtain the Radio RDS data for this channel, if available.
Definition: PVRChannel.cpp:314
bool SetChannelName(const std::string &strChannelName, bool bIsUserSetName=false)
Set the name for this channel used by XBMC.
Definition: PVRChannel.cpp:369
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
bool HasArchive() const
Definition: PVRChannel.cpp:326
Definition: ISortable.h:15
int ClientProviderUid() const
Get the client provider Uid for this channel.
Definition: PVRChannel.h:444
bool SetLocked(bool bIsLocked)
Set to true to lock this channel. Set to false to unlock it.
Definition: PVRChannel.cpp:295
bool SetLastWatched(time_t lastWatched, int groupId)
Set the last time the channel has been watched and the channel group used to watch.
Definition: PVRChannel.cpp:394
std::pair< int, int > StorageId() const
Definition: PVRChannel.h:290
Definition: PVRDatabase.h:33
void Lock()
Lock the instance. No other thread gets access to this channel until Unlock was called.
Definition: PVRChannel.h:455
std::shared_ptr< CPVRProvider > GetDefaultProvider() const
Get the default provider of this channel. The default provider represents the PVR add-on itself...
Definition: PVRChannel.cpp:825
void SetRadioRDSInfoTag(const std::shared_ptr< CPVRRadioRDSInfoTag > &tag)
Set the Radio RDS data for the channel.
Definition: PVRChannel.cpp:320
std::shared_ptr< CPVREpg > GetEPG() const
Get the EPG table for this channel.
Definition: PVRChannel.cpp:147
Definition: PVRChannelNumber.h:15
void FillAddonData(PVR_CHANNEL &channel) const
Copy over data to the given PVR_CHANNEL instance.
Definition: PVRChannel.cpp:87
bool IsUserSetHidden() const
Definition: PVRChannel.cpp:716
time_t LastWatched() const
Definition: PVRChannel.cpp:734
bool EPGEnabled() const
Definition: PVRChannel.cpp:805
int EpgID() const
Definition: PVRChannel.cpp:799
int UniqueID() const
A unique identifier for this channel.
Definition: PVRChannel.cpp:752
bool QueueDelete()
Delete this channel from the database.
Definition: PVRChannel.cpp:132
std::string EPGScraper() const
Get the name of the scraper to be used for this channel.
Definition: PVRChannel.cpp:811
bool HasClientProvider() const
Whether or not this channel has a provider set by the client.
Definition: PVRChannel.cpp:831
bool SetArchive(bool bHasArchive)
Set the archive support flag for this channel.
Definition: PVRChannel.cpp:332
bool SetClientID(int iClientId)
Set the identifier of the client that serves this channel.
Definition: PVRChannel.cpp:411
bool SetEPGEnabled(bool bEPGEnabled)
Set to true if an EPG should be used for this channel. Set to false otherwise.
Definition: PVRChannel.cpp:608