|
a/src/ohradio.cxx |
|
b/src/ohradio.cxx |
|
... |
|
... |
120 |
string title = it->substr(6);
|
120 |
string title = it->substr(6);
|
121 |
bool ok = g_config->get("url", uri, *it);
|
121 |
bool ok = g_config->get("url", uri, *it);
|
122 |
g_config->get("artUrl", artUri, *it);
|
122 |
g_config->get("artUrl", artUri, *it);
|
123 |
if (ok && !uri.empty()) {
|
123 |
if (ok && !uri.empty()) {
|
124 |
o_radios.push_back(RadioMeta(title, uri, artUri));
|
124 |
o_radios.push_back(RadioMeta(title, uri, artUri));
|
125 |
LOGDEB("OHRadio::readRadios:RADIO: [" <<
|
125 |
LOGDEB("OHRadio::readRadios:RADIO: [" << title << "] uri [" <<
|
126 |
title << "] uri [" << uri << "]\n");
|
126 |
uri << "] artUri [" << artUri << "]\n");
|
127 |
}
|
127 |
}
|
128 |
}
|
128 |
}
|
129 |
}
|
129 |
}
|
130 |
LOGDEB("OHRadio::readRadios: " << o_radios.size() << " radios found\n");
|
130 |
LOGDEB("OHRadio::readRadios: " << o_radios.size() << " radios found\n");
|
131 |
return true;
|
131 |
return true;
|
|
... |
|
... |
280 |
}
|
280 |
}
|
281 |
return UPNP_E_SUCCESS;
|
281 |
return UPNP_E_SUCCESS;
|
282 |
}
|
282 |
}
|
283 |
|
283 |
|
284 |
void OHRadio::setActive(bool onoff) {
|
284 |
void OHRadio::setActive(bool onoff) {
|
|
|
285 |
m_active = onoff;
|
285 |
if (onoff) {
|
286 |
if (onoff) {
|
286 |
m_dev->m_mpdcli->saveState(m_mpdsavedstate, 0);
|
|
|
287 |
m_dev->m_mpdcli->clearQueue();
|
287 |
m_dev->m_mpdcli->clearQueue();
|
|
|
288 |
maybeWakeUp(true);
|
288 |
} else {
|
289 |
} else {
|
289 |
m_dev->m_mpdcli->clearQueue();
|
290 |
m_dev->m_mpdcli->clearQueue();
|
290 |
m_dev->m_mpdcli->restoreState(m_mpdsavedstate);
|
|
|
291 |
m_songid = 0;
|
291 |
m_songid = 0;
|
292 |
}
|
292 |
}
|
293 |
m_active = onoff;
|
|
|
294 |
}
|
293 |
}
|
295 |
|
294 |
|
296 |
int OHRadio::play(const SoapIncoming& sc, SoapOutgoing& data)
|
295 |
int OHRadio::play(const SoapIncoming& sc, SoapOutgoing& data)
|
297 |
{
|
296 |
{
|
298 |
LOGDEB("OHRadio::play" << endl);
|
297 |
LOGDEB("OHRadio::play" << endl);
|
|
... |
|
... |
458 |
continue;
|
457 |
continue;
|
459 |
}
|
458 |
}
|
460 |
string meta = metaForId(id);
|
459 |
string meta = metaForId(id);
|
461 |
out += "<Entry><Id>";
|
460 |
out += "<Entry><Id>";
|
462 |
out += *it;
|
461 |
out += *it;
|
|
|
462 |
out += "</Id><Uri>";
|
|
|
463 |
out += SoapHelp::xmlQuote(o_radios[id].uri);
|
463 |
out += "</Id><Metadata>";
|
464 |
out += "</Uri><Metadata>";
|
464 |
out += SoapHelp::xmlQuote(meta);
|
465 |
out += SoapHelp::xmlQuote(meta);
|
465 |
out += "</Metadata></Entry>";
|
466 |
out += "</Metadata></Entry>";
|
466 |
}
|
467 |
}
|
467 |
out += "</ChannelList>";
|
468 |
out += "</ChannelList>";
|
468 |
LOGDEB("OHRadio::readList: out: [" << out << "]" << endl);
|
469 |
LOGDEB("OHRadio::readList: out: [" << out << "]" << endl);
|