|
a/src/ohinfo.cxx |
|
b/src/ohinfo.cxx |
|
... |
|
... |
38 |
|
38 |
|
39 |
static const string sTpProduct("urn:av-openhome-org:service:Info:1");
|
39 |
static const string sTpProduct("urn:av-openhome-org:service:Info:1");
|
40 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Info");
|
40 |
static const string sIdProduct("urn:av-openhome-org:serviceId:Info");
|
41 |
|
41 |
|
42 |
OHInfo::OHInfo(UpMpd *dev)
|
42 |
OHInfo::OHInfo(UpMpd *dev)
|
43 |
: UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev)
|
43 |
: OHService(sTpProduct, sIdProduct, dev)
|
44 |
{
|
44 |
{
|
45 |
dev->addActionMapping(this, "Counters",
|
45 |
dev->addActionMapping(this, "Counters",
|
46 |
bind(&OHInfo::counters, this, _1, _2));
|
46 |
bind(&OHInfo::counters, this, _1, _2));
|
47 |
dev->addActionMapping(this, "Track",
|
47 |
dev->addActionMapping(this, "Track",
|
48 |
bind(&OHInfo::track, this, _1, _2));
|
48 |
bind(&OHInfo::track, this, _1, _2));
|
|
... |
|
... |
103 |
st["CodecName"] = "";
|
103 |
st["CodecName"] = "";
|
104 |
st["Metatext"] = m_metatext;
|
104 |
st["Metatext"] = m_metatext;
|
105 |
return true;
|
105 |
return true;
|
106 |
}
|
106 |
}
|
107 |
|
107 |
|
108 |
bool OHInfo::getEventData(bool all, std::vector<std::string>& names,
|
|
|
109 |
std::vector<std::string>& values)
|
|
|
110 |
{
|
|
|
111 |
//LOGDEB("OHInfo::getEventData" << endl);
|
|
|
112 |
|
|
|
113 |
unordered_map<string, string> state, changed;
|
|
|
114 |
makestate(state);
|
|
|
115 |
if (all) {
|
|
|
116 |
changed = state;
|
|
|
117 |
} else {
|
|
|
118 |
changed = diffmaps(m_state, state);
|
|
|
119 |
}
|
|
|
120 |
m_state = state;
|
|
|
121 |
|
|
|
122 |
for (auto it = changed.begin(); it != changed.end(); it++) {
|
|
|
123 |
names.push_back(it->first);
|
|
|
124 |
values.push_back(it->second);
|
|
|
125 |
}
|
|
|
126 |
|
|
|
127 |
return true;
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
int OHInfo::counters(const SoapIncoming& sc, SoapOutgoing& data)
|
108 |
int OHInfo::counters(const SoapIncoming& sc, SoapOutgoing& data)
|
131 |
{
|
109 |
{
|
132 |
LOGDEB("OHInfo::counters" << endl);
|
110 |
LOGDEB("OHInfo::counters" << endl);
|
133 |
|
111 |
|
134 |
data.addarg("TrackCount", SoapHelp::i2s(m_dev->m_mpds ?
|
112 |
data.addarg("TrackCount", SoapHelp::i2s(m_dev->m_mpds ?
|