From ab1bbe6913a173cebf9ec412518ad4d114b57d20 Mon Sep 17 00:00:00 2001 From: Christian Hoffmann Date: Mon, 8 Mar 2021 23:01:02 +0100 Subject: [PATCH] Revert "Client: Always update gain levels" This reverts PR #1009 (f116811a4e9748722a2f1b8178ebfe68737b57d0) as it has unintended side effects (#1191). Basically, that PR assumed that applying stored fader levels would always be a safe thing to do. This is not the case, as changes in fader levels are currently not stored immediately, but rather in specific events only (e.g. disconnects). PR #1009 was initially supposed to help with #955 as a client-side fix. With the revert, we still have the server-side fix from #1010. It is planned to re-apply #1009 once fader-level storage has been fully understood and extended to cover all relevant places (#1191). --- ChangeLog | 3 +-- src/audiomixerboard.cpp | 43 ++++++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 557e27681b..e70410cd43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,8 +49,7 @@ logic (#633, #1092), suggested by atsampson, coded by hoffie - bug fix: properly restore mixer levels after reconnecting to a restarted - server. updating the server or the client is sufficient to fix this. coded - by hoffie (#955, #1009, #1010) + server. This is a server-side fix. coded by hoffie (#955, #1010) - Improve update version detection, coded by softins (#1155) Check two servers instead of one (updatecheck1.jamulus.io and updatecheck2.jamulus.io). diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 5a1ebe2da4..5ffa00f779 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -1182,27 +1182,30 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector& vecChanInf } } - // restore gain: - // the text has actually changed, search in the list of - // stored settings if we have a matching entry - int iStoredFaderLevel; - int iStoredPanValue; - bool bStoredFaderIsSolo; - bool bStoredFaderIsMute; - int iGroupID; - - if ( GetStoredFaderSettings ( vecChanInfo[j].strName, - iStoredFaderLevel, - iStoredPanValue, - bStoredFaderIsSolo, - bStoredFaderIsMute, - iGroupID ) ) + // restore gain (if new name is different from the current one) + if ( vecpChanFader[i]->GetReceivedName().compare ( vecChanInfo[j].strName ) ) { - vecpChanFader[i]->SetFaderLevel ( iStoredFaderLevel, true ); // suppress group update - vecpChanFader[i]->SetPanValue ( iStoredPanValue ); - vecpChanFader[i]->SetFaderIsSolo ( bStoredFaderIsSolo ); - vecpChanFader[i]->SetFaderIsMute ( bStoredFaderIsMute ); - vecpChanFader[i]->SetGroupID ( iGroupID ); // Must be the last to be set in the fader! + // the text has actually changed, search in the list of + // stored settings if we have a matching entry + int iStoredFaderLevel; + int iStoredPanValue; + bool bStoredFaderIsSolo; + bool bStoredFaderIsMute; + int iGroupID; + + if ( GetStoredFaderSettings ( vecChanInfo[j].strName, + iStoredFaderLevel, + iStoredPanValue, + bStoredFaderIsSolo, + bStoredFaderIsMute, + iGroupID ) ) + { + vecpChanFader[i]->SetFaderLevel ( iStoredFaderLevel, true ); // suppress group update + vecpChanFader[i]->SetPanValue ( iStoredPanValue ); + vecpChanFader[i]->SetFaderIsSolo ( bStoredFaderIsSolo ); + vecpChanFader[i]->SetFaderIsMute ( bStoredFaderIsMute ); + vecpChanFader[i]->SetGroupID ( iGroupID ); // Must be the last to be set in the fader! + } } // set the channel infos