Commit 7ea91f5d authored by Jean-Francois Dockes's avatar Jean-Francois Dockes
Browse files

Do not change current volume level when switching between sources

parent c5c26aa1
...@@ -372,11 +372,15 @@ bool MPDCli::restoreState(const MpdState& st) ...@@ -372,11 +372,15 @@ bool MPDCli::restoreState(const MpdState& st)
random(st.status.random); random(st.status.random);
single(st.status.single); single(st.status.single);
consume(st.status.consume); consume(st.status.consume);
#if 0
// Do not restore the volume level, we want to keep whatever the user set
m_cachedvolume = st.status.volume; m_cachedvolume = st.status.volume;
//no need to set volume if it is controlled external //no need to set volume if it is controlled external
if (!m_externalvolumecontrol) if (!m_externalvolumecontrol)
mpd_run_set_volume(m_conn, st.status.volume); mpd_run_set_volume(m_conn, st.status.volume);
#endif
if (st.status.state == MpdStatus::MPDS_PAUSE || if (st.status.state == MpdStatus::MPDS_PAUSE ||
st.status.state == MpdStatus::MPDS_PLAY) { st.status.state == MpdStatus::MPDS_PLAY) {
// I think that the play is necessary and we can't just do // I think that the play is necessary and we can't just do
...@@ -386,8 +390,6 @@ bool MPDCli::restoreState(const MpdState& st) ...@@ -386,8 +390,6 @@ bool MPDCli::restoreState(const MpdState& st)
seek(st.status.songelapsedms/1000); seek(st.status.songelapsedms/1000);
if (st.status.state == MpdStatus::MPDS_PAUSE) if (st.status.state == MpdStatus::MPDS_PAUSE)
pause(true); pause(true);
if (!m_externalvolumecontrol)
mpd_run_set_volume(m_conn, st.status.volume);
} }
openconn(); openconn();
return true; return true;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment