--- a/src/ohproduct.cxx
+++ b/src/ohproduct.cxx
@@ -47,6 +47,7 @@
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
m_roomOrName(friendlyname), m_sourceIndex(0)
{
+ // Playlist must stay first.
o_sources.push_back("Playlist");
//o_sources.push_back("UpnpAv");
if (hasRcv)
@@ -199,21 +200,25 @@
return UPNP_E_SUCCESS;
}
-int OHProduct::setSourceIndex(const SoapIncoming& sc, SoapOutgoing& data)
+int OHProduct::iSetSourceIndex(int sindex)
+{
+ LOGDEB("OHProduct::setSourceIndex: " << sindex << endl);
+ if (sindex < 0 || sindex >= int(o_sources.size())) {
+ LOGERR("OHProduct::setSourceIndex: bad index: " << sindex << endl);
+ return UPNP_E_INVALID_PARAM;
+ }
+ m_sourceIndex = sindex;
+ m_dev->loopWakeup();
+ return UPNP_E_SUCCESS;
+}
+int OHProduct::setSourceIndex(const SoapIncoming& sc, SoapOutgoing&)
{
LOGDEB("OHProduct::setSourceIndex" << endl);
int sindex;
if (!sc.get("Value", &sindex)) {
return UPNP_E_INVALID_PARAM;
}
- LOGDEB("OHProduct::setSourceIndex: " << sindex << endl);
- if (sindex < 0 || sindex >= int(o_sources.size())) {
- LOGERR("OHProduct::setSourceIndex: bad index: " << sindex << endl);
- return UPNP_E_INVALID_PARAM;
- }
- m_sourceIndex = sindex;
- m_dev->loopWakeup();
- return UPNP_E_SUCCESS;
+ return iSetSourceIndex(sindex);
}
int OHProduct::setSourceIndexByName(const SoapIncoming& sc, SoapOutgoing& data)