Platinum UPnP SDK  1.0.5.13
PltMediaRenderer.h
1 /*****************************************************************
2 |
3 | Platinum - AV Media Renderer Device
4 |
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.com
8 |
9 | This program is free software; you can redistribute it and/or
10 | modify it under the terms of the GNU General Public License
11 | as published by the Free Software Foundation; either version 2
12 | of the License, or (at your option) any later version.
13 |
14 | OEMs, ISVs, VARs and other distributors that combine and
15 | distribute commercially licensed software with Platinum software
16 | and do not wish to distribute the source code for the commercially
17 | licensed software under version 2, or (at your option) any later
18 | version, of the GNU General Public License (the "GPL") must enter
19 | into a commercial license agreement with Plutinosoft, LLC.
20 | licensing@plutinosoft.com
21 |
22 | This program is distributed in the hope that it will be useful,
23 | but WITHOUT ANY WARRANTY; without even the implied warranty of
24 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 | GNU General Public License for more details.
26 |
27 | You should have received a copy of the GNU General Public License
28 | along with this program; see the file LICENSE.txt. If not, write to
29 | the Free Software Foundation, Inc.,
30 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 | http://www.gnu.org/licenses/gpl-2.0.html
32 |
33 ****************************************************************/
34 
35 #ifndef _PLT_MEDIA_RENDERER_H_
36 #define _PLT_MEDIA_RENDERER_H_
37 
38 /*----------------------------------------------------------------------
39 | includes
40 +---------------------------------------------------------------------*/
41 #include "PltDeviceHost.h"
42 
43 /*----------------------------------------------------------------------
44 | PLT_MediaRendererDelegate
45 +---------------------------------------------------------------------*/
46 class PLT_MediaRendererDelegate
47 {
48 public:
49  virtual ~PLT_MediaRendererDelegate() {}
50 
51  // ConnectionManager
52  virtual NPT_Result OnGetCurrentConnectionInfo(PLT_ActionReference& action) = 0;
53 
54  // AVTransport
55  virtual NPT_Result OnNext(PLT_ActionReference& action) = 0;
56  virtual NPT_Result OnPause(PLT_ActionReference& action) = 0;
57  virtual NPT_Result OnPlay(PLT_ActionReference& action) = 0;
58  virtual NPT_Result OnPrevious(PLT_ActionReference& action) = 0;
59  virtual NPT_Result OnSeek(PLT_ActionReference& action) = 0;
60  virtual NPT_Result OnStop(PLT_ActionReference& action) = 0;
61  virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action) = 0;
62  virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action) = 0;
63 
64  // RenderingControl
65  virtual NPT_Result OnSetVolume(PLT_ActionReference& action) = 0;
66  virtual NPT_Result OnSetVolumeDB(PLT_ActionReference& action) = 0;
67  virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference& action) = 0;
68  virtual NPT_Result OnSetMute(PLT_ActionReference& action) = 0;
69 };
70 
71 /*----------------------------------------------------------------------
72 | PLT_MediaRenderer
73 +---------------------------------------------------------------------*/
74 class PLT_MediaRenderer : public PLT_DeviceHost
75 {
76 public:
77  PLT_MediaRenderer(const char* friendly_name,
78  bool show_ip = false,
79  const char* uuid = NULL,
80  unsigned int port = 0,
81  bool port_rebind = false);
82  // methods
83  virtual void SetDelegate(PLT_MediaRendererDelegate* delegate) { m_Delegate = delegate; }
84 
85  // PLT_DeviceHost methods
86  virtual NPT_Result SetupServices();
87  virtual NPT_Result OnAction(PLT_ActionReference& action,
88  const PLT_HttpRequestContext& context);
89 
90 protected:
91  virtual ~PLT_MediaRenderer();
92 
93  // PLT_MediaRendererInterface methods
94  // ConnectionManager
95  virtual NPT_Result OnGetCurrentConnectionInfo(PLT_ActionReference& action);
96 
97  // AVTransport
98  virtual NPT_Result OnNext(PLT_ActionReference& action);
99  virtual NPT_Result OnPause(PLT_ActionReference& action);
100  virtual NPT_Result OnPlay(PLT_ActionReference& action);
101  virtual NPT_Result OnPrevious(PLT_ActionReference& action);
102  virtual NPT_Result OnSeek(PLT_ActionReference& action);
103  virtual NPT_Result OnStop(PLT_ActionReference& action);
104  virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action);
105  virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action);
106 
107  // RenderingControl
108  virtual NPT_Result OnSetVolume(PLT_ActionReference& action);
109  virtual NPT_Result OnSetVolumeDB(PLT_ActionReference &action);
110  virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference &action);
111  virtual NPT_Result OnSetMute(PLT_ActionReference& action);
112 
113 private:
114  PLT_MediaRendererDelegate* m_Delegate;
115 };
116 
117 #endif /* _PLT_MEDIA_RENDERER_H_ */
virtual NPT_Result SetupServices()=0
Required method for setting up UPnP services of device host (and any embedded).
virtual NPT_Result OnAction(PLT_ActionReference &action, const PLT_HttpRequestContext &context)
This mehod is called when an action performed by a control point has been received and needs to be an...
UPnP Device Host.
Definition: PltDeviceHost.h:69
UPnP Device.
The PLT_HttpRequestContext class holds information about the request sent, the local & remote ip addr...
Definition: PltHttp.h:115