--- a/upmpd/ohproduct.cxx
+++ b/upmpd/ohproduct.cxx
@@ -46,28 +46,30 @@
OHProduct::OHProduct(UpMpd *dev)
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev)
{
- dev->addActionMapping("Manufacturer", bind(&OHProduct::manufacturer,
- this, _1, _2));
- dev->addActionMapping("Model", bind(&OHProduct::model, this, _1, _2));
- dev->addActionMapping("Product", bind(&OHProduct::product, this, _1, _2));
- dev->addActionMapping("Standby", bind(&OHProduct::standby, this, _1, _2));
- dev->addActionMapping("SetStandby", bind(&OHProduct::setStandby,
- this, _1, _2));
- dev->addActionMapping("SourceCount", bind(&OHProduct::sourceCount,
- this, _1, _2));
- dev->addActionMapping("SourceXml", bind(&OHProduct::sourceXML,
- this, _1, _2));
- dev->addActionMapping("SourceIndex", bind(&OHProduct::sourceIndex,
- this, _1, _2));
- dev->addActionMapping("SetSourceIndex",
+ dev->addActionMapping(this, "Manufacturer",
+ bind(&OHProduct::manufacturer, this, _1, _2));
+ dev->addActionMapping(this, "Model", bind(&OHProduct::model, this, _1, _2));
+ dev->addActionMapping(this, "Product",
+ bind(&OHProduct::product, this, _1, _2));
+ dev->addActionMapping(this, "Standby",
+ bind(&OHProduct::standby, this, _1, _2));
+ dev->addActionMapping(this, "SetStandby",
+ bind(&OHProduct::setStandby, this, _1, _2));
+ dev->addActionMapping(this, "SourceCount",
+ bind(&OHProduct::sourceCount, this, _1, _2));
+ dev->addActionMapping(this, "SourceXml",
+ bind(&OHProduct::sourceXML, this, _1, _2));
+ dev->addActionMapping(this, "SourceIndex",
+ bind(&OHProduct::sourceIndex, this, _1, _2));
+ dev->addActionMapping(this, "SetSourceIndex",
bind(&OHProduct::setSourceIndex, this, _1, _2));
- dev->addActionMapping("SetSourceIndexByName",
+ dev->addActionMapping(this, "SetSourceIndexByName",
bind(&OHProduct::setSourceIndexByName, this, _1, _2));
- dev->addActionMapping("Source",
+ dev->addActionMapping(this, "Source",
bind(&OHProduct::source, this, _1, _2));
- dev->addActionMapping("Attributes",
+ dev->addActionMapping(this, "Attributes",
bind(&OHProduct::attributes, this, _1, _2));
- dev->addActionMapping("SourceXmlChangeCount",
+ dev->addActionMapping(this, "SourceXmlChangeCount",
bind(&OHProduct::sourceXMLChangeCount, this, _1, _2));
}
@@ -83,7 +85,13 @@
static const string csattrs("Info Time Volume");
static const string csversion("1.0");
-
+static const string csmanname("UpMPDCli heavy industries Co.");
+static const string csmaninfo("Such nice guys and gals");
+static const string csmanurl("http://www.lesbonscomptes.com/upmpdcli");
+static const string csmodname("UpMPDCli UPnP-MPD gateway");
+static const string csmodurl("http://www.lesbonscomptes.com/upmpdcli");
+static const string csprodroom("Bureau");
+static const string csprodname("Upmpdcli");
bool OHProduct::getEventData(bool all, std::vector<std::string>& names,
std::vector<std::string>& values)
{
@@ -91,42 +99,24 @@
// Our data never changes, so if this is not an unconditional
// request, we return nothing.
if (all) {
- names.push_back("ManufacturerName");
- values.push_back("UpMPDCli heavy industries Co.");
- names.push_back("ManufacturerInfo");
- values.push_back("Such nice guys and gals");
- names.push_back("ManufacturerUrl");
- values.push_back("http://www.lesbonscomptes.com/upmpdcli");
- names.push_back("ManufacturerImageUri");
- values.push_back("");
- names.push_back("ModelName");
- values.push_back("UpMPDCli UPnP-MPD gateway");
- names.push_back("ModelInfo");
- values.push_back(csversion);
- names.push_back("ModelUrl");
- values.push_back("");
- names.push_back("ModelImageUri");
- values.push_back("");
- names.push_back("ProductRoom");
- values.push_back("");
- names.push_back("ProductName");
- values.push_back("");
- names.push_back("ProductInfo");
- values.push_back("");
- names.push_back("ProductUrl");
- values.push_back("");
- names.push_back("ProductImageUri");
- values.push_back("");
- names.push_back("Standby");
- values.push_back("0");
- names.push_back("SourceCount");
- values.push_back("1");
- names.push_back("SourceXml");
- values.push_back(csxml);
- names.push_back("SourceIndex");
- values.push_back("0");
- names.push_back("Attributes");
- values.push_back(csattrs);
+ names.push_back("ManufacturerName"); values.push_back(csmanname);
+ names.push_back("ManufacturerInfo"); values.push_back(csmaninfo);
+ names.push_back("ManufacturerUrl"); values.push_back(csmanurl);
+ names.push_back("ManufacturerImageUri"); values.push_back("");
+ names.push_back("ModelName"); values.push_back(csmodname);
+ names.push_back("ModelInfo"); values.push_back(csversion);
+ names.push_back("ModelUrl"); values.push_back(csmodurl);
+ names.push_back("ModelImageUri"); values.push_back("");
+ names.push_back("ProductRoom"); values.push_back(csprodroom);
+ names.push_back("ProductName"); values.push_back(csprodname);
+ names.push_back("ProductInfo"); values.push_back(csversion);
+ names.push_back("ProductUrl"); values.push_back("");
+ names.push_back("ProductImageUri"); values.push_back("");
+ names.push_back("Standby"); values.push_back("0");
+ names.push_back("SourceCount"); values.push_back("1");
+ names.push_back("SourceXml"); values.push_back(csxml);
+ names.push_back("SourceIndex"); values.push_back("0");
+ names.push_back("Attributes");values.push_back(csattrs);
}
return true;
}
@@ -134,9 +124,9 @@
int OHProduct::manufacturer(const SoapArgs& sc, SoapData& data)
{
LOGDEB("OHProduct::manufacturer" << endl);
- data.addarg("Name", "UpMPDCli HEAVY Industries");
- data.addarg("Info", "Such nice guys and gals");
- data.addarg("Url", "http://www.lesbonscomptes.com/upmpdcli");
+ data.addarg("Name", csmanname);
+ data.addarg("Info", csmaninfo);
+ data.addarg("Url", csmanurl);
data.addarg("ImageUri", "");
return UPNP_E_SUCCESS;
}
@@ -144,9 +134,9 @@
int OHProduct::model(const SoapArgs& sc, SoapData& data)
{
LOGDEB("OHProduct::model" << endl);
- data.addarg("Name", "UpMPDCli UPnP-MPD gateway");
+ data.addarg("Name", csmodname);
data.addarg("Info", csversion);
- data.addarg("Url", "http://www.lesbonscomptes.com/upmpdcli");
+ data.addarg("Url", csmodurl);
data.addarg("ImageUri", "");
return UPNP_E_SUCCESS;
}
@@ -154,8 +144,8 @@
int OHProduct::product(const SoapArgs& sc, SoapData& data)
{
LOGDEB("OHProduct::product" << endl);
- data.addarg("Room", "");
- data.addarg("Name", "");
+ data.addarg("Room", csprodroom);
+ data.addarg("Name", csprodname);
data.addarg("Info", csversion);
data.addarg("Url", "");
data.addarg("ImageUri", "");
@@ -232,12 +222,12 @@
if (!sc.getInt("Index", &sindex)) {
return UPNP_E_INVALID_PARAM;
}
- LOGDEB("OHProduct::setSourceIndex: " << sindex << endl);
+ LOGDEB("OHProduct::source: " << sindex << endl);
if (sindex != 0) {
return UPNP_E_INVALID_PARAM;
}
- data.addarg("SystemName", "Default");
- data.addarg("Type", "PlayList");
+ data.addarg("SystemName", csprodroom);
+ data.addarg("Type", "Playlist");
data.addarg("Name", "PlayList");
data.addarg("Visible", "1");
return UPNP_E_SUCCESS;