Switch to unified view

a/src/ohreceiver.cxx b/src/ohreceiver.cxx
...
...
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"
37
#include "ohproduct.hxx"
37
38
38
using namespace std;
39
using namespace std;
39
using namespace std::placeholders;
40
using namespace std::placeholders;
40
41
41
static const string sTpProduct("urn:av-openhome-org:service:Receiver:1");
42
static const string sTpProduct("urn:av-openhome-org:service:Receiver:1");
42
static const string sIdProduct("urn:av-openhome-org:serviceId:Receiver");
43
static const string sIdProduct("urn:av-openhome-org:serviceId:Receiver");
43
44
44
OHReceiver::OHReceiver(UpMpd *dev, OHPlaylist *pl, int port)
45
OHReceiver::OHReceiver(UpMpd *dev, OHPlaylist *pl, OHProduct *pr, int port)
45
    : UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev), m_pl(pl), 
46
    : UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev), 
46
      m_httpport(port)
47
      m_pl(pl), m_pr(pr), m_httpport(port)
47
{
48
{
48
    dev->addActionMapping(this, "Play", 
49
    dev->addActionMapping(this, "Play", 
49
                          bind(&OHReceiver::play, this, _1, _2));
50
                          bind(&OHReceiver::play, this, _1, _2));
50
    dev->addActionMapping(this, "Stop", 
51
    dev->addActionMapping(this, "Stop", 
51
                          bind(&OHReceiver::stop, this, _1, _2));
52
                          bind(&OHReceiver::stop, this, _1, _2));
...
...
217
    for (auto it = urlmap.begin(); it != urlmap.end(); it++) {
218
    for (auto it = urlmap.begin(); it != urlmap.end(); it++) {
218
        if (it->second == m_httpuri) {
219
        if (it->second == m_httpuri) {
219
            m_dev->m_mpdcli->deleteId(it->first);
220
            m_dev->m_mpdcli->deleteId(it->first);
220
        }
221
        }
221
    }
222
    }
223
    // At least the songcast windows driver never resets the source
224
    // index (it does call stop when it deconnects).
225
    // I guess that there is no reason to reset the source, and
226
    // another CP could just set it to what it wants, but Bubble at
227
    // least won't do a thing with the renderer as long as the source
228
    // is set to receiver.
229
    if (m_pr)
230
        m_pr->iSetSourceIndex(0);
231
222
    return true;
232
    return true;
223
}
233
}
224
234
225
int OHReceiver::stop(const SoapIncoming& sc, SoapOutgoing& data)
235
int OHReceiver::stop(const SoapIncoming& sc, SoapOutgoing& data)
226
{
236
{
...
...
255
    return UPNP_E_SUCCESS;
265
    return UPNP_E_SUCCESS;
256
}
266
}
257
267
258
int OHReceiver::transportState(const SoapIncoming& sc, SoapOutgoing& data)
268
int OHReceiver::transportState(const SoapIncoming& sc, SoapOutgoing& data)
259
{
269
{
260
    //LOGDEB("OHReceiver::transportState" << endl);
270
    LOGDEB("OHReceiver::transportState" << endl);
261
271
262
    // Allowed states: Stopped, Playing,Waiting, Buffering
272
    // Allowed states: Stopped, Playing,Waiting, Buffering
263
    // We won't receive a Stop action if we are not Playing. So we
273
    // We won't receive a Stop action if we are not Playing. So we
264
    // are playing as long as we have a subprocess
274
    // are playing as long as we have a subprocess
265
    string tstate = m_cmd ? "Playing" : "Stopped";
275
    string tstate = m_cmd ? "Playing" : "Stopped";