|
a/src/mpdcli.cxx |
|
b/src/mpdcli.cxx |
|
... |
|
... |
176 |
showError("MPDCli::updStatus");
|
176 |
showError("MPDCli::updStatus");
|
177 |
}
|
177 |
}
|
178 |
return false;
|
178 |
return false;
|
179 |
}
|
179 |
}
|
180 |
|
180 |
|
181 |
if (m_stat.externalvolumecontrol) {
|
181 |
if (m_stat.externalvolumecontrol && !m_stat.getexternalvolume.empty()) {
|
182 |
string result;
|
182 |
string result;
|
183 |
vector<string> cmd;
|
183 |
vector<string> cmd;
|
184 |
cmd.push_back(m_stat.getexternalvolume);
|
184 |
cmd.push_back(m_stat.getexternalvolume);
|
185 |
if (ExecCmd::backtick(cmd, result)) {
|
185 |
if (ExecCmd::backtick(cmd, result)) {
|
186 |
//LOGDEB("MPDCli::volume retrieved: " << result << endl);
|
186 |
//LOGDEB("MPDCli::volume retrieved: " << result << endl);
|
|
... |
|
... |
333 |
m_stat.onvolumechange = st.status.onvolumechange;
|
333 |
m_stat.onvolumechange = st.status.onvolumechange;
|
334 |
m_stat.getexternalvolume = st.status.getexternalvolume;
|
334 |
m_stat.getexternalvolume = st.status.getexternalvolume;
|
335 |
//no need to set volume if it is controlled external
|
335 |
//no need to set volume if it is controlled external
|
336 |
if (!m_stat.externalvolumecontrol)
|
336 |
if (!m_stat.externalvolumecontrol)
|
337 |
mpd_run_set_volume(M_CONN, st.status.volume);
|
337 |
mpd_run_set_volume(M_CONN, st.status.volume);
|
338 |
// If songelapsedms is set, we have to start playing to restore it
|
338 |
|
339 |
if (st.status.songelapsedms > 0 ||
|
339 |
if (st.status.state == MpdStatus::MPDS_PAUSE ||
|
340 |
st.status.state == MpdStatus::MPDS_PLAY) {
|
340 |
st.status.state == MpdStatus::MPDS_PLAY) {
|
|
|
341 |
// I think that the play is necessary and we can't just do
|
|
|
342 |
// pause/seek from stop state. To be verified.
|
341 |
play(st.status.songpos);
|
343 |
play(st.status.songpos);
|
|
|
344 |
if (st.status.songelapsedms > 0)
|
|
|
345 |
seek(st.status.songelapsedms/1000);
|
|
|
346 |
if (st.status.state == MpdStatus::MPDS_PAUSE)
|
|
|
347 |
pause(true);
|
342 |
if (!m_stat.externalvolumecontrol)
|
348 |
if (!m_stat.externalvolumecontrol)
|
343 |
mpd_run_set_volume(M_CONN, st.status.volume);
|
349 |
mpd_run_set_volume(M_CONN, st.status.volume);
|
344 |
if (st.status.songelapsedms > 0)
|
|
|
345 |
seek(st.status.songelapsedms/1000);
|
|
|
346 |
}
|
350 |
}
|
347 |
return true;
|
351 |
return true;
|
348 |
}
|
352 |
}
|
349 |
|
353 |
|
350 |
|
354 |
|