|
a/src/ohplaylist.cxx |
|
b/src/ohplaylist.cxx |
|
... |
|
... |
41 |
using namespace std::placeholders;
|
41 |
using namespace std::placeholders;
|
42 |
|
42 |
|
43 |
static const string sTpProduct("urn:av-openhome-org:service:Playlist:1");
|
43 |
static const string sTpProduct("urn:av-openhome-org:service:Playlist:1");
|
44 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Playlist");
|
44 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Playlist");
|
45 |
|
45 |
|
46 |
OHPlaylist::OHPlaylist(UpMpd *dev, UpMpdRenderCtl *ctl, unsigned int cssleep)
|
46 |
OHPlaylist::OHPlaylist(UpMpd *dev, unsigned int cssleep)
|
47 |
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
|
47 |
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
|
48 |
m_cachedirty(false), m_mpdqvers(-1)
|
48 |
m_cachedirty(false), m_mpdqvers(-1)
|
49 |
{
|
49 |
{
|
50 |
dev->addActionMapping(this, "Play",
|
50 |
dev->addActionMapping(this, "Play",
|
51 |
bind(&OHPlaylist::play, this, _1, _2));
|
51 |
bind(&OHPlaylist::play, this, _1, _2));
|
|
... |
|
... |
293 |
bool ok = m_dev->m_mpdcli->pause(true);
|
293 |
bool ok = m_dev->m_mpdcli->pause(true);
|
294 |
maybeWakeUp(ok);
|
294 |
maybeWakeUp(ok);
|
295 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
295 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
296 |
}
|
296 |
}
|
297 |
|
297 |
|
298 |
int OHPlaylist::stop(const SoapIncoming& sc, SoapOutgoing& data)
|
298 |
int OHPlaylist::iStop()
|
299 |
{
|
299 |
{
|
300 |
LOGDEB("OHPlaylist::stop" << endl);
|
|
|
301 |
bool ok = m_dev->m_mpdcli->stop();
|
300 |
bool ok = m_dev->m_mpdcli->stop();
|
302 |
maybeWakeUp(ok);
|
301 |
maybeWakeUp(ok);
|
303 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
302 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
|
|
303 |
}
|
|
|
304 |
int OHPlaylist::stop(const SoapIncoming& sc, SoapOutgoing& data)
|
|
|
305 |
{
|
|
|
306 |
LOGDEB("OHPlaylist::stop" << endl);
|
|
|
307 |
return iStop();
|
304 |
}
|
308 |
}
|
305 |
|
309 |
|
306 |
int OHPlaylist::next(const SoapIncoming& sc, SoapOutgoing& data)
|
310 |
int OHPlaylist::next(const SoapIncoming& sc, SoapOutgoing& data)
|
307 |
{
|
311 |
{
|
308 |
LOGDEB("OHPlaylist::next" << endl);
|
312 |
LOGDEB("OHPlaylist::next" << endl);
|
|
... |
|
... |
588 |
}
|
592 |
}
|
589 |
maybeWakeUp(ok);
|
593 |
maybeWakeUp(ok);
|
590 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
594 |
return ok ? UPNP_E_SUCCESS : UPNP_E_INTERNAL_ERROR;
|
591 |
}
|
595 |
}
|
592 |
|
596 |
|
|
|
597 |
void OHPlaylist::resetQVers()
|
|
|
598 |
{
|
|
|
599 |
m_mpdqvers = -1;
|
|
|
600 |
}
|
|
|
601 |
|
593 |
bool OHPlaylist::insertUri(int afterid, const string& uri,
|
602 |
bool OHPlaylist::insertUri(int afterid, const string& uri,
|
594 |
const string& metadata, int *newid)
|
603 |
const string& metadata, int *newid)
|
595 |
{
|
604 |
{
|
596 |
LOGDEB1("OHPlaylist::insertUri: " << uri << endl);
|
605 |
LOGDEB1("OHPlaylist::insertUri: " << uri << endl);
|
597 |
UpSong metaformpd;
|
606 |
UpSong metaformpd;
|