Switch to unified view

a/src/ohreceiver.cxx b/src/ohreceiver.cxx
...
...
61
61
62
    m_httpuri = "http://localhost:"+ SoapHelp::i2s(m_httpport) + 
62
    m_httpuri = "http://localhost:"+ SoapHelp::i2s(m_httpport) + 
63
        "/Songcast.wav";
63
        "/Songcast.wav";
64
}
64
}
65
65
66
// Allowed states: Stopped, Playing,Waiting, Buffering
67
static string mpdsToTransportState(MpdStatus::State st)
68
{
69
    string tstate;
70
71
    switch(st) {
72
    case MpdStatus::MPDS_PLAY: 
73
        tstate = "Playing";
74
        break;
75
    default:
76
        tstate = "Stopped";
77
        break;
78
    }
79
    return tstate;
80
}
81
82
//                                 
66
//                                 
83
static const string o_protocolinfo("ohz:*:*:*,ohm:*:*:*,ohu:*.*.*");
67
static const string o_protocolinfo("ohz:*:*:*,ohm:*:*:*,ohu:*.*.*");
84
//static const string o_protocolinfo("ohu:*:*:*");
68
//static const string o_protocolinfo("ohu:*:*:*");
85
69
86
bool OHReceiver::makestate(unordered_map<string, string> &st)
70
bool OHReceiver::makestate(unordered_map<string, string> &st)
87
{
71
{
88
    st.clear();
72
    st.clear();
89
73
90
    const MpdStatus &mpds = m_dev->getMpdStatusNoUpdate();
91
92
    st["Uri"] = m_uri;
74
    st["Uri"] = m_uri;
93
    st["Metadata"] = m_metadata;
75
    st["Metadata"] = m_metadata;
94
    st["TransportState"] = mpdsToTransportState(mpds.state);
76
    // Allowed states: Stopped, Playing,Waiting, Buffering
77
    // We won't receive a Stop action if we are not Playing. So we
78
    // are playing as long as we have a subprocess
79
    if (m_cmd)
80
        st["TransportState"] = "Playing";
81
    else 
82
        st["TransportState"] = "Stopped";
95
    st["ProtocolInfo"] = o_protocolinfo;
83
    st["ProtocolInfo"] = o_protocolinfo;
96
    return true;
84
    return true;
97
}
85
}
98
86
99
bool OHReceiver::getEventData(bool all, std::vector<std::string>& names, 
87
bool OHReceiver::getEventData(bool all, std::vector<std::string>& names, 
...
...
252
}
240
}
253
241
254
int OHReceiver::transportState(const SoapArgs& sc, SoapData& data)
242
int OHReceiver::transportState(const SoapArgs& sc, SoapData& data)
255
{
243
{
256
    //LOGDEB("OHReceiver::transportState" << endl);
244
    //LOGDEB("OHReceiver::transportState" << endl);
257
    const MpdStatus &mpds = m_dev->getMpdStatusNoUpdate();
245
258
    string tstate = mpdsToTransportState(mpds.state);
246
    // Allowed states: Stopped, Playing,Waiting, Buffering
247
    // We won't receive a Stop action if we are not Playing. So we
248
    // are playing as long as we have a subprocess
249
    string tstate = m_cmd ? "Playing" : "Stopped";
259
    data.addarg("Value", tstate);
250
    data.addarg("Value", tstate);
260
    LOGDEB("OHReceiver::transportState: " << tstate << endl);
251
    LOGDEB("OHReceiver::transportState: " << tstate << endl);
261
    return UPNP_E_SUCCESS;
252
    return UPNP_E_SUCCESS;
262
}
253
}
263
254