Skip to content

Commit

Permalink
Revert some changes for now
Browse files Browse the repository at this point in the history
  • Loading branch information
ann0see committed Sep 8, 2024
1 parent 38fb414 commit a5af8cc
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ void CClient::Init()
bFraSiFactSafeSupported = true;
#else
bFraSiFactPrefSupported = ( Sound.Init ( iFraSizePreffered ) == iFraSizePreffered );
bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault );
bFraSiFactDefSupported = ( Sound.Init ( iFraSizeDefault ) == iFraSizeDefault );
bFraSiFactSafeSupported = ( Sound.Init ( iFraSizeSafe ) == iFraSizeSafe );
#endif

Expand Down
6 changes: 4 additions & 2 deletions src/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,15 @@ class CClient : public QObject
bool Connect ( QString strServerAddress, QString strServerName );
bool Disconnect();

bool SoundIsRunning() const { return Sound.IsCallbackEntered(); } // For OnTimerCheckAudioDeviceOk only
bool IsConnected() { return Channel.IsConnected(); }
bool IsRunning() { return Sound.IsRunning(); }
bool IsCallbackEntered() const { return Sound.IsCallbackEntered(); } // For OnTimerCheckAudioDeviceOk only

double GetLevelForMeterdBLeft() { return SignalLevelMeter.GetLevelForMeterdBLeftOrMono(); }
double GetLevelForMeterdBRight() { return SignalLevelMeter.GetLevelForMeterdBRight(); }

bool GetAndResetbJitterBufferOKFlag();

bool IsConnected() { return Channel.IsConnected(); }

EGUIDesign GetGUIDesign() const { return eGUIDesign; }
void SetGUIDesign ( const EGUIDesign eNGD ) { eGUIDesign = eNGD; }
Expand Down
10 changes: 5 additions & 5 deletions src/clientdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -982,7 +982,7 @@ void CClientDlg::ShowChatWindow ( const bool bForceRaise )
ChatDlg.activateWindow();
}

UpdateSettingsAndChatButtons();
UpdateDisplay();
}

void CClientDlg::ShowAnalyzerConsole()
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -1220,7 +1220,7 @@ void CClientDlg::OnDisconnect()
TimerDetectFeedback.stop();
bDetectFeedback = false;

UpdateSettingsAndChatButtons();
UpdateDisplay();

// reset LEDs
ledBuffers->Reset();
Expand All @@ -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() )
Expand Down
6 changes: 3 additions & 3 deletions src/clientdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -132,7 +132,7 @@ public slots:
void OnTimerCheckAudioDeviceOk();
void OnTimerDetectFeedback();

void OnTimerStatus() { UpdateSettingsAndChatButtons(); }
void OnTimerStatus() { UpdateDisplay(); }

void OnTimerPing();
void OnPingTimeResult ( int iPingTime );
Expand Down
18 changes: 15 additions & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand All @@ -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();
Expand Down

0 comments on commit a5af8cc

Please sign in to comment.