Switch to unified view

a/upmpd/ohproduct.cxx b/upmpd/ohproduct.cxx
...
...
41
#include "upmpdutils.hxx"
41
#include "upmpdutils.hxx"
42
42
43
static const string sTpProduct("urn:av-openhome-org:service:Product:1");
43
static const string sTpProduct("urn:av-openhome-org:service:Product:1");
44
static const string sIdProduct("urn:av-openhome-org:serviceId:Product");
44
static const string sIdProduct("urn:av-openhome-org:serviceId:Product");
45
45
46
OHProduct::OHProduct(UpMpd *dev)
46
OHProduct::OHProduct(UpMpd *dev, const string& friendlyname)
47
    : UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev)
47
    : UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
48
      m_roomOrName(friendlyname)
48
{
49
{
49
    dev->addActionMapping(this, "Manufacturer", 
50
    dev->addActionMapping(this, "Manufacturer", 
50
                          bind(&OHProduct::manufacturer, this, _1, _2));
51
                          bind(&OHProduct::manufacturer, this, _1, _2));
51
    dev->addActionMapping(this, "Model", bind(&OHProduct::model, this, _1, _2));
52
    dev->addActionMapping(this, "Model", bind(&OHProduct::model, this, _1, _2));
52
    dev->addActionMapping(this, "Product", 
53
    dev->addActionMapping(this, "Product", 
...
...
88
static const string csmanname("UpMPDCli heavy industries Co.");
89
static const string csmanname("UpMPDCli heavy industries Co.");
89
static const string csmaninfo("Such nice guys and gals");
90
static const string csmaninfo("Such nice guys and gals");
90
static const string csmanurl("http://www.lesbonscomptes.com/upmpdcli");
91
static const string csmanurl("http://www.lesbonscomptes.com/upmpdcli");
91
static const string csmodname("UpMPDCli UPnP-MPD gateway");
92
static const string csmodname("UpMPDCli UPnP-MPD gateway");
92
static const string csmodurl("http://www.lesbonscomptes.com/upmpdcli");
93
static const string csmodurl("http://www.lesbonscomptes.com/upmpdcli");
93
static const string csprodroom("Bureau");
94
static const string csprodname("Upmpdcli");
94
static const string csprodname("Upmpdcli");
95
bool OHProduct::getEventData(bool all, std::vector<std::string>& names, 
95
bool OHProduct::getEventData(bool all, std::vector<std::string>& names, 
96
                             std::vector<std::string>& values)
96
                             std::vector<std::string>& values)
97
{
97
{
98
    //LOGDEB("OHProduct::getEventData" << endl);
98
    //LOGDEB("OHProduct::getEventData" << endl);
...
...
105
        names.push_back("ManufacturerImageUri"); values.push_back("");
105
        names.push_back("ManufacturerImageUri"); values.push_back("");
106
        names.push_back("ModelName"); values.push_back(csmodname);
106
        names.push_back("ModelName"); values.push_back(csmodname);
107
        names.push_back("ModelInfo"); values.push_back(csversion);
107
        names.push_back("ModelInfo"); values.push_back(csversion);
108
        names.push_back("ModelUrl");  values.push_back(csmodurl);
108
        names.push_back("ModelUrl");  values.push_back(csmodurl);
109
        names.push_back("ModelImageUri"); values.push_back("");
109
        names.push_back("ModelImageUri"); values.push_back("");
110
        names.push_back("ProductRoom"); values.push_back(csprodroom);
110
        names.push_back("ProductRoom"); values.push_back(m_roomOrName);
111
        names.push_back("ProductName"); values.push_back(csprodname);
111
        names.push_back("ProductName"); values.push_back(csprodname);
112
        names.push_back("ProductInfo"); values.push_back(csversion);
112
        names.push_back("ProductInfo"); values.push_back(csversion);
113
        names.push_back("ProductUrl"); values.push_back("");
113
        names.push_back("ProductUrl"); values.push_back("");
114
        names.push_back("ProductImageUri"); values.push_back("");
114
        names.push_back("ProductImageUri"); values.push_back("");
115
        names.push_back("Standby"); values.push_back("0");
115
        names.push_back("Standby"); values.push_back("0");
...
...
142
}
142
}
143
143
144
int OHProduct::product(const SoapArgs& sc, SoapData& data)
144
int OHProduct::product(const SoapArgs& sc, SoapData& data)
145
{
145
{
146
    LOGDEB("OHProduct::product" << endl);
146
    LOGDEB("OHProduct::product" << endl);
147
    data.addarg("Room", csprodroom);
147
    data.addarg("Room", m_roomOrName);
148
    data.addarg("Name", csprodname);
148
    data.addarg("Name", csprodname);
149
    data.addarg("Info", csversion);
149
    data.addarg("Info", csversion);
150
    data.addarg("Url", "");
150
    data.addarg("Url", "");
151
    data.addarg("ImageUri", "");
151
    data.addarg("ImageUri", "");
152
    return UPNP_E_SUCCESS;
152
    return UPNP_E_SUCCESS;
...
...
224
    }
224
    }
225
    LOGDEB("OHProduct::source: " << sindex << endl);
225
    LOGDEB("OHProduct::source: " << sindex << endl);
226
    if (sindex != 0) {
226
    if (sindex != 0) {
227
        return UPNP_E_INVALID_PARAM;
227
        return UPNP_E_INVALID_PARAM;
228
    }
228
    }
229
    data.addarg("SystemName", csprodroom);
229
    data.addarg("SystemName", m_roomOrName);
230
    data.addarg("Type", "Playlist");
230
    data.addarg("Type", "Playlist");
231
    data.addarg("Name", "PlayList");
231
    data.addarg("Name", "PlayList");
232
    data.addarg("Visible", "1");
232
    data.addarg("Visible", "1");
233
    return UPNP_E_SUCCESS;
233
    return UPNP_E_SUCCESS;
234
}
234
}