Add support for groups

Parse the groups out of the json data. As of now all radio channels are stored
in groups prefixed with "Radio" which is used to set the radio flag now.

Signed-off-by: Julian Scheel <julian@jusst.de>
This commit is contained in:
Julian Scheel
2016-02-02 12:18:41 +01:00
parent f724c5934c
commit a23e465b63
3 changed files with 97 additions and 4 deletions

View File

@@ -36,6 +36,13 @@ struct OctonetChannel
int id;
};
struct OctonetGroup
{
std::string name;
bool radio;
std::vector<int> members;
};
class OctonetData : public PLATFORM::CThread
{
public:
@@ -45,12 +52,18 @@ class OctonetData : public PLATFORM::CThread
virtual int getChannelCount(void);
virtual PVR_ERROR getChannels(ADDON_HANDLE handle, bool bRadio);
virtual int getGroupCount(void);
virtual PVR_ERROR getGroups(ADDON_HANDLE handle, bool bRadio);
virtual PVR_ERROR getGroupMembers(ADDON_HANDLE handle, const PVR_CHANNEL_GROUP &group);
protected:
virtual bool loadChannelList(void);
virtual OctonetGroup* findGroup(const std::string &name);
virtual void *Process(void);
private:
std::string serverAddress;
std::vector<OctonetChannel> channels;
std::vector<OctonetGroup> groups;
};