Switch to unified view

a/libupnpp/control/avtransport.cxx b/libupnpp/control/avtransport.cxx
...
...
136
136
137
            } else if (!entry1.first.compare("CurrentPlayMode")) {
137
            } else if (!entry1.first.compare("CurrentPlayMode")) {
138
                m_reporter->changed(entry1.first.c_str(), 
138
                m_reporter->changed(entry1.first.c_str(), 
139
                                    stringToPlayMode(entry1.second));
139
                                    stringToPlayMode(entry1.second));
140
140
141
            } else if (!entry1.first.compare("CurrentTransportActions") ||
141
            } else if (!entry1.first.compare("CurrentTransportActions")) {
142
                int iacts;
143
                if (!CTAStringToBits(entry1.second, iacts))
144
                    m_reporter->changed(entry1.first.c_str(), iacts);
145
142
                       !entry1.first.compare("CurrentTrackURI") ||
146
            } else if (!entry1.first.compare("CurrentTrackURI") ||
143
                       !entry1.first.compare("AVTransportURI") ||
147
                       !entry1.first.compare("AVTransportURI") ||
144
                       !entry1.first.compare("NextAVTransportURI")) {
148
                       !entry1.first.compare("NextAVTransportURI")) {
145
                m_reporter->changed(entry1.first.c_str(), 
149
                m_reporter->changed(entry1.first.c_str(), 
146
                                    entry1.second.c_str());
150
                                    entry1.second.c_str());
147
151
...
...
338
    info.playmode = stringToPlayMode(s);
342
    info.playmode = stringToPlayMode(s);
339
    data.getString("RecQualityMode", &info.recqualitymode);
343
    data.getString("RecQualityMode", &info.recqualitymode);
340
    return 0;
344
    return 0;
341
}
345
}
342
346
343
int AVTransport::getCurrentTransportActions(std::string& actions, int iID)
347
int AVTransport::getCurrentTransportActions(int& iacts, int iID)
344
{
348
{
345
    SoapEncodeInput args(m_serviceType, "GetCurrentTransportActions");
349
    SoapEncodeInput args(m_serviceType, "GetCurrentTransportActions");
346
    args("InstanceID", SoapHelp::i2s(iID));
350
    args("InstanceID", SoapHelp::i2s(iID));
347
    SoapDecodeOutput data;
351
    SoapDecodeOutput data;
348
    int ret = runAction(args, data);
352
    int ret = runAction(args, data);
349
    if (ret != UPNP_E_SUCCESS) {
353
    if (ret != UPNP_E_SUCCESS) {
350
        return ret;
354
        return ret;
351
    }
355
    }
356
    string actions;
352
    data.getString("Actions", &actions);
357
    if (!data.getString("Actions", &actions)) {
358
        LOGERR("AVTransport:getCurrentTransportActions: no actions in answer"
359
               << endl);
360
        return UPNP_E_BAD_RESPONSE;
361
    }
362
    return CTAStringToBits(actions, iacts);
363
}
364
365
int AVTransport::CTAStringToBits(const string& actions, int& iacts)
366
{
367
    vector<string> sacts;
368
    if (!csvToStrings(actions, sacts)) {
369
        LOGERR("AVTransport::CTAStringToBits: bad actions string:"
370
               << actions << endl);
371
        return UPNP_E_BAD_RESPONSE;
372
    }
373
    iacts = 0;
374
    for (auto it = sacts.begin(); it != sacts.end(); it++) {
375
        trimstring(*it);
376
        if (!it->compare("Next")) {
377
            iacts |= TPA_Next;
378
        } else if (!it->compare("Pause")) {
379
            iacts |= TPA_Pause;
380
        } else if (!it->compare("Play")) {
381
            iacts |= TPA_Play;
382
        } else if (!it->compare("Previous")) {
383
            iacts |= TPA_Previous;
384
        } else if (!it->compare("Seek")) {
385
            iacts |= TPA_Seek;
386
        } else if (!it->compare("Stop")) {
387
            iacts |= TPA_Stop;
388
        } else {
389
            LOGERR("AVTransport::CTAStringToBits: unknown action "
390
                   << *it << endl);
391
        }
392
    }
353
    return 0;
393
    return 0;
354
}
394
}
355
395
356
int AVTransport::stop(int instanceID)
396
int AVTransport::stop(int instanceID)
357
{
397
{