|
a/src/ohproduct.cxx |
|
b/src/ohproduct.cxx |
|
... |
|
... |
247 |
}
|
247 |
}
|
248 |
if (m_sourceIndex == sindex) {
|
248 |
if (m_sourceIndex == sindex) {
|
249 |
return UPNP_E_SUCCESS;
|
249 |
return UPNP_E_SUCCESS;
|
250 |
}
|
250 |
}
|
251 |
|
251 |
|
252 |
const MpdStatus& mpds = m_dev->getMpdStatus();
|
|
|
253 |
int savedms = mpds.songelapsedms;
|
|
|
254 |
|
|
|
255 |
m_dev->m_ohif->setMetatext("");
|
252 |
m_dev->m_ohif->setMetatext("");
|
256 |
|
253 |
|
257 |
string curtp = o_sources[m_sourceIndex].first;
|
254 |
string curtp = o_sources[m_sourceIndex].first;
|
258 |
string curnm = o_sources[m_sourceIndex].second;
|
255 |
string curnm = o_sources[m_sourceIndex].second;
|
259 |
if (m_dev->m_ohpl && !curtp.compare("Playlist") &&
|
256 |
if (m_dev->m_ohpl && !curtp.compare("Playlist") &&
|
260 |
!curnm.compare("Playlist")) {
|
257 |
!curnm.compare("Playlist")) {
|
261 |
m_dev->m_ohpl->iStop();
|
|
|
262 |
m_dev->m_ohpl->setActive(false);
|
258 |
m_dev->m_ohpl->setActive(false);
|
263 |
} else if (m_dev->m_ohrcv && !curtp.compare("Receiver") &&
|
259 |
} else if (m_dev->m_ohrcv && !curtp.compare("Receiver") &&
|
264 |
!curnm.compare("Receiver")) {
|
260 |
!curnm.compare("Receiver")) {
|
265 |
m_dev->m_ohrcv->iStop();
|
|
|
266 |
m_dev->m_ohrcv->setActive(false);
|
261 |
m_dev->m_ohrcv->setActive(false);
|
267 |
} else if (m_dev->m_ohrd && !curtp.compare("Radio") &&
|
262 |
} else if (m_dev->m_ohrd && !curtp.compare("Radio") &&
|
268 |
!curnm.compare("Radio")) {
|
263 |
!curnm.compare("Radio")) {
|
269 |
m_dev->m_ohrd->iStop();
|
|
|
270 |
m_dev->m_ohrd->setActive(false);
|
264 |
m_dev->m_ohrd->setActive(false);
|
271 |
} else if (m_dev->m_sndrcv && m_dev->m_ohpl &&
|
265 |
} else if (m_dev->m_sndrcv && m_dev->m_ohpl &&
|
272 |
!curtp.compare("Playlist") &&
|
266 |
!curtp.compare("Playlist") &&
|
273 |
!curnm.compare(SndRcvPLName)) {
|
267 |
!curnm.compare(SndRcvPLName)) {
|
|
|
268 |
m_dev->m_ohpl->setActive(false);
|
274 |
m_dev->m_sndrcv->stop();
|
269 |
m_dev->m_sndrcv->stop();
|
275 |
m_dev->m_ohpl->setActive(false);
|
|
|
276 |
} else if (m_dev->m_sndrcv && m_dev->m_ohrd &&
|
270 |
} else if (m_dev->m_sndrcv && m_dev->m_ohrd &&
|
277 |
!curtp.compare("Radio") &&
|
271 |
!curtp.compare("Radio") &&
|
278 |
!curnm.compare(SndRcvRDName)) {
|
272 |
!curnm.compare(SndRcvRDName)) {
|
279 |
m_dev->m_ohrd->setActive(false);
|
273 |
m_dev->m_ohrd->setActive(false);
|
280 |
m_dev->m_sndrcv->stop();
|
274 |
m_dev->m_sndrcv->stop();
|
|
... |
|
... |
291 |
m_dev->m_ohrcv->setActive(true);
|
285 |
m_dev->m_ohrcv->setActive(true);
|
292 |
} else if (m_dev->m_ohrd && !newnm.compare("Radio")) {
|
286 |
} else if (m_dev->m_ohrd && !newnm.compare("Radio")) {
|
293 |
m_dev->m_ohrd->setActive(true);
|
287 |
m_dev->m_ohrd->setActive(true);
|
294 |
} else if (m_dev->m_ohpl && m_dev->m_sndrcv &&
|
288 |
} else if (m_dev->m_ohpl && m_dev->m_sndrcv &&
|
295 |
!newnm.compare(SndRcvPLName)) {
|
289 |
!newnm.compare(SndRcvPLName)) {
|
|
|
290 |
m_dev->m_sndrcv->start(string(), 0 /*savedms*/);
|
296 |
m_dev->m_ohpl->setActive(true);
|
291 |
m_dev->m_ohpl->setActive(true);
|
297 |
m_dev->m_sndrcv->start(string(), savedms);
|
|
|
298 |
} else if (m_dev->m_ohrd && m_dev->m_sndrcv &&
|
292 |
} else if (m_dev->m_ohrd && m_dev->m_sndrcv &&
|
299 |
!newnm.compare(SndRcvRDName)) {
|
293 |
!newnm.compare(SndRcvRDName)) {
|
|
|
294 |
m_dev->m_sndrcv->start(string());
|
300 |
m_dev->m_ohrd->setActive(true);
|
295 |
m_dev->m_ohrd->setActive(true);
|
301 |
m_dev->m_sndrcv->start(string());
|
|
|
302 |
} else {
|
296 |
} else {
|
303 |
string sname = newtp + "-" + newnm;
|
297 |
string sname = newtp + "-" + newnm;
|
304 |
string spath = path_cat(scripts_dir, sname);
|
298 |
string spath = path_cat(scripts_dir, sname);
|
305 |
m_dev->m_sndrcv->start(spath);
|
299 |
m_dev->m_sndrcv->start(spath);
|
306 |
}
|
300 |
}
|