|
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 |
//
|
|
|
67 |
static const string o_protocolinfo("ohz:*:*:*,ohm:*:*:*,ohu:*.*.*");
|
66 |
static const string o_protocolinfo("ohz:*:*:*,ohm:*:*:*,ohu:*.*.*");
|
68 |
//static const string o_protocolinfo("ohu:*:*:*");
|
|
|
69 |
|
67 |
|
70 |
bool OHReceiver::makestate(unordered_map<string, string> &st)
|
68 |
bool OHReceiver::makestate(unordered_map<string, string> &st)
|
71 |
{
|
69 |
{
|
|
|
70 |
const MpdStatus &mpds = m_dev->getMpdStatusNoUpdate();
|
|
|
71 |
|
|
|
72 |
if (m_cmd && mpds.state != MpdStatus::MPDS_PLAY &&
|
|
|
73 |
mpds.state != MpdStatus::MPDS_PAUSE) {
|
|
|
74 |
// playing was stopped through ohplaylist or
|
|
|
75 |
// avtransport. I'm not sure we're supposed to let this
|
|
|
76 |
// happen, but we do. Stop too.
|
|
|
77 |
iStop();
|
|
|
78 |
}
|
|
|
79 |
|
72 |
st.clear();
|
80 |
st.clear();
|
73 |
|
81 |
|
74 |
st["Uri"] = m_uri;
|
82 |
st["Uri"] = m_uri;
|
75 |
st["Metadata"] = m_metadata;
|
83 |
st["Metadata"] = m_metadata;
|
76 |
// Allowed states: Stopped, Playing,Waiting, Buffering
|
84 |
// Allowed states: Stopped, Playing,Waiting, Buffering
|
|
... |
|
... |
244 |
{
|
252 |
{
|
245 |
LOGDEB("OHReceiver::setSender" << endl);
|
253 |
LOGDEB("OHReceiver::setSender" << endl);
|
246 |
string uri, metadata;
|
254 |
string uri, metadata;
|
247 |
bool ok = sc.get("Uri", &uri) && sc.get("Metadata", &metadata);
|
255 |
bool ok = sc.get("Uri", &uri) && sc.get("Metadata", &metadata);
|
248 |
|
256 |
|
249 |
if (ok) {
|
257 |
// Only do something if data changes, and then first stop any
|
|
|
258 |
// current playing. We probably should not receive this if we're
|
|
|
259 |
// not in the stopped state, but just in case...
|
|
|
260 |
if (ok && (m_uri.compare(uri) || m_metadata.compare(metadata))) {
|
|
|
261 |
iStop();
|
250 |
m_uri = uri;
|
262 |
m_uri = uri;
|
251 |
m_metadata = metadata;
|
263 |
m_metadata = metadata;
|
252 |
LOGDEB("OHReceiver::setSender: uri [" << m_uri << "] meta [" <<
|
264 |
LOGDEB("OHReceiver::setSender: uri [" << m_uri << "] meta [" <<
|
253 |
m_metadata << "]" << endl);
|
265 |
m_metadata << "]" << endl);
|
254 |
}
|
266 |
}
|