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);
190 bool SetIconPath(
const std::string& strIconPath,
bool bIsUserSetIcon =
false);
203 bool SetChannelName(
const std::string& strChannelName,
bool bIsUserSetName =
false);
279 void ToSortable(SortItem& sortable, Field field)
const override;
284 std::pair<int, int>
StorageId()
const {
return std::make_pair(m_iClientId, m_iUniqueId); }
331 std::shared_ptr<CPVREpg>
GetEPG()
const;
337 std::vector<std::shared_ptr<CPVREpgInfoTag>>
GetEpgTags()
const;
369 std::shared_ptr<CPVREpgInfoTag>
GetEPGNow()
const;
389 std::shared_ptr<CPVREpgInfoTag>
GetEPGNext()
const;
424 bool CanRecord()
const;
426 static std::string GetEncryptionName(
int iCaid);
444 void Notify(
const PVREvent& event);
449 void Lock() { m_critSection.lock(); }
454 void Unlock() { m_critSection.unlock(); }
486 void UpdateEncryptionName();
498 bool SetClientProviderUid(
int iClientProviderUid);
503 int m_iChannelId = -1;
504 bool m_bIsRadio =
false;
505 bool m_bIsHidden =
false;
506 bool m_bIsUserSetName =
false;
507 bool m_bIsUserSetIcon =
false;
508 bool m_bIsUserSetHidden =
false;
509 bool m_bIsLocked =
false;
511 std::string m_strChannelName;
512 time_t m_iLastWatched = 0;
515 std::shared_ptr<CPVRRadioRDSInfoTag>
517 bool m_bHasArchive =
false;
524 bool m_bEPGEnabled =
false;
525 std::string m_strEPGScraper =
527 std::shared_ptr<CPVREpg> m_epg;
533 int m_iUniqueId = -1;
534 int m_iClientId = -1;
536 std::string m_strClientChannelName;
539 int m_iClientEncryptionSystem =
542 m_strClientEncryptionName;
543 int m_iClientOrder = 0;
544 int m_iClientProviderUid =
545 PVR_PROVIDER_INVALID_UID;
548 mutable CCriticalSection m_critSection;
bool IsChanged() const
Check whether this channel has unpersisted data changes.
Definition: PVRChannel.cpp:738
std::shared_ptr< CPVREpgInfoTag > GetEPGNext() const
Get the EPG tag that will be next active on this channel.
Definition: PVRChannel.cpp:592
int ClientOrder() const
Get the client order for this channel.
Definition: PVRChannel.h:432
bool SetChannelID(int iDatabaseId)
Set the identifier for this channel.
Definition: PVRChannel.cpp:255
std::vector< std::shared_ptr< CPVREpgInfoTag > > GetEpgTags() const
Get the EPG tags for this channel.
Definition: PVRChannel.cpp:540
int EncryptionSystem() const
Return the encryption system ID for this channel. 0 for FTA.
Definition: PVRChannel.cpp:785
bool IsUserSetName() const
Definition: PVRChannel.cpp:714
bool IsLocked() const
Definition: PVRChannel.cpp:690
bool IsHidden() const
Definition: PVRChannel.cpp:684
std::string MimeType() const
The stream input mime type.
Definition: PVRChannel.cpp:773
bool SetEPGScraper(const std::string &strScraper)
Set the name of the scraper to be used for this channel.
Definition: PVRChannel.cpp:637
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:273
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:834
Definition: ContextMenuManager.h:24
int ClientID() const
Definition: PVRChannel.cpp:755
bool IsNew() const
Definition: PVRChannel.cpp:678
std::string IconPath() const
Definition: PVRChannel.cpp:702
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:343
"C" PVR add-on channel.
Definition: pvr_channels.h:40
std::string ChannelName() const
Definition: PVRChannel.cpp:726
bool IsEncrypted() const
Return true if this channel is encrypted.
Definition: PVRChannel.cpp:779
std::string ClientIconPath() const
Definition: PVRChannel.cpp:696
bool Persist()
Persists the changes in the database.
Definition: PVRChannel.cpp:231
std::shared_ptr< CPVREpgInfoTag > GetEPGPrevious() const
Get the EPG tag that was previously active on this channel.
Definition: PVRChannel.cpp:602
std::string ClientChannelName() const
Definition: PVRChannel.cpp:767
int ChannelID() const
Definition: PVRChannel.cpp:672
std::shared_ptr< CPVREpgInfoTag > CreateEPGGapTag(const CDateTime &start, const CDateTime &end) const
Create a "gap" EPG tag.
Definition: PVRChannel.cpp:571
const CPVRChannelNumber & ClientChannelNumber() const
Definition: PVRChannel.cpp:761
void Unlock()
Unlock the instance. Other threads may get access to this channel again.
Definition: PVRChannel.h:454
std::string EncryptionName() const
Definition: PVRChannel.cpp:791
void Persisted()
reset changed flag after persist
Definition: PVRChannel.cpp:744
std::shared_ptr< CPVREpgInfoTag > GetEPGNow() const
Get the EPG tag that is now active on this channel.
Definition: PVRChannel.cpp:582
Definition: ISerializable.h:13
bool IsUserSetIcon() const
Definition: PVRChannel.cpp:708
void Notify(const PVREvent &event)
CEventStream callback for PVR events.
Definition: PVRChannel.cpp:181
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:552
std::shared_ptr< CPVRRadioRDSInfoTag > GetRadioRDSInfoTag() const
Obtain the Radio RDS data for this channel, if available.
Definition: PVRChannel.cpp:311
bool SetChannelName(const std::string &strChannelName, bool bIsUserSetName=false)
Set the name for this channel used by XBMC.
Definition: PVRChannel.cpp:366
DateTime class, which uses FileTime as it's base.
Definition: XBDateTime.h:63
bool UpdateFromClient(const std::shared_ptr< CPVRChannel > &channel)
Update this channel tag with the data of the given channel tag.
Definition: PVRChannel.cpp:205
bool HasArchive() const
Definition: PVRChannel.cpp:323
Definition: ISortable.h:15
int ClientProviderUid() const
Get the client provider Uid for this channel.
Definition: PVRChannel.h:438
bool SetLocked(bool bIsLocked)
Set to true to lock this channel. Set to false to unlock it.
Definition: PVRChannel.cpp:292
std::pair< int, int > StorageId() const
Definition: PVRChannel.h:284
Definition: PVRDatabase.h:33
void Lock()
Lock the instance. No other thread gets access to this channel until Unlock was called.
Definition: PVRChannel.h:449
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:822
void SetRadioRDSInfoTag(const std::shared_ptr< CPVRRadioRDSInfoTag > &tag)
Set the Radio RDS data for the channel.
Definition: PVRChannel.cpp:317
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:720
time_t LastWatched() const
Definition: PVRChannel.cpp:732
bool EPGEnabled() const
Definition: PVRChannel.cpp:803
bool SetLastWatched(time_t iLastWatched)
Last time channel has been watched.
Definition: PVRChannel.cpp:399
int EpgID() const
Definition: PVRChannel.cpp:797
int UniqueID() const
A unique identifier for this channel.
Definition: PVRChannel.cpp:750
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:809
bool HasClientProvider() const
Whether or not this channel has a provider set by the client.
Definition: PVRChannel.cpp:828
bool SetArchive(bool bHasArchive)
Set the archive support flag for this channel.
Definition: PVRChannel.cpp:329
bool SetClientID(int iClientId)
Set the identifier of the client that serves this channel.
Definition: PVRChannel.cpp:415
bool SetEPGEnabled(bool bEPGEnabled)
Set to true if an EPG should be used for this channel. Set to false otherwise.
Definition: PVRChannel.cpp:612