libupnpp 0.16.0
A C++ wrapper for the Portable UPnP reference library
ohradio.hxx
1/* Copyright (C) 2006-2016 J.F.Dockes
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, write to the Free Software
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 * 02110-1301 USA
17 */
18#ifndef _OHRADIO_HXX_INCLUDED_
19#define _OHRADIO_HXX_INCLUDED_
20
21#include <string>
22#include <vector>
23
24#include "libupnpp/control/service.hxx"
25#include "libupnpp/control/cdircontent.hxx"
26#include "ohplaylist.hxx"
27
28namespace UPnPClient {
29
30class OHRadio;
31class UPnPDeviceDesc;
32class UPnPServiceDesc;
33
34typedef std::shared_ptr<OHRadio> OHRDH;
35
40class UPNPP_API OHRadio : public Service {
41public:
42 using Service::Service;
43
45 static bool isOHRdService(const std::string& st);
46 bool serviceTypeMatch(const std::string& tp) override;
47
48 int channel(std::string* uri, UPnPDirObject *dirent);
49 int channelsMax(int *);
50 int id(int *value, int timeoutms = -1);
51 int idArray(std::vector<int> *ids, int *tokp);
52 int idArrayChanged(int token, bool *changed);
53 int pause();
54 int play();
55 int protocolInfo(std::string *proto);
56 int read(int id, UPnPDirObject *dirent);
57 int readList(const std::vector<int>& ids, std::vector<OHPlaylist::TrackListEntry>* entsp);
58 int setChannel(const std::string& uri, const std::string& didl);
59 int setId(int id, const std::string& uri);
60 int stop();
61 int transportState(OHPlaylist::TPState *tps);
62
63 // This is for the benefit of ohinfo, no outside use
64 static int decodeMetadata(const std::string& fromwho,
65 const std::string &rawdidl, UPnPDirObject *de);
66
67protected:
68 /* My service type string */
69 static const std::string SType;
70
71private:
72 void UPNPP_LOCAL evtCallback(
73 const std::unordered_map<std::string, std::string>&);
74 void UPNPP_LOCAL registerCallback() override;
75};
76
77} // namespace UPnPClient
78
79#endif /* _OHRADIO_HXX_INCLUDED_ */
OHRadio Service client class.
Definition ohradio.hxx:40
Definition service.hxx:88
UPnP Media Server directory entry, converted from XML data.
Definition cdircontent.hxx:60
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition avlastchg.cxx:28