|
a/src/ohproduct.cxx |
|
b/src/ohproduct.cxx |
|
... |
|
... |
45 |
using namespace std;
|
45 |
using namespace std;
|
46 |
using namespace std::placeholders;
|
46 |
using namespace std::placeholders;
|
47 |
|
47 |
|
48 |
static void listScripts(vector<pair<string, string> >& sources);
|
48 |
static void listScripts(vector<pair<string, string> >& sources);
|
49 |
|
49 |
|
50 |
static const string sTpProduct("urn:av-openhome-org:service:Product:2");
|
50 |
static const string sTpProduct("urn:av-openhome-org:service:Product:");
|
51 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Product");
|
51 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Product");
|
52 |
|
52 |
|
53 |
static string csxml("<SourceList>\n");
|
53 |
static string csxml("<SourceList>\n");
|
54 |
static string csattrs("Info Credentials Time Volume");
|
54 |
static string csattrs("Info Time Volume");
|
55 |
|
55 |
|
56 |
// This can be replaced by config data in listScripts()
|
56 |
// This can be replaced by config data in listScripts()
|
57 |
static string scripts_dir("/usr/share/upmpdcli/src_scripts");
|
57 |
static string scripts_dir("/usr/share/upmpdcli/src_scripts");
|
58 |
|
58 |
|
59 |
// (Type, Name) list
|
59 |
// (Type, Name) list
|
60 |
static vector<pair<string, string> > o_sources;
|
60 |
static vector<pair<string, string> > o_sources;
|
61 |
|
61 |
|
62 |
static const string SndRcvPLName("PL-to-Songcast");
|
62 |
static const string SndRcvPLName("PL-to-Songcast");
|
63 |
static const string SndRcvRDName("RD-to-Songcast");
|
63 |
static const string SndRcvRDName("RD-to-Songcast");
|
64 |
|
64 |
|
65 |
OHProduct::OHProduct(UpMpd *dev, ohProductDesc_t& ohProductDesc)
|
65 |
OHProduct::OHProduct(UpMpd *dev, ohProductDesc_t& ohProductDesc, int version)
|
66 |
: OHService(sTpProduct, sIdProduct, dev),
|
66 |
: OHService(sTpProduct + SoapHelp::i2s(version), sIdProduct, dev),
|
67 |
m_ohProductDesc(ohProductDesc), m_sourceIndex(0), m_standby(false)
|
67 |
m_ohProductDesc(ohProductDesc), m_sourceIndex(0), m_standby(false)
|
68 |
{
|
68 |
{
|
69 |
// Playlist must stay first.
|
69 |
// Playlist must stay first.
|
70 |
o_sources.push_back(pair<string,string>("Playlist","Playlist"));
|
70 |
o_sources.push_back(pair<string,string>("Playlist","Playlist"));
|
71 |
if (m_dev->m_ohrd) {
|
71 |
if (m_dev->m_ohrd) {
|
72 |
o_sources.push_back(pair<string, string>("Radio", "Radio"));
|
72 |
o_sources.push_back(pair<string, string>("Radio", "Radio"));
|
73 |
}
|
73 |
}
|
|
|
74 |
// version == 1 is for lumin compat, see upmpd.cxx
|
|
|
75 |
if (version != 1) {
|
|
|
76 |
csattrs.append(" Credentials");
|
|
|
77 |
}
|
74 |
if (m_dev->m_ohrcv) {
|
78 |
if (m_dev->m_ohrcv) {
|
75 |
o_sources.push_back(pair<string,string>("Receiver", "Receiver"));
|
79 |
o_sources.push_back(pair<string,string>("Receiver", "Receiver"));
|
76 |
csattrs.append(" Receiver");
|
80 |
csattrs.append(" Receiver");
|
77 |
if (m_dev->m_sndrcv &&
|
81 |
if (m_dev->m_sndrcv &&
|
78 |
m_dev->m_ohrcv->playMethod() == OHReceiverParams::OHRP_ALSA) {
|
82 |
m_dev->m_ohrcv->playMethod() == OHReceiverParams::OHRP_ALSA) {
|
79 |
if (!(m_dev->m_options & UpMpd::upmpdNoSongcastSource)) {
|
83 |
if (!(m_dev->m_options & UpMpd::upmpdNoSongcastSource)) {
|
80 |
// It might be possible to make things work with the MPD
|
84 |
// It might be possible to make things work with the MPD
|
81 |
// play method but this would be complicated (the mpd we
|
85 |
// play method but this would be complicated (the mpd we
|
|
... |
|
... |
404 |
return UPNP_E_SUCCESS;
|
408 |
return UPNP_E_SUCCESS;
|
405 |
}
|
409 |
}
|
406 |
|
410 |
|
407 |
int OHProduct::attributes(const SoapIncoming& sc, SoapOutgoing& data)
|
411 |
int OHProduct::attributes(const SoapIncoming& sc, SoapOutgoing& data)
|
408 |
{
|
412 |
{
|
409 |
LOGDEB("OHProduct::attributes" << endl);
|
413 |
LOGDEB("OHProduct::attributes. csattrs: " << csattrs << endl);
|
410 |
data.addarg("Value", csattrs);
|
414 |
data.addarg("Value", csattrs);
|
411 |
return UPNP_E_SUCCESS;
|
415 |
return UPNP_E_SUCCESS;
|
412 |
}
|
416 |
}
|
413 |
|
417 |
|
414 |
int OHProduct::sourceXMLChangeCount(const SoapIncoming& sc, SoapOutgoing& data)
|
418 |
int OHProduct::sourceXMLChangeCount(const SoapIncoming& sc, SoapOutgoing& data)
|