Switch to unified view

a/src/ohplaylist.cxx b/src/ohplaylist.cxx
...
...
44
static const string sTpProduct("urn:av-openhome-org:service:Playlist:1");
44
static const string sTpProduct("urn:av-openhome-org:service:Playlist:1");
45
static const string sIdProduct("urn:av-openhome-org:serviceId:Playlist");
45
static const string sIdProduct("urn:av-openhome-org:serviceId:Playlist");
46
46
47
// Playlist is the default oh service, so it's active when starting up
47
// Playlist is the default oh service, so it's active when starting up
48
OHPlaylist::OHPlaylist(UpMpd *dev, unsigned int cssleep)
48
OHPlaylist::OHPlaylist(UpMpd *dev, unsigned int cssleep)
49
    : UpnpService(sTpProduct, sIdProduct, dev), m_dev(dev),
49
    : OHService(sTpProduct, sIdProduct, dev),
50
      m_active(true), m_cachedirty(false), m_mpdqvers(-1)
50
      m_active(true), m_cachedirty(false), m_mpdqvers(-1)
51
{
51
{
52
    dev->addActionMapping(this, "Play", 
52
    dev->addActionMapping(this, "Play", 
53
                          bind(&OHPlaylist::play, this, _1, _2));
53
                          bind(&OHPlaylist::play, this, _1, _2));
54
    dev->addActionMapping(this, "Pause", 
54
    dev->addActionMapping(this, "Pause", 
...
...
254
    m_mpdqvers = -1;
254
    m_mpdqvers = -1;
255
    unordered_map<string, string> st;
255
    unordered_map<string, string> st;
256
    makestate(st);
256
    makestate(st);
257
}
257
}
258
258
259
bool OHPlaylist::getEventData(bool all, std::vector<std::string>& names, 
260
                              std::vector<std::string>& values)
261
{
262
    //LOGDEB("OHPlaylist::getEventData" << endl);
263
264
    unordered_map<string, string> state;
265
266
    makestate(state);
267
268
    unordered_map<string, string> changed;
269
    if (all) {
270
        changed = state;
271
    } else {
272
        changed = diffmaps(m_state, state);
273
    }
274
    m_state = state;
275
276
    for (auto it = changed.begin(); it != changed.end(); it++) {
277
        names.push_back(it->first);
278
        values.push_back(it->second);
279
    }
280
281
    return true;
282
}
283
284
void OHPlaylist::maybeWakeUp(bool ok)
259
void OHPlaylist::maybeWakeUp(bool ok)
285
{
260
{
286
    if (ok && m_dev)
261
    if (ok && m_dev)
287
        m_dev->loopWakeup();
262
        m_dev->loopWakeup();
288
}
263
}