diff --git a/src/client.h b/src/client.h index e467623f52..a43685edfe 100644 --- a/src/client.h +++ b/src/client.h @@ -121,7 +121,8 @@ class CClient : public QObject bool Connect ( QString strServerAddress, QString strServerName ); bool Disconnect(); - bool SoundIsRunning() const { return Sound.IsCallbackEntered(); } // For OnTimerCheckAudioDeviceOk only + bool IsRunning() { return Sound.IsRunning(); } + bool IsCallbackEntered() const { return Sound.IsCallbackEntered(); } // For OnTimerCheckAudioDeviceOk only bool IsConnected() { return Channel.IsConnected(); } double GetLevelForMeterdBLeft() { return SignalLevelMeter.GetLevelForMeterdBLeftOrMono(); } diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 811e83b427..08c6e8656b 100644 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -827,7 +827,7 @@ void CClientDlg::OnChatTextReceived ( QString strChatText ) // always when a new message arrives since this is annoying. ShowChatWindow ( ( strChatText.indexOf ( WELCOME_MESSAGE_PREFIX ) == 0 ) ); - UpdateSettingsAndChatButtons(); + UpdateDisplay(); } void CClientDlg::OnLicenceRequired ( ELicenceType eLicenceType ) @@ -982,7 +982,7 @@ void CClientDlg::ShowChatWindow ( const bool bForceRaise ) ChatDlg.activateWindow(); } - UpdateSettingsAndChatButtons(); + UpdateDisplay(); } void CClientDlg::ShowAnalyzerConsole() @@ -1132,7 +1132,7 @@ void CClientDlg::OnTimerCheckAudioDeviceOk() // timeout to check if a valid device is selected and if we do not have // fundamental settings errors (in which case the GUI would only show that // it is trying to connect the server which does not help to solve the problem (#129)) - if ( !pClient->SoundIsRunning() ) + if ( !pClient->IsCallbackEntered() ) { QMessageBox::warning ( this, APP_NAME, @@ -1220,7 +1220,7 @@ void CClientDlg::OnDisconnect() TimerDetectFeedback.stop(); bDetectFeedback = false; - UpdateSettingsAndChatButtons(); + UpdateDisplay(); // reset LEDs ledBuffers->Reset(); @@ -1238,7 +1238,7 @@ void CClientDlg::OnDisconnect() SetMixerBoardDeco ( RS_UNDEFINED, pClient->GetGUIDesign() ); } -void CClientDlg::UpdateSettingsAndChatButtons() +void CClientDlg::UpdateDisplay() { // update settings/chat buttons (do not fire signals since it is an update) if ( chbSettings->isChecked() && !ClientSettingsDlg.isVisible() ) diff --git a/src/clientdlg.h b/src/clientdlg.h index 12c65f7289..0e1166331c 100644 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -92,8 +92,8 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase void ShowChatWindow ( const bool bForceRaise = true ); void ShowAnalyzerConsole(); void UpdateAudioFaderSlider(); - void ManageDragNDrop ( QDropEvent* Event, const bool bCheckAccept ); void UpdateRevSelection(); + void ManageDragNDrop ( QDropEvent* Event, const bool bCheckAccept ); void SetPingTime ( const int iPingTime, const int iOverallDelayMs, const CMultiColorLED::ELightColor eOverallDelayLEDColor ); CClient* pClient; @@ -116,7 +116,7 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase virtual void closeEvent ( QCloseEvent* Event ); virtual void dragEnterEvent ( QDragEnterEvent* Event ) { ManageDragNDrop ( Event, true ); } virtual void dropEvent ( QDropEvent* Event ) { ManageDragNDrop ( Event, false ); } - void UpdateSettingsAndChatButtons(); + void UpdateDisplay(); CClientSettingsDlg ClientSettingsDlg; CChatDlg ChatDlg; @@ -132,7 +132,7 @@ public slots: void OnTimerCheckAudioDeviceOk(); void OnTimerDetectFeedback(); - void OnTimerStatus() { UpdateSettingsAndChatButtons(); } + void OnTimerStatus() { UpdateDisplay(); } void OnTimerPing(); void OnPingTimeResult ( int iPingTime ); diff --git a/src/main.cpp b/src/main.cpp index 5dc16ed57e..d8386e6b55 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -919,7 +919,13 @@ int main ( int argc, char** argv ) { // Client: // actual client object - CClient Client ( iPortNumber, iQosNumber, strMIDISetup, bNoAutoJackConnect, strClientName, bEnableIPv6, bMuteMeInPersonalMix ); + CClient Client ( iPortNumber, + iQosNumber, + strMIDISetup, + bNoAutoJackConnect, + strClientName, + bEnableIPv6, + bMuteMeInPersonalMix ); // load settings from init-file (command line options override) CClientSettings Settings ( &Client, strIniFileName ); @@ -943,8 +949,14 @@ int main ( int argc, char** argv ) } // GUI object - CClientDlg - ClientDlg ( &Client, &Settings, strMIDISetup, bShowComplRegConnList, bShowAnalyzerConsole, bMuteStream, bEnableIPv6, nullptr ); + CClientDlg ClientDlg ( &Client, + &Settings, + strMIDISetup, + bShowComplRegConnList, + bShowAnalyzerConsole, + bMuteStream, + bEnableIPv6, + nullptr ); // show dialog ClientDlg.show();