Merge pull request #25959 from neo1973/TagLib_deprecation_warnings
[xbmc.git] / lib / libUPnP / Platinum / Source / Core / PltCtrlPointTask.cpp
blob7d2e5babc93b04569a860e06ffbcba8f37d7b323
1 /*****************************************************************
3 | Platinum - Control Point Tasks
5 | Copyright (c) 2004-2010, Plutinosoft, LLC.
6 | All rights reserved.
7 | http://www.plutinosoft.com
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.
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
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.
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
33 ****************************************************************/
35 /*----------------------------------------------------------------------
36 | includes
37 +---------------------------------------------------------------------*/
38 #include "PltDeviceHost.h"
39 #include "PltCtrlPointTask.h"
40 #include "PltCtrlPoint.h"
41 #include "PltDatagramStream.h"
43 /*----------------------------------------------------------------------
44 | PLT_CtrlPointGetDescriptionTask::PLT_CtrlPointGetDescriptionTask
45 +---------------------------------------------------------------------*/
46 PLT_CtrlPointGetDescriptionTask::PLT_CtrlPointGetDescriptionTask(const NPT_HttpUrl& url,
47 PLT_CtrlPoint* ctrl_point,
48 NPT_TimeInterval leasetime,
49 NPT_String uuid) :
50 PLT_HttpClientSocketTask(new NPT_HttpRequest(url, "GET", NPT_HTTP_PROTOCOL_1_1)),
51 m_CtrlPoint(ctrl_point),
52 m_LeaseTime(leasetime),
53 m_UUID(uuid)
57 /*----------------------------------------------------------------------
58 | PLT_CtrlPointGetDescriptionTask::~PLT_CtrlPointGetDescriptionTask
59 +---------------------------------------------------------------------*/
60 PLT_CtrlPointGetDescriptionTask::~PLT_CtrlPointGetDescriptionTask()
64 /*----------------------------------------------------------------------
65 | PLT_CtrlPointGetDescriptionTask::ProcessResponse
66 +---------------------------------------------------------------------*/
67 NPT_Result
68 PLT_CtrlPointGetDescriptionTask::ProcessResponse(NPT_Result res,
69 const NPT_HttpRequest& request,
70 const NPT_HttpRequestContext& context,
71 NPT_HttpResponse* response)
73 NPT_COMPILER_UNUSED(request);
74 return m_CtrlPoint->ProcessGetDescriptionResponse(
75 res,
76 request,
77 context,
78 response,
79 m_LeaseTime,
80 m_UUID);
83 /*----------------------------------------------------------------------
84 | PLT_CtrlPointGetSCPDsTask::PLT_CtrlPointGetSCPDsTask
85 +---------------------------------------------------------------------*/
86 PLT_CtrlPointGetSCPDsTask::PLT_CtrlPointGetSCPDsTask(PLT_CtrlPoint* ctrl_point,
87 PLT_DeviceDataReference& root_device) :
88 PLT_HttpClientSocketTask(),
89 m_CtrlPoint(ctrl_point),
90 m_RootDevice(root_device)
94 /*----------------------------------------------------------------------
95 | PLT_CtrlPointGetSCPDsTask::ProcessResponse
96 +---------------------------------------------------------------------*/
97 NPT_Result
98 PLT_CtrlPointGetSCPDsTask::ProcessResponse(NPT_Result res,
99 const NPT_HttpRequest& request,
100 const NPT_HttpRequestContext& context,
101 NPT_HttpResponse* response)
103 NPT_COMPILER_UNUSED(context);
104 return m_CtrlPoint->ProcessGetSCPDResponse(
105 res,
106 request,
107 context,
108 response,
109 ((PLT_CtrlPointGetSCPDRequest&)request).m_Device);
112 /*----------------------------------------------------------------------
113 | PLT_CtrlPointInvokeActionTask::PLT_CtrlPointInvokeActionTask
114 +---------------------------------------------------------------------*/
115 PLT_CtrlPointInvokeActionTask::PLT_CtrlPointInvokeActionTask(NPT_HttpRequest* request,
116 PLT_CtrlPoint* ctrl_point,
117 PLT_ActionReference& action,
118 void* userdata) :
119 PLT_HttpClientSocketTask(request),
120 m_CtrlPoint(ctrl_point),
121 m_Action(action),
122 m_Userdata(userdata)
126 /*----------------------------------------------------------------------
127 | PLT_CtrlPointInvokeActionTask::~PLT_CtrlPointInvokeActionTask
128 +---------------------------------------------------------------------*/
129 PLT_CtrlPointInvokeActionTask::~PLT_CtrlPointInvokeActionTask()
133 /*----------------------------------------------------------------------
134 | PLT_CtrlPointInvokeActionTask::ProcessResponse
135 +---------------------------------------------------------------------*/
136 NPT_Result
137 PLT_CtrlPointInvokeActionTask::ProcessResponse(NPT_Result res,
138 const NPT_HttpRequest& request,
139 const NPT_HttpRequestContext& context,
140 NPT_HttpResponse* response)
142 NPT_COMPILER_UNUSED(request);
143 NPT_COMPILER_UNUSED(context);
145 return m_CtrlPoint->ProcessActionResponse(res, request, context, response, m_Action, m_Userdata);
148 /*----------------------------------------------------------------------
149 | PLT_CtrlPointHouseKeepingTask::PLT_CtrlPointHouseKeepingTask
150 +---------------------------------------------------------------------*/
151 PLT_CtrlPointHouseKeepingTask::PLT_CtrlPointHouseKeepingTask(PLT_CtrlPoint* ctrl_point,
152 NPT_TimeInterval timer) :
153 m_CtrlPoint(ctrl_point),
154 m_Timer(timer)
158 /*----------------------------------------------------------------------
159 | PLT_CtrlPointHouseKeepingTask::DoRun
160 +---------------------------------------------------------------------*/
161 void
162 PLT_CtrlPointHouseKeepingTask::DoRun()
164 while (!IsAborting((NPT_Timeout)m_Timer.ToSeconds()*1000)) {
165 if (m_CtrlPoint) {
166 m_CtrlPoint->DoHouseKeeping();
171 /*----------------------------------------------------------------------
172 | PLT_CtrlPointSubscribeEventTask::PLT_CtrlPointSubscribeEventTask
173 +---------------------------------------------------------------------*/
174 PLT_CtrlPointSubscribeEventTask::PLT_CtrlPointSubscribeEventTask(NPT_HttpRequest* request,
175 PLT_CtrlPoint* ctrl_point,
176 PLT_DeviceDataReference &device,
177 PLT_Service* service,
178 void* userdata) :
179 PLT_HttpClientSocketTask(request),
180 m_CtrlPoint(ctrl_point),
181 m_Service(service),
182 m_Device(device),
183 m_Userdata(userdata)
187 /*----------------------------------------------------------------------
188 | PLT_CtrlPointSubscribeEventTask::~PLT_CtrlPointSubscribeEventTask
189 +---------------------------------------------------------------------*/
190 PLT_CtrlPointSubscribeEventTask::~PLT_CtrlPointSubscribeEventTask()
194 /*----------------------------------------------------------------------
195 | PLT_CtrlPointSubscribeEventTask::ProcessResponse
196 +---------------------------------------------------------------------*/
197 NPT_Result
198 PLT_CtrlPointSubscribeEventTask::ProcessResponse(NPT_Result res,
199 const NPT_HttpRequest& request,
200 const NPT_HttpRequestContext& context,
201 NPT_HttpResponse* response)
203 NPT_COMPILER_UNUSED(request);
204 NPT_COMPILER_UNUSED(context);
206 return m_CtrlPoint->ProcessSubscribeResponse(
207 res,
208 request,
209 context,
210 response,
211 m_Service,
212 m_Userdata);