libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
ohreceiver.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 _OHRECEIVER_HXX_INCLUDED_
19 #define _OHRECEIVER_HXX_INCLUDED_
20 
21 #include <unordered_map>
22 #include <string>
23 #include <vector>
24 
25 #include "libupnpp/control/service.hxx"
26 #include "libupnpp/control/ohplaylist.hxx"
27 
28 
29 namespace UPnPClient {
30 
31 class UPnPDeviceDesc;
32 class UPnPServiceDesc;
33 class OHReceiver;
34 
35 typedef std::shared_ptr<OHReceiver> OHRCH;
36 
40 class UPNPP_API OHReceiver : public Service {
41 public:
42 
43  OHReceiver(const UPnPDeviceDesc& device, const UPnPServiceDesc& service)
44  : Service(device, service) {
45  }
46  OHReceiver() {}
47  virtual ~OHReceiver() {}
48 
50  static bool isOHRcService(const std::string& st);
51  virtual bool serviceTypeMatch(const std::string& tp);
52 
53  int play();
54  int stop();
55  int setSender(const std::string& uri, const std::string& meta);
56  int sender(std::string& uri, std::string& meta);
57  int protocolInfo(std::string *proto);
58  int transportState(OHPlaylist::TPState *tps);
59 
60 protected:
61  /* My service type string */
62  static const std::string SType;
63 
64 private:
65  void UPNPP_LOCAL evtCallback(
66  const std::unordered_map<std::string, std::string>&);
67  void UPNPP_LOCAL registerCallback();
68 };
69 
70 } // namespace UPnPClient
71 
72 #endif /* _OHRECEIVER_HXX_INCLUDED_ */
Definition: service.hxx:82
OHReceiver client class.
Definition: ohreceiver.hxx:40
Data holder for a UPnP service, parsed from the device XML description.
Definition: description.hxx:46
Data holder for a UPnP device, parsed from the XML description obtained during discovery.
Definition: description.hxx:142
UPnP Description phase: interpreting the device description which we downloaded from the URL obtained...
Definition: avlastchg.cxx:27