|
a/src/upmpd.cxx |
|
b/src/upmpd.cxx |
|
... |
|
... |
40 |
#include "ohsndrcv.hxx"
|
40 |
#include "ohsndrcv.hxx"
|
41 |
|
41 |
|
42 |
using namespace std;
|
42 |
using namespace std;
|
43 |
using namespace std::placeholders;
|
43 |
using namespace std::placeholders;
|
44 |
using namespace UPnPP;
|
44 |
using namespace UPnPP;
|
45 |
|
|
|
46 |
bool OHService::getEventData(bool all, vector<string>& names,
|
|
|
47 |
vector<std::string>& values)
|
|
|
48 |
{
|
|
|
49 |
//LOGDEB("OHService::getEventData" << std::endl);
|
|
|
50 |
|
|
|
51 |
std::unordered_map<std::string, std::string> state, changed;
|
|
|
52 |
makestate(state);
|
|
|
53 |
if (all) {
|
|
|
54 |
changed = state;
|
|
|
55 |
} else {
|
|
|
56 |
changed = diffmaps(m_state, state);
|
|
|
57 |
}
|
|
|
58 |
m_state = state;
|
|
|
59 |
|
|
|
60 |
for (auto it = changed.begin(); it != changed.end(); it++) {
|
|
|
61 |
//LOGDEB("OHService: state change: " << it->first << " -> "
|
|
|
62 |
// << it->second << endl);
|
|
|
63 |
names.push_back(it->first);
|
|
|
64 |
values.push_back(it->second);
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
return true;
|
|
|
68 |
}
|
|
|
69 |
|
45 |
|
70 |
// Note: if we ever need this to work without cxx11, there is this:
|
46 |
// Note: if we ever need this to work without cxx11, there is this:
|
71 |
// http://www.tutok.sk/fastgl/callback.html
|
47 |
// http://www.tutok.sk/fastgl/callback.html
|
72 |
UpMpd::UpMpd(const string& deviceid, const string& friendlyname,
|
48 |
UpMpd::UpMpd(const string& deviceid, const string& friendlyname,
|
73 |
ohProductDesc_t& ohProductDesc,
|
49 |
ohProductDesc_t& ohProductDesc,
|