better behaviour of ping and overall delay displays for large delays
This commit is contained in:
parent
f84b9673bd
commit
b38b8c01a7
4 changed files with 36 additions and 9 deletions
|
@ -108,7 +108,7 @@ fflush(pFileBI);
|
|||
const int iRemSpace = iPutPos + iInSize - iMemSize;
|
||||
|
||||
// data must be written in two steps because of wrap around
|
||||
while (iPutPos < iMemSize)
|
||||
while ( iPutPos < iMemSize )
|
||||
{
|
||||
vecdMemory[iPutPos++] = vecdData[iCurPos++];
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ fflush(pFileBI);
|
|||
|
||||
bool CNetBuf::Get ( CVector<double>& vecdData )
|
||||
{
|
||||
bool bGetOK = true; // init return value
|
||||
bool bGetOK = true; // init return value
|
||||
bool bFadeOutExtrap = false;
|
||||
|
||||
// get size of data to be get from the buffer
|
||||
|
|
|
@ -31,7 +31,7 @@ CClient::CClient ( const quint16 iPortNumber ) : bRun ( false ),
|
|||
Sound ( MIN_SND_CRD_BLOCK_SIZE_SAMPLES * 2 /* stereo */ ),
|
||||
Socket ( &Channel, iPortNumber ),
|
||||
iAudioInFader ( AUD_FADER_IN_MAX / 2 ),
|
||||
iReverbLevel ( AUD_REVERB_MAX / 6 ),
|
||||
iReverbLevel ( 0 ),
|
||||
bReverbOnLeftChan ( false ),
|
||||
iNetwBufSizeFactIn ( DEF_NET_BLOCK_SIZE_FACTOR ),
|
||||
strIPAddress ( "" ), strName ( "" ),
|
||||
|
@ -213,7 +213,7 @@ void CClient::run()
|
|||
// Set thread priority (The working thread should have a higher
|
||||
// priority than the GUI)
|
||||
#ifdef _WIN32
|
||||
SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL );
|
||||
SetThreadPriority ( GetCurrentThread(), THREAD_PRIORITY_HIGHEST );
|
||||
#else
|
||||
/*
|
||||
// set the process to realtime privs, taken from
|
||||
|
|
|
@ -340,10 +340,19 @@ void CClientSettingsDlg::OnPingTimeResult ( int iPingTime )
|
|||
|
||||
const int iOverallDelay = iTotalBufferDelay + iPingTime;
|
||||
|
||||
// apply values to GUI labels
|
||||
TextLabelPingTime->setText ( QString().setNum ( iPingTime ) + " ms" );
|
||||
// apply values to GUI labels, take special care if ping time exceeds
|
||||
// a certain value
|
||||
TextLabelBufferDelay->setText ( QString().setNum ( iTotalBufferDelay ) + " ms" );
|
||||
TextLabelOverallDelay->setText ( QString().setNum ( iOverallDelay ) + " ms" );
|
||||
if ( iPingTime > 500 )
|
||||
{
|
||||
TextLabelPingTime->setText ( "<font color=""red""><b>>500 ms</b></font>" );
|
||||
TextLabelOverallDelay->setText ( "<font color=""red""><b>>500 ms</b></font>" );
|
||||
}
|
||||
else
|
||||
{
|
||||
TextLabelPingTime->setText ( QString().setNum ( iPingTime ) + " ms" );
|
||||
TextLabelOverallDelay->setText ( QString().setNum ( iOverallDelay ) + " ms" );
|
||||
}
|
||||
|
||||
// color definition: < 40 ms green, < 60 ms yellow, otherwise red
|
||||
if ( iOverallDelay <= 40 )
|
||||
|
|
|
@ -813,6 +813,12 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelBufferDelay" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
|
@ -862,9 +868,15 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelPingTime" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>40</width>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
@ -913,9 +925,15 @@
|
|||
<layout class="QHBoxLayout" >
|
||||
<item>
|
||||
<widget class="QLabel" name="TextLabelOverallDelay" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize" >
|
||||
<size>
|
||||
<width>45</width>
|
||||
<width>50</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue