11 #include "pvr/channels/PVRChannelGroup.h" 12 #include "pvr/settings/PVRSettings.h" 13 #include "settings/lib/ISettingCallback.h" 14 #include "threads/CriticalSection.h" 41 void OnSettingChanged(
const std::shared_ptr<const CSetting>& setting)
override;
53 bool LoadFromDatabase(
const std::vector<std::shared_ptr<CPVRClient>>& clients);
68 std::unique_lock<CCriticalSection> lock(m_critSection);
69 return m_groups.size();
78 bool Update(
const std::shared_ptr<CPVRChannelGroup>&
group,
bool bUpdateFromClient =
false);
101 const std::shared_ptr<CPVRChannelGroup>& group);
108 std::shared_ptr<CPVRChannelGroup>
GetById(
int iGroupId)
const;
115 std::shared_ptr<CPVRChannelGroup>
GetGroupByPath(
const std::string& strPath)
const;
123 std::shared_ptr<CPVRChannelGroup>
GetByName(
const std::string& strName,
int clientID)
const;
129 std::shared_ptr<CPVRChannelGroup>
GetGroupAll()
const;
157 std::vector<std::shared_ptr<CPVRChannelGroup>>
GetMembers(
bool bExcludeHidden =
false)
const;
178 std::shared_ptr<CPVRChannelGroup>
AddGroup(
const std::string& strName);
185 bool DeleteGroup(
const std::shared_ptr<CPVRChannelGroup>& group);
193 bool HideGroup(
const std::shared_ptr<CPVRChannelGroup>& group,
bool bHide);
213 bool bChannelsOnly =
false);
233 void SortGroupsByBackendOrder();
234 void SortGroupsByLocalOrder();
242 bool HasValidDataForClients(
const std::vector<std::shared_ptr<CPVRClient>>& clients)
const;
244 void OnPVRManagerEvent(
const PVR::PVREvent& event);
246 int GetGroupTypePriority(
const std::shared_ptr<CPVRChannelGroup>& group)
const;
247 int GetGroupClientPriority(
const std::shared_ptr<CPVRChannelGroup>& group)
const;
249 bool m_bRadio{
false};
250 std::vector<std::shared_ptr<CPVRChannelGroup>> m_groups;
251 mutable CCriticalSection m_critSection;
252 std::vector<int> m_failedClientsForChannelGroups;
253 bool m_isSubscribed{
false};
255 std::shared_ptr<CPVRChannelGroup> m_allChannelsGroup;
bool UpdateFromClient(const std::shared_ptr< CPVRChannelGroup > &group)
Called by the add-on callback to add a new group.
Definition: PVRChannelGroups.cpp:85
std::shared_ptr< CPVRChannelGroup > GetFirstGroup() const
Definition: PVRChannelGroups.h:134
bool IsRadio() const
Definition: PVRChannelGroups.h:204
Definition: ContextMenuManager.h:24
std::shared_ptr< CPVRChannelGroup > GetLastOpenedGroup() const
Definition: PVRChannelGroups.cpp:510
Definition: ISettingCallback.h:16
int CleanupCachedImages()
Erase stale texture db entries and image files.
Definition: PVRChannelGroups.cpp:681
std::shared_ptr< CPVRChannelGroup > CreateChannelGroup(int iType, const CPVRChannelsPath &path)
Create a channel group matching the given type.
Definition: PVRChannelGroups.cpp:377
bool LoadFromDatabase(const std::vector< std::shared_ptr< CPVRClient >> &clients)
Load all channel groups and all channels from PVR database.
Definition: PVRChannelGroups.cpp:388
void Unload()
Remove all groups from this container.
Definition: PVRChannelGroups.cpp:71
A container class for channel groups.
Definition: PVRChannelGroups.h:30
Definition: PVRChannelsPath.h:17
bool UpdateChannelNumbersFromAllChannelsGroup()
Update the channel numbers across the channel groups from the all channels group. ...
Definition: PVRChannelGroups.cpp:368
bool UpdateFromClients(const std::vector< std::shared_ptr< CPVRClient >> &clients, bool bChannelsOnly=false)
Update data with groups and channels from the given clients, sync with local data.
Definition: PVRChannelGroups.cpp:317
std::shared_ptr< CPVRChannelGroup > GetById(int iGroupId) const
Get a pointer to a channel group given its ID.
Definition: PVRChannelGroups.cpp:270
std::shared_ptr< CPVRChannelGroup > AddGroup(const std::string &strName)
Add a group to this container.
Definition: PVRChannelGroups.cpp:601
std::shared_ptr< CPVRChannelGroup > GetPreviousGroup(const CPVRChannelGroup &group) const
Get the previous group in this container.
Definition: PVRChannelGroups.cpp:535
std::shared_ptr< CPVRChannelGroup > GetLastGroup() const
Definition: PVRChannelGroups.cpp:469
std::shared_ptr< CPVRChannelGroup > GetGroupAll() const
Get the group that contains all channels.
Definition: PVRChannelGroups.cpp:463
std::vector< std::shared_ptr< CPVRChannelGroupMember > > GetMembersAvailableForGroup(const std::shared_ptr< CPVRChannelGroup > &group)
Get all channel group members that could be added to the given group.
Definition: PVRChannelGroups.cpp:250
Definition: SmartPlayList.cpp:137
std::shared_ptr< CPVRChannelGroup > GetByName(const std::string &strName, int clientID) const
Get a group given its name.
Definition: PVRChannelGroups.cpp:294
size_t Size() const
Definition: PVRChannelGroups.h:66
CPVRChannelGroups(bool bRadio)
Create a new group container.
Definition: PVRChannelGroups.cpp:43
bool Update(const std::shared_ptr< CPVRChannelGroup > &group, bool bUpdateFromClient=false)
Update a group or add it if it's not in here yet.
Definition: PVRChannelGroups.cpp:97
bool DeleteGroup(const std::shared_ptr< CPVRChannelGroup > &group)
Remove a group from this container and delete it from the database.
Definition: PVRChannelGroups.cpp:632
std::shared_ptr< CPVRChannelGroup > GetNextGroup(const CPVRChannelGroup &group) const
Get the next group in this container.
Definition: PVRChannelGroups.cpp:569
bool PersistAll()
Persist all changes in channel groups.
Definition: PVRChannelGroups.cpp:453
void SortGroups()
Sort the groups.
Definition: PVRChannelGroups.cpp:222
std::shared_ptr< CPVRChannelGroup > GetGroupByPath(const std::string &strPath) const
Get a channel group given its path.
Definition: PVRChannelGroups.cpp:279
std::shared_ptr< CPVRChannelGroupMember > GetChannelGroupMemberByPath(const CPVRChannelsPath &path) const
Get a channel group member given its path.
Definition: PVRChannelGroups.cpp:235
GroupMemberPair GetLastAndPreviousToLastPlayedChannelGroupMember() const
Definition: PVRChannelGroups.cpp:478
Definition: PVRChannelGroup.h:52
std::vector< std::shared_ptr< CPVRChannelGroup > > GetMembers(bool bExcludeHidden=false) const
Get the list of groups.
Definition: PVRChannelGroups.cpp:523
Definition: PVRSettings.h:27
bool HideGroup(const std::shared_ptr< CPVRChannelGroup > &group, bool bHide)
Hide/unhide a group in this container.
Definition: PVRChannelGroups.cpp:665
void OnSettingChanged(const std::shared_ptr< const CSetting > &setting) override
The value of the given setting has changed.
Definition: PVRChannelGroups.cpp:55