|
a/src/ohreceiver.cxx |
|
b/src/ohreceiver.cxx |
|
... |
|
... |
42 |
static const string sTpProduct("urn:av-openhome-org:service:Receiver:1");
|
42 |
static const string sTpProduct("urn:av-openhome-org:service:Receiver:1");
|
43 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Receiver");
|
43 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Receiver");
|
44 |
|
44 |
|
45 |
OHReceiver::OHReceiver(UpMpd *dev, const OHReceiverParams& parms)
|
45 |
OHReceiver::OHReceiver(UpMpd *dev, const OHReceiverParams& parms)
|
46 |
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
|
46 |
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
|
47 |
m_httpport(parms.httpport), m_pm(parms.pm)
|
47 |
m_httpport(parms.httpport), m_sc2mpdpath(parms.sc2mpdpath), m_pm(parms.pm)
|
48 |
{
|
48 |
{
|
49 |
dev->addActionMapping(this, "Play",
|
49 |
dev->addActionMapping(this, "Play",
|
50 |
bind(&OHReceiver::play, this, _1, _2));
|
50 |
bind(&OHReceiver::play, this, _1, _2));
|
51 |
dev->addActionMapping(this, "Stop",
|
51 |
dev->addActionMapping(this, "Stop",
|
52 |
bind(&OHReceiver::stop, this, _1, _2));
|
52 |
bind(&OHReceiver::stop, this, _1, _2));
|
|
... |
|
... |
170 |
if (!g_configfilename.empty()) {
|
170 |
if (!g_configfilename.empty()) {
|
171 |
args.push_back("-c");
|
171 |
args.push_back("-c");
|
172 |
args.push_back(g_configfilename);
|
172 |
args.push_back(g_configfilename);
|
173 |
}
|
173 |
}
|
174 |
|
174 |
|
175 |
LOGDEB("OHReceiver::play: executing " << g_sc2mpd_path << endl);
|
175 |
LOGDEB("OHReceiver::play: executing " << m_sc2mpdpath << endl);
|
176 |
ok = m_cmd->startExec(g_sc2mpd_path, args, false, true) >= 0;
|
176 |
ok = m_cmd->startExec(m_sc2mpdpath, args, false, true) >= 0;
|
177 |
if (!ok) {
|
177 |
if (!ok) {
|
178 |
LOGERR("OHReceiver::play: executing " << g_sc2mpd_path << " failed"
|
178 |
LOGERR("OHReceiver::play: executing " << m_sc2mpdpath << " failed"
|
179 |
<< endl);
|
179 |
<< endl);
|
180 |
goto out;
|
180 |
goto out;
|
181 |
} else {
|
181 |
} else {
|
182 |
LOGDEB("OHReceiver::play: sc2mpd pid "<< m_cmd->getChildPid()<< endl);
|
182 |
LOGDEB("OHReceiver::play: sc2mpd pid "<< m_cmd->getChildPid()<< endl);
|
183 |
}
|
183 |
}
|