Skip to content

Commit 413c871

Browse files
authored
Merge pull request #1762 from dcorson-ticino-com/master
Move ping/delay/jitter measurements from settings to main window
2 parents 8e700a0 + 34f653b commit 413c871

11 files changed

Lines changed: 505 additions & 561 deletions

Jamulus.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,6 +732,8 @@ DISTFILES += ChangeLog \
732732
src/res/IndicatorGreen.png \
733733
src/res/IndicatorYellow.png \
734734
src/res/IndicatorRed.png \
735+
src/res/IndicatorYellowFancy.png \
736+
src/res/IndicatorRedFancy.png \
735737
src/res/faderbackground.png \
736738
src/res/faderhandle.png \
737739
src/res/faderhandlesmall.png \
@@ -1130,3 +1132,4 @@ contains(CONFIG, "disable_version_check") {
11301132
}
11311133

11321134
ANDROID_ABIS = armeabi-v7a arm64-v8a x86 x86_64
1135+

src/clientdlg.cpp

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,34 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
181181

182182
ledBuffers->setAccessibleName ( tr ( "Buffers status LED indicator" ) );
183183

184+
// current connection status parameter
185+
QString strConnStats = "<b>" +
186+
tr ( "Current Connection Status "
187+
"Parameter" ) +
188+
":</b> " +
189+
tr ( "The Ping Time is the time required for the audio "
190+
"stream to travel from the client to the server and back again. This "
191+
"delay is introduced by the network and should be about "
192+
"20-30 ms. If this delay is higher than about 50 ms, your distance to "
193+
"the server is too large or your internet connection is not "
194+
"sufficient." ) +
195+
"<br>" +
196+
tr ( "Overall Delay is calculated from the current Ping Time and the "
197+
"delay introduced by the current buffer settings." );
198+
199+
lblPing->setWhatsThis ( strConnStats );
200+
lblPingVal->setWhatsThis ( strConnStats );
201+
lblDelay->setWhatsThis ( strConnStats );
202+
lblDelayVal->setWhatsThis ( strConnStats );
203+
ledDelay->setWhatsThis ( strConnStats );
204+
ledDelay->setToolTip ( tr ( "If this LED indicator turns red, "
205+
"you will not have much fun using the " ) +
206+
APP_NAME + tr ( " software." ) + TOOLTIP_COM_END_TEXT );
207+
lblPingVal->setText ( "---" );
208+
lblPingUnit->setText ( "" );
209+
lblDelayVal->setText ( "---" );
210+
lblDelayUnit->setText ( "" );
211+
184212
// init GUI design
185213
SetGUIDesign ( pClient->GetGUIDesign() );
186214

@@ -1035,7 +1063,6 @@ void CClientDlg::OnTimerBuffersLED()
10351063

10361064
// update the buffer LED and the general settings dialog, too
10371065
ledBuffers->SetLight ( eCurStatus );
1038-
ClientSettingsDlg.SetStatus ( eCurStatus );
10391066
}
10401067

10411068
void CClientDlg::OnTimerPing()
@@ -1073,8 +1100,9 @@ void CClientDlg::OnPingTimeResult ( int iPingTime )
10731100
if ( ClientSettingsDlg.isVisible() )
10741101
{
10751102
// set ping time result to general settings dialog
1076-
ClientSettingsDlg.SetPingTimeResult ( iPingTime, iOverallDelayMs, eOverallDelayLEDColor );
1103+
ClientSettingsDlg.UpdateUploadRate();
10771104
}
1105+
SetPingTime ( iPingTime, iOverallDelayMs, eOverallDelayLEDColor );
10781106

10791107
// update delay LED on the main window
10801108
ledDelay->SetLight ( eOverallDelayLEDColor );
@@ -1224,7 +1252,12 @@ OnTimerStatus();
12241252
// reset LEDs
12251253
ledBuffers->Reset();
12261254
ledDelay->Reset();
1227-
ClientSettingsDlg.ResetStatusAndPingLED();
1255+
1256+
// clear text labels with client parameters
1257+
lblPingVal->setText ( "---" );
1258+
lblPingUnit->setText ( "" );
1259+
lblDelayVal->setText ( "---" );
1260+
lblDelayUnit->setText ( "" );
12281261

12291262
// clear mixer board (remove all faders)
12301263
MainMixerBoard->HideAll();
@@ -1378,3 +1411,25 @@ void CClientDlg::SetMixerBoardDeco ( const ERecorderState newRecorderState, cons
13781411
}
13791412
}
13801413
}
1414+
1415+
void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, const CMultiColorLED::ELightColor eOverallDelayLEDColor )
1416+
{
1417+
// apply values to GUI labels, take special care if ping time exceeds
1418+
// a certain value
1419+
if ( iPingTime > 500 )
1420+
{
1421+
const QString sErrorText = "<font color=\"red\"><b>&#62;500</b></font>";
1422+
lblPingVal->setText ( sErrorText );
1423+
lblDelayVal->setText ( sErrorText );
1424+
}
1425+
else
1426+
{
1427+
lblPingVal->setText ( QString().setNum ( iPingTime ) );
1428+
lblDelayVal->setText ( QString().setNum ( iOverallDelayMs ) );
1429+
}
1430+
lblPingUnit->setText ( "ms" );
1431+
lblDelayUnit->setText ( "ms" );
1432+
1433+
// set current LED status
1434+
ledDelay->SetLight ( eOverallDelayLEDColor );
1435+
}

src/clientdlg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class CClientDlg : public CBaseDlg, private Ui_CClientDlgBase
9595
void Connect ( const QString& strSelectedAddress, const QString& strMixerBoardLabel );
9696
void Disconnect();
9797
void ManageDragNDrop ( QDropEvent* Event, const bool bCheckAccept );
98+
void SetPingTime ( const int iPingTime, const int iOverallDelayMs, const CMultiColorLED::ELightColor eOverallDelayLEDColor );
9899

99100
CClient* pClient;
100101
CClientSettings* pSettings;

0 commit comments

Comments
 (0)