|
a/libupnpp/control/ohtime.cxx |
|
b/libupnpp/control/ohtime.cxx |
|
... |
|
... |
51 |
}
|
51 |
}
|
52 |
|
52 |
|
53 |
void OHTime::evtCallback(
|
53 |
void OHTime::evtCallback(
|
54 |
const std::unordered_map<std::string, std::string>& props)
|
54 |
const std::unordered_map<std::string, std::string>& props)
|
55 |
{
|
55 |
{
|
|
|
56 |
VarEventReporter *reporter = getReporter();
|
56 |
LOGDEB1("OHTime::evtCallback: getReporter(): " << getReporter() << endl);
|
57 |
LOGDEB1("OHTime::evtCallback: reporter: " << reporter << endl);
|
57 |
for (std::unordered_map<std::string, std::string>::const_iterator it =
|
58 |
for (const auto& ent : props) {
|
58 |
props.begin(); it != props.end(); it++) {
|
|
|
59 |
if (!getReporter()) {
|
59 |
if (!reporter) {
|
60 |
LOGDEB1("OHTime::evtCallback: " << it->first << " -> "
|
60 |
LOGDEB1("OHTime::evtCallback: " << ent.first << " -> "
|
61 |
<< it->second << endl);
|
61 |
<< ent.second << endl);
|
62 |
continue;
|
62 |
continue;
|
63 |
}
|
63 |
}
|
64 |
|
64 |
|
65 |
if (!it->first.compare("TrackCount") ||
|
65 |
if (!ent.first.compare("TrackCount") ||
|
66 |
!it->first.compare("Duration") ||
|
66 |
!ent.first.compare("Duration") ||
|
67 |
!it->first.compare("Seconds")) {
|
67 |
!ent.first.compare("Seconds")) {
|
68 |
|
68 |
|
69 |
getReporter()->changed(it->first.c_str(), atoi(it->second.c_str()));
|
69 |
reporter->changed(ent.first.c_str(), atoi(ent.second.c_str()));
|
70 |
|
70 |
|
71 |
} else {
|
71 |
} else {
|
72 |
LOGERR("OHTime event: unknown variable: name [" <<
|
72 |
LOGERR("OHTime event: unknown variable: name [" <<
|
73 |
it->first << "] value [" << it->second << endl);
|
73 |
ent.first << "] value [" << ent.second << endl);
|
74 |
getReporter()->changed(it->first.c_str(), it->second.c_str());
|
74 |
reporter->changed(ent.first.c_str(), ent.second.c_str());
|
75 |
}
|
75 |
}
|
76 |
}
|
76 |
}
|
77 |
}
|
77 |
}
|
78 |
|
78 |
|
79 |
void OHTime::registerCallback()
|
79 |
void OHTime::registerCallback()
|