From 4edb160a0a63615f1cd90311203779fce3f2fad0 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sat, 18 Apr 2020 08:39:08 +0200 Subject: [PATCH] small merge fixes --- ChangeLog | 6 ++++-- src/server.h | 1 + src/serverdlg.cpp | 8 +++++++- src/serverlist.cpp | 17 ++++++++++------- src/util.h | 1 + 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index a0c3dea6..2b6733a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,14 +19,16 @@ * the ping times in the server list are now more stable +TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f) + +TODO try to find a way to catch Windows exceptions in case a 64 bit Jamulus tries to load a 32 bit Jack Audio ASIO dll + TODO store Show All Musicians setting in the ini-file TODO bug fix: "Start up the new version with the Connection Setup showing. "Show all musicians" is on (as I say). Switch it off before the list is displayed. The checkbox is off - but the list displays all musicians! You need to turn it on and off again to get it to do its thing. (If you wait a little, it's fine - i.e. before it's populated the musicians but after it's displayed the list, turn it off.)", see https://github.com/corrados/jamulus/issues/78 -TODO offer the Jamulus ASIO settingspanel in case of an ASIO ERROR to fix, e.g., incorrect sample rate (https://sourceforge.net/p/llcon/discussion/533517/thread/777663cf94/#035f) - TODO the server list filter seems not to work if --showallservers is used TODO store Central Server jamulus.server start scripts on the Repo (one for Central Server, one for Central Server North America) diff --git a/src/server.h b/src/server.h index ace2d57c..c58b550b 100755 --- a/src/server.h +++ b/src/server.h @@ -192,6 +192,7 @@ public: ESvrRegStatus GetSvrRegStatus() { return ServerListManager.GetSvrRegStatus(); } + // GUI settings ------------------------------------------------------------ void SetAutoRunMinimized ( const bool NAuRuMin ) { bAutoRunMinimized = NAuRuMin; } bool GetAutoRunMinimized() { return bAutoRunMinimized; } diff --git a/src/serverdlg.cpp b/src/serverdlg.cpp index 03da852f..e8db9beb 100755 --- a/src/serverdlg.cpp +++ b/src/serverdlg.cpp @@ -546,32 +546,38 @@ void CServerDlg::UpdateGUIDependencies() !bCurUseDefCentServAddr && bCurSerListEnabled ); QString strStatus; + switch ( eSvrRegStatus ) { case SRS_UNREGISTERED: strStatus = "Unregistered"; break; + case SRS_BAD_ADDRESS: strStatus = "Bad address"; break; + case SRS_REQUESTED: strStatus = "Registration requested"; break; + case SRS_TIME_OUT: strStatus = "Using longer retries"; break; + case SRS_UNKNOWN_RESP: strStatus = "Check server version, retrying"; break; + case SRS_REGISTERED: strStatus = "Registered"; break; + case SRS_CENTRAL_SVR_FULL: strStatus = "Central Server full"; break; } lblRegSvrStatus->setText( strStatus ); - } void CServerDlg::UpdateSystemTrayIcon ( const bool bIsActive ) diff --git a/src/serverlist.cpp b/src/serverlist.cpp index 22948e5a..ea7a956d 100755 --- a/src/serverlist.cpp +++ b/src/serverlist.cpp @@ -166,6 +166,10 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum, this, SLOT ( OnTimerIsPermanent() ) ); } + // prepare the register server response timer (single shot timer) + TimerCLRegisterServerResp.setSingleShot ( true ); + TimerCLRegisterServerResp.setInterval ( REGISTER_SERVER_TIME_OUT_MS ); + // Connections ------------------------------------------------------------- QObject::connect ( &TimerPollList, SIGNAL ( timeout() ), @@ -180,8 +184,6 @@ CServerListManager::CServerListManager ( const quint16 iNPortNum, QObject::connect ( &TimerRegistering, SIGNAL ( timeout() ), this, SLOT ( OnTimerRegistering() ) ); - TimerCLRegisterServerResp.setSingleShot ( true ); - TimerCLRegisterServerResp.setInterval ( REGISTER_SERVER_TIME_OUT_MS ); QObject::connect ( &TimerCLRegisterServerResp, SIGNAL ( timeout() ), this, SLOT ( OnTimerCLRegisterServerResp() ) ); } @@ -314,15 +316,14 @@ void CServerListManager::OnTimerPollList() for ( int iIdx = 1 + iNumPredefinedServers; iIdx < ServerList.size(); ) { // 1 minute = 60 * 1000 ms - if ( ServerList[iIdx].RegisterTime.elapsed() > - ( SERVLIST_TIME_OUT_MINUTES * 60000 ) ) + if ( ServerList[iIdx].RegisterTime.elapsed() > ( SERVLIST_TIME_OUT_MINUTES * 60000 ) ) { // remove this list entry ServerList.removeAt ( iIdx ); } else { - // Move to the next entry (only on else) + // move to the next entry (only on else) iIdx++; } } @@ -482,16 +483,17 @@ void CServerListManager::StoreRegistrationResult ( ESvrRegResult eResult ) // any time so another response could arrive QMutexLocker locker ( &Mutex ); - // We got some response, so stop the retry timer + // we got some response, so stop the retry timer TimerCLRegisterServerResp.stop(); eSvrRegStatus = ESvrRegStatus::SRS_UNKNOWN_RESP; - switch ( eResult ) + switch ( eResult ) { case ESvrRegResult::SRR_REGISTERED: eSvrRegStatus = ESvrRegStatus::SRS_REGISTERED; break; + case ESvrRegResult::SRR_CENTRAL_SVR_FULL: eSvrRegStatus = ESvrRegStatus::SRS_CENTRAL_SVR_FULL; break; @@ -520,6 +522,7 @@ void CServerListManager::OnTimerCLRegisterServerResp() if ( eSvrRegStatus == SRS_REQUESTED ) { iSvrRegRetries++; + if ( iSvrRegRetries >= REGISTER_SERVER_RETRY_LIMIT ) { eSvrRegStatus = SRS_TIME_OUT; diff --git a/src/util.h b/src/util.h index 3b39523f..2282078e 100755 --- a/src/util.h +++ b/src/util.h @@ -588,6 +588,7 @@ enum ESvrRegStatus // Central server registration outcome ----------------------------------------- enum ESvrRegResult { + // used for protocol -> enum values must be fixed! SRR_REGISTERED = 0, SRR_CENTRAL_SVR_FULL = 1 };