kodi
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 +---------------------------------------------------------------------*/
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 OnSetNextAVTransportURI(PLT_ActionReference& action) = 0;
63  virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action) = 0;
64 
65  // RenderingControl
66  virtual NPT_Result OnSetVolume(PLT_ActionReference& action) = 0;
67  virtual NPT_Result OnSetVolumeDB(PLT_ActionReference& action) = 0;
68  virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference& action) = 0;
69  virtual NPT_Result OnSetMute(PLT_ActionReference& action) = 0;
70 };
71 
72 /*----------------------------------------------------------------------
73 | PLT_MediaRenderer
74 +---------------------------------------------------------------------*/
76 {
77 public:
78  PLT_MediaRenderer(const char* friendly_name,
79  bool show_ip = false,
80  const char* uuid = NULL,
81  unsigned int port = 0,
82  bool port_rebind = false);
83  // methods
84  virtual void SetDelegate(PLT_MediaRendererDelegate* delegate) { m_Delegate = delegate; }
85 
86  // PLT_DeviceHost methods
87  NPT_Result SetupServices() override;
88  NPT_Result OnAction(PLT_ActionReference& action,
89  const PLT_HttpRequestContext& context) override;
90 
91 protected:
92  ~PLT_MediaRenderer() override;
93 
94  // PLT_MediaRendererInterface methods
95  // ConnectionManager
96  virtual NPT_Result OnGetCurrentConnectionInfo(PLT_ActionReference& action);
97 
98  // AVTransport
99  virtual NPT_Result OnNext(PLT_ActionReference& action);
100  virtual NPT_Result OnPause(PLT_ActionReference& action);
101  virtual NPT_Result OnPlay(PLT_ActionReference& action);
102  virtual NPT_Result OnPrevious(PLT_ActionReference& action);
103  virtual NPT_Result OnSeek(PLT_ActionReference& action);
104  virtual NPT_Result OnStop(PLT_ActionReference& action);
105  virtual NPT_Result OnSetAVTransportURI(PLT_ActionReference& action);
106  virtual NPT_Result OnSetNextAVTransportURI(PLT_ActionReference& action);
107  virtual NPT_Result OnSetPlayMode(PLT_ActionReference& action);
108 
109  // RenderingControl
110  virtual NPT_Result OnSetVolume(PLT_ActionReference& action);
111  virtual NPT_Result OnSetVolumeDB(PLT_ActionReference &action);
112  virtual NPT_Result OnGetVolumeDBRange(PLT_ActionReference &action);
113  virtual NPT_Result OnSetMute(PLT_ActionReference& action);
114 
115 private:
116  PLT_MediaRendererDelegate* m_Delegate;
117 };
118 
119 #endif /* _PLT_MEDIA_RENDERER_H_ */
Definition: PltMediaRenderer.h:46
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:111
Definition: PltMediaRenderer.h:75