libupnpp  0.16.0
A C++ wrapper for the Portable UPnP reference library
mediarenderer.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 _MEDIARENDERER_HXX_INCLUDED_
19 #define _MEDIARENDERER_HXX_INCLUDED_
20 #include <libupnpp/config.h>
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include "libupnpp/control/avtransport.hxx"
27 #include "libupnpp/control/device.hxx"
28 #include "libupnpp/control/ohplaylist.hxx"
29 #include "libupnpp/control/ohproduct.hxx"
30 #include "libupnpp/control/ohtime.hxx"
31 #include "libupnpp/control/ohvolume.hxx"
32 #include "libupnpp/control/renderingcontrol.hxx"
33 #include "libupnpp/control/ohreceiver.hxx"
34 #include "libupnpp/control/ohsender.hxx"
35 #include "libupnpp/control/ohradio.hxx"
36 #include "libupnpp/control/ohinfo.hxx"
37 
38 namespace UPnPClient {
39 
40 class MediaRenderer;
41 class UPnPDeviceDesc;
42 
43 typedef std::shared_ptr<MediaRenderer> MRDH;
44 
50 class MediaRenderer : public Device {
51 public:
53  MediaRenderer(const UPnPDeviceDesc& desc);
54 
55  ~MediaRenderer();
56 
59  RDCH rdc(); // Rendering control
60  AVTH avt(); // AVTransport
61  OHPRH ohpr(); // OpenHome Product
62  OHPLH ohpl(); // OpenHome Playlist
63  OHTMH ohtm(); // OpenHome Time
64  OHVLH ohvl(); // OpenHome Volume
65  OHRCH ohrc(); // OpenHome Receiver
66  OHRDH ohrd(); // OpenHome Radio
67  OHIFH ohif(); // OpenHome Info
68  OHSNH ohsn(); // OpenHome Sender
69 
70  bool hasOpenHome();
71 
76  static bool getDeviceDescs(std::vector<UPnPDeviceDesc>& devices,
77  const std::string& friendlyName = "");
78  static bool isMRDevice(const std::string& devicetype);
79 
80 protected:
81  static const std::string DType;
82 private:
83  class Internal;
84  Internal *m;
85 };
86 
87 }
88 
89 #endif /* _MEDIARENDERER_HXX_INCLUDED_ */
MediaRenderer(const UPnPDeviceDesc &desc)
Build from device description.
Definition: mediarenderer.cxx:98
Definition: mediarenderer.cxx:41
For now, the Device class is just a holder for the description object.
Definition: device.hxx:42
RDCH rdc()
Methods returning handles to the different services.
Definition: mediarenderer.cxx:117
static bool getDeviceDescs(std::vector< UPnPDeviceDesc > &devices, const std::string &friendlyName="")
Retrieve device descriptions for devices looking like media renderers.
Definition: mediarenderer.cxx:84
The MediaRenderer class mostly holds a bunch of convenience functions to create the different service...
Definition: mediarenderer.hxx:50
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:28