|
a/src/ohreceiver.cxx |
|
b/src/ohreceiver.cxx |
|
... |
|
... |
26 |
#include <string> // for string, allocator, etc
|
26 |
#include <string> // for string, allocator, etc
|
27 |
#include <utility> // for pair
|
27 |
#include <utility> // for pair
|
28 |
#include <vector> // for vector
|
28 |
#include <vector> // for vector
|
29 |
|
29 |
|
30 |
#include "libupnpp/log.hxx" // for LOGDEB, LOGERR
|
30 |
#include "libupnpp/log.hxx" // for LOGDEB, LOGERR
|
31 |
#include "libupnpp/soaphelp.hxx" // for SoapArgs, SoapData, i2s, etc
|
31 |
#include "libupnpp/soaphelp.hxx" // for SoapIncoming, SoapOutgoing, i2s, etc
|
32 |
|
32 |
|
33 |
#include "mpdcli.hxx" // for MpdStatus, UpSong, MPDCli, etc
|
33 |
#include "mpdcli.hxx" // for MpdStatus, UpSong, MPDCli, etc
|
34 |
#include "upmpd.hxx" // for UpMpd, etc
|
34 |
#include "upmpd.hxx" // for UpMpd, etc
|
35 |
#include "upmpdutils.hxx" // for didlmake, diffmaps, etc
|
35 |
#include "upmpdutils.hxx" // for didlmake, diffmaps, etc
|
36 |
#include "ohplaylist.hxx"
|
36 |
#include "ohplaylist.hxx"
|
|
... |
|
... |
114 |
{
|
114 |
{
|
115 |
if (ok && m_dev)
|
115 |
if (ok && m_dev)
|
116 |
m_dev->loopWakeup();
|
116 |
m_dev->loopWakeup();
|
117 |
}
|
117 |
}
|
118 |
|
118 |
|
119 |
int OHReceiver::play(const SoapArgs& sc, SoapData& data)
|
119 |
int OHReceiver::play(const SoapIncoming& sc, SoapOutgoing& data)
|
120 |
{
|
120 |
{
|
121 |
LOGDEB("OHReceiver::play" << endl);
|
121 |
LOGDEB("OHReceiver::play" << endl);
|
122 |
bool ok = false;
|
122 |
bool ok = false;
|
123 |
|
123 |
|
124 |
if (!m_pl) {
|
124 |
if (!m_pl) {
|
|
... |
|
... |
220 |
}
|
220 |
}
|
221 |
}
|
221 |
}
|
222 |
return true;
|
222 |
return true;
|
223 |
}
|
223 |
}
|
224 |
|
224 |
|
225 |
int OHReceiver::stop(const SoapArgs& sc, SoapData& data)
|
225 |
int OHReceiver::stop(const SoapIncoming& sc, SoapOutgoing& data)
|
226 |
{
|
226 |
{
|
227 |
LOGDEB("OHReceiver::stop" << endl);
|
227 |
LOGDEB("OHReceiver::stop" << endl);
|
228 |
bool ok = iStop();
|
228 |
bool ok = iStop();
|
229 |
maybeWakeUp(ok);
|
229 |
maybeWakeUp(ok);
|
230 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
230 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
231 |
}
|
231 |
}
|
232 |
|
232 |
|
233 |
int OHReceiver::setSender(const SoapArgs& sc, SoapData& data)
|
233 |
int OHReceiver::setSender(const SoapIncoming& sc, SoapOutgoing& data)
|
234 |
{
|
234 |
{
|
235 |
LOGDEB("OHReceiver::setSender" << endl);
|
235 |
LOGDEB("OHReceiver::setSender" << endl);
|
236 |
string uri, metadata;
|
236 |
string uri, metadata;
|
237 |
bool ok = sc.getString("Uri", &uri) &&
|
237 |
bool ok = sc.getString("Uri", &uri) &&
|
238 |
sc.getString("Metadata", &metadata);
|
238 |
sc.getString("Metadata", &metadata);
|
|
... |
|
... |
246 |
|
246 |
|
247 |
maybeWakeUp(ok);
|
247 |
maybeWakeUp(ok);
|
248 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
248 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
249 |
}
|
249 |
}
|
250 |
|
250 |
|
251 |
int OHReceiver::sender(const SoapArgs& sc, SoapData& data)
|
251 |
int OHReceiver::sender(const SoapIncoming& sc, SoapOutgoing& data)
|
252 |
{
|
252 |
{
|
253 |
LOGDEB("OHReceiver::sender" << endl);
|
253 |
LOGDEB("OHReceiver::sender" << endl);
|
254 |
data.addarg("Uri", m_uri);
|
254 |
data.addarg("Uri", m_uri);
|
255 |
data.addarg("Metadata", m_metadata);
|
255 |
data.addarg("Metadata", m_metadata);
|
256 |
return UPNP_E_SUCCESS;
|
256 |
return UPNP_E_SUCCESS;
|
257 |
}
|
257 |
}
|
258 |
|
258 |
|
259 |
int OHReceiver::transportState(const SoapArgs& sc, SoapData& data)
|
259 |
int OHReceiver::transportState(const SoapIncoming& sc, SoapOutgoing& data)
|
260 |
{
|
260 |
{
|
261 |
//LOGDEB("OHReceiver::transportState" << endl);
|
261 |
//LOGDEB("OHReceiver::transportState" << endl);
|
262 |
|
262 |
|
263 |
// Allowed states: Stopped, Playing,Waiting, Buffering
|
263 |
// Allowed states: Stopped, Playing,Waiting, Buffering
|
264 |
// We won't receive a Stop action if we are not Playing. So we
|
264 |
// We won't receive a Stop action if we are not Playing. So we
|
|
... |
|
... |
267 |
data.addarg("Value", tstate);
|
267 |
data.addarg("Value", tstate);
|
268 |
LOGDEB("OHReceiver::transportState: " << tstate << endl);
|
268 |
LOGDEB("OHReceiver::transportState: " << tstate << endl);
|
269 |
return UPNP_E_SUCCESS;
|
269 |
return UPNP_E_SUCCESS;
|
270 |
}
|
270 |
}
|
271 |
|
271 |
|
272 |
int OHReceiver::protocolInfo(const SoapArgs& sc, SoapData& data)
|
272 |
int OHReceiver::protocolInfo(const SoapIncoming& sc, SoapOutgoing& data)
|
273 |
{
|
273 |
{
|
274 |
LOGDEB("OHReceiver::protocolInfo" << endl);
|
274 |
LOGDEB("OHReceiver::protocolInfo" << endl);
|
275 |
data.addarg("Value", o_protocolinfo);
|
275 |
data.addarg("Value", o_protocolinfo);
|
276 |
return UPNP_E_SUCCESS;
|
276 |
return UPNP_E_SUCCESS;
|
277 |
}
|
277 |
}
|