Support for three audio quality settings (a new high quality rate is introduced)

This commit is contained in:
Volker Fischer 2013-08-15 19:15:01 +00:00
parent 2856626523
commit c22c264123
8 changed files with 287 additions and 284 deletions

View File

@ -6,6 +6,8 @@ TODO: This feature is disabled for now since it does not work as expected (we
DISABLED: - the connection setup dialog can now be opened during a connection
- support for three audio quality settings: low, normal and high
3.3.1

View File

@ -33,8 +33,8 @@ CClient::CClient ( const quint16 iPortNumber ) :
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_LEVELS, AUD_MIX_FADER_MAX ),
Channel ( false ), /* we need a client channel -> "false" */
eAudioCompressionType ( CT_OPUS ),
iCeltNumCodedBytes ( CELT_NUM_BYTES_MONO_NORMAL_QUALITY ),
bCeltDoHighQuality ( false ),
iCeltNumCodedBytes ( CELT_NUM_BYTES_MONO_LOW_QUALITY ),
eAudioQuality ( AQ_LOW ),
bUseStereo ( false ),
bIsInitializationPhase ( true ),
Socket ( &Channel, iPortNumber ),
@ -424,7 +424,7 @@ void CClient::SetAudoCompressiontype ( const EAudComprType eNAudCompressionType
}
}
void CClient::SetCELTHighQuality ( const bool bNCeltHighQualityFlag )
void CClient::SetAudioQuality ( const EAudioQuality eNAudioQuality )
{
// init with new parameter, if client was running then first
// stop it and restart again after new initialization
@ -435,7 +435,7 @@ void CClient::SetCELTHighQuality ( const bool bNCeltHighQualityFlag )
}
// set new parameter
bCeltDoHighQuality = bNCeltHighQualityFlag;
eAudioQuality = eNAudioQuality;
Init();
if ( bWasRunning )
@ -744,29 +744,29 @@ void CClient::Init()
AudioReverbL.Init ( SYSTEM_SAMPLE_RATE_HZ );
AudioReverbR.Init ( SYSTEM_SAMPLE_RATE_HZ );
// inits for CELT coding
if ( bCeltDoHighQuality )
// inits for audio coding
if ( eAudioCompressionType == CT_CELT )
{
if ( bUseStereo )
{
if ( eAudioCompressionType == CT_CELT )
if ( eAudioQuality == AQ_LOW )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_HIGH_QUALITY;
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_LOW_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_HIGH_QUALITY;
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
}
else
{
if ( eAudioCompressionType == CT_CELT )
if ( eAudioQuality == AQ_LOW )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_HIGH_QUALITY;
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_LOW_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_HIGH_QUALITY;
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY;
}
}
}
@ -774,24 +774,36 @@ void CClient::Init()
{
if ( bUseStereo )
{
if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
else
switch ( eAudioQuality )
{
case AQ_LOW:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_LOW_QUALITY;
break;
case AQ_NORMAL:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY;
break;
case AQ_HIGH:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_HIGH_QUALITY;
break;
}
}
else
{
if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY;
}
else
switch ( eAudioQuality )
{
case AQ_LOW:
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_LOW_QUALITY;
break;
case AQ_NORMAL:
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_NORMAL_QUALITY;
break;
case AQ_HIGH:
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_HIGH_QUALITY;
break;
}
}
}

View File

@ -65,17 +65,16 @@
#define AUD_REVERB_MAX 100
// CELT number of coded bytes per audio packet
// 24: mono low/normal quality 156 kbps (128) / 114 kbps (256)
// 44: mono high quality 216 kbps (128) / 174 kbps (256)
// 24: mono low quality 156 kbps (128) / 114 kbps (256)
// 44: mono normal quality 216 kbps (128) / 174 kbps (256)
// NOTE: Must be > CELT_MINIMUM_NUM_BYTES (greater, not equal to!)
#define CELT_NUM_BYTES_MONO_NORMAL_QUALITY 24
#define CELT_NUM_BYTES_MONO_HIGH_QUALITY 44
// 46: stereo low/normal quality 222 kbps (128) / 180 kbps (256)
// 70: stereo high quality 294 kbps (128) / 252 kbps (256)
#define CELT_NUM_BYTES_STEREO_NORMAL_QUALITY 46
#define CELT_NUM_BYTES_STEREO_HIGH_QUALITY 70
#define CELT_NUM_BYTES_MONO_LOW_QUALITY 24
#define CELT_NUM_BYTES_MONO_NORMAL_QUALITY 44
// 46: stereo low quality 222 kbps (128) / 180 kbps (256)
// 70: stereo normal quality 294 kbps (128) / 252 kbps (256)
#define CELT_NUM_BYTES_STEREO_LOW_QUALITY 46
#define CELT_NUM_BYTES_STEREO_NORMAL_QUALITY 70
// OPUS number of coded bytes per audio packet
// TODO we have to use new numbers for OPUS to avoid that old CELT packets
@ -88,11 +87,13 @@
// Fs: sampling rate (SYSTEM_SAMPLE_RATE_HZ)
// L: number of samples per packet (SYSTEM_FRAME_SIZE_SAMPLES)
// N: number of bytes per packet (values below)
#define OPUS_NUM_BYTES_MONO_LOW_QUALITY 25
#define OPUS_NUM_BYTES_MONO_NORMAL_QUALITY 45
#define OPUS_NUM_BYTES_MONO_HIGH_QUALITY 71
#define OPUS_NUM_BYTES_MONO_NORMAL_QUALITY 25
#define OPUS_NUM_BYTES_MONO_HIGH_QUALITY 45
#define OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY 47
#define OPUS_NUM_BYTES_STEREO_HIGH_QUALITY 71
#define OPUS_NUM_BYTES_STEREO_LOW_QUALITY 47
#define OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY 71
#define OPUS_NUM_BYTES_STEREO_HIGH_QUALITY 142
/* Classes ********************************************************************/
@ -115,10 +116,10 @@ public:
void SetOpenChatOnNewMessage ( const bool bNV ) { bOpenChatOnNewMessage = bNV; }
EGUIDesign GetGUIDesign() const { return eGUIDesign; }
void SetGUIDesign ( const EGUIDesign bNGD ) { eGUIDesign = bNGD; }
void SetGUIDesign ( const EGUIDesign eNGD ) { eGUIDesign = eNGD; }
bool GetCELTHighQuality() const { return bCeltDoHighQuality; }
void SetCELTHighQuality ( const bool bNCeltHighQualityFlag );
EAudioQuality GetAudioQuality() const { return eAudioQuality; }
void SetAudioQuality ( const EAudioQuality eNAudioQuality );
bool GetUseStereo() const { return bUseStereo; }
void SetUseStereo ( const bool bNUseStereo );
@ -303,7 +304,7 @@ void SetAudoCompressiontype ( const EAudComprType eNAudCompressionType );
OpusCustomDecoder* OpusDecoderStereo;
EAudComprType eAudioCompressionType;
int iCeltNumCodedBytes;
bool bCeltDoHighQuality;
EAudioQuality eAudioQuality;
bool bUseStereo;
bool bIsInitializationPhase;
CVector<unsigned char> vecCeltData;

View File

@ -192,15 +192,17 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
chbGUIDesignFancy->setAccessibleName ( tr ( "Fancy skin check box" ) );
// use high quality audio
chbUseHighQualityAudio->setWhatsThis ( tr ( "<b>Use High Quality Audio:</b> "
"If enabled, it will improve the audio quality "
"by increasing the audio stream data rate. Make sure that the current "
// audio quality
QString strAudioQuality = tr ( "<b>Audio Quality:</b> "
"Select the desired audio quality. A low, normal or high audio "
"quality can be selected. The higher the audio quality, the higher "
"the audio stream data rate. Make sure that the current "
"upload rate does not exceed the available bandwidth of your "
"internet connection." ) );
"internet connection." );
chbUseHighQualityAudio->setAccessibleName ( tr ( "Use high quality audio "
"check box" ) );
lblAudioQuality->setWhatsThis ( strAudioQuality );
cbxAudioQuality->setWhatsThis ( strAudioQuality );
cbxAudioQuality->setAccessibleName ( tr ( "Audio quality combo box" ) );
// use stereo
chbUseStereo->setWhatsThis ( tr ( "<b>Stereo Streaming</b> "
@ -311,15 +313,12 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
chbGUIDesignFancy->setCheckState ( Qt::Checked );
}
// "High Quality Audio" check box
if ( pClient->GetCELTHighQuality() )
{
chbUseHighQualityAudio->setCheckState ( Qt::Checked );
}
else
{
chbUseHighQualityAudio->setCheckState ( Qt::Unchecked );
}
// "Audio Quality" combo box
cbxAudioQuality->clear();
cbxAudioQuality->addItem ( "Low" ); // AQ_LOW
cbxAudioQuality->addItem ( "Normal" ); // AQ_NORMAL
cbxAudioQuality->addItem ( "High" ); // AQ_HIGH
cbxAudioQuality->setCurrentIndex ( static_cast<int> ( pClient->GetAudioQuality() ) );
// "Stereo" check box
if ( pClient->GetUseStereo() )
@ -380,9 +379,6 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
QObject::connect ( chbGUIDesignFancy, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnGUIDesignFancyStateChanged ( int ) ) );
QObject::connect ( chbUseHighQualityAudio, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnUseHighQualityAudioStateChanged ( int ) ) );
QObject::connect ( chbUseStereo, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnUseStereoStateChanged ( int ) ) );
@ -412,6 +408,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
QObject::connect ( cbxROutChan, SIGNAL ( activated ( int ) ),
this, SLOT ( OnROutChanActivated ( int ) ) );
QObject::connect ( cbxAudioQuality, SIGNAL ( activated ( int ) ),
this, SLOT ( OnAudioQualityActivated ( int ) ) );
// buttons
QObject::connect ( butDriverSetup, SIGNAL ( clicked() ),
this, SLOT ( OnDriverSetupClicked() ) );
@ -631,6 +630,12 @@ void CClientSettingsDlg::OnROutChanActivated ( int iChanIdx )
UpdateSoundChannelSelectionFrame();
}
void CClientSettingsDlg::OnAudioQualityActivated ( int iQualityIdx )
{
pClient->SetAudioQuality ( static_cast<EAudioQuality> ( iQualityIdx ) );
UpdateDisplay(); // upload rate will be changed
}
void CClientSettingsDlg::OnAutoJitBufStateChanged ( int value )
{
pClient->SetDoAutoSockBufSize ( value == Qt::Checked );
@ -657,12 +662,6 @@ void CClientSettingsDlg::OnGUIDesignFancyStateChanged ( int value )
UpdateDisplay();
}
void CClientSettingsDlg::OnUseHighQualityAudioStateChanged ( int value )
{
pClient->SetCELTHighQuality ( value == Qt::Checked );
UpdateDisplay(); // upload rate will be changed
}
void CClientSettingsDlg::OnUseStereoStateChanged ( int value )
{
pClient->SetUseStereo ( value == Qt::Checked );

View File

@ -83,7 +83,6 @@ protected:
void OnAutoJitBufStateChanged ( int value );
void OnOpenChatOnNewMessageStateChanged ( int value );
void OnGUIDesignFancyStateChanged ( int value );
void OnUseHighQualityAudioStateChanged ( int value );
void OnUseStereoStateChanged ( int value );
void OnDefaultCentralServerStateChanged ( int value );
void OnCentralServerAddressEditingFinished();
@ -93,6 +92,7 @@ protected:
void OnRInChanActivated ( int iChanIdx );
void OnLOutChanActivated ( int iChanIdx );
void OnROutChanActivated ( int iChanIdx );
void OnAudioQualityActivated ( int iQualityIdx );
void OnDriverSetupClicked();
signals:

View File

@ -1,7 +1,8 @@
<ui version="4.0" >
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CClientSettingsDlgBase</class>
<widget class="QDialog" name="CClientSettingsDlgBase" >
<property name="geometry" >
<widget class="QDialog" name="CClientSettingsDlgBase">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
@ -9,38 +10,39 @@
<height>351</height>
</rect>
</property>
<property name="windowTitle" >
<property name="windowTitle">
<string>General Settings</string>
</property>
<property name="windowIcon" >
<iconset resource="resources.qrc" >:/png/main/res/mainicon.png</iconset>
<property name="windowIcon">
<iconset resource="resources.qrc">
<normaloff>:/png/main/res/mainicon.png</normaloff>:/png/main/res/mainicon.png</iconset>
</property>
<property name="sizeGripEnabled" >
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QGroupBox" name="grbSoundCard" >
<property name="title" >
<widget class="QGroupBox" name="grbSoundCard">
<property name="title">
<string>Soundcard</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lblSoundcardDevice" >
<property name="text" >
<widget class="QLabel" name="lblSoundcardDevice">
<property name="text">
<string>Device</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbxSoundcard" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<widget class="QComboBox" name="cbxSoundcard">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>153</width>
<height>0</height>
@ -49,68 +51,59 @@
</widget>
</item>
<item>
<widget class="QFrame" name="FrameSoundcardChannelSelection" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
<widget class="QFrame" name="FrameSoundcardChannelSelection">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="frameShape" >
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow" >
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" >
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<layout class="QVBoxLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="lblInChannelMapping" >
<property name="text" >
<widget class="QLabel" name="lblInChannelMapping">
<property name="text">
<string>Input Channel Mapping</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lblLInChan" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<widget class="QLabel" name="lblLInChan">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<property name="text">
<string>L</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblRInChan" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<widget class="QLabel" name="lblRInChan">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<property name="text">
<string>R</string>
</property>
</widget>
@ -118,56 +111,56 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QComboBox" name="cbxLInChan" />
<widget class="QComboBox" name="cbxLInChan"/>
</item>
<item>
<widget class="QComboBox" name="cbxRInChan" />
<widget class="QComboBox" name="cbxRInChan"/>
</item>
</layout>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="lblOutChannelMapping" >
<property name="text" >
<widget class="QLabel" name="lblOutChannelMapping">
<property name="text">
<string>Output Channel Mapping</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QLabel" name="lblLOutChan" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<widget class="QLabel" name="lblLOutChan">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<property name="text">
<string>L</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblROutChan" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
<widget class="QLabel" name="lblROutChan">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<property name="text">
<string>R</string>
</property>
</widget>
@ -175,15 +168,15 @@
</layout>
</item>
<item>
<layout class="QVBoxLayout" >
<property name="spacing" >
<layout class="QVBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QComboBox" name="cbxLOutChan" />
<widget class="QComboBox" name="cbxLOutChan"/>
</item>
<item>
<widget class="QComboBox" name="cbxROutChan" />
<widget class="QComboBox" name="cbxROutChan"/>
</item>
</layout>
</item>
@ -194,10 +187,10 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>153</width>
<height>0</height>
@ -206,38 +199,38 @@
</spacer>
</item>
<item>
<widget class="QGroupBox" name="grbSoundCrdBufDelay" >
<property name="title" >
<widget class="QGroupBox" name="grbSoundCrdBufDelay">
<property name="title">
<string>Buffer Delay</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QRadioButton" name="rbtBufferDelayPreferred" >
<property name="text" >
<widget class="QRadioButton" name="rbtBufferDelayPreferred">
<property name="text">
<string>(preferred)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbtBufferDelayDefault" >
<property name="text" >
<widget class="QRadioButton" name="rbtBufferDelayDefault">
<property name="text">
<string>(default)</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="rbtBufferDelaySafe" >
<property name="text" >
<widget class="QRadioButton" name="rbtBufferDelaySafe">
<property name="text">
<string>(safe)</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="butDriverSetup" >
<property name="text" >
<widget class="QPushButton" name="butDriverSetup">
<property name="text">
<string>Driver Setup</string>
</property>
<property name="autoDefault" >
<property name="autoDefault">
<bool>false</bool>
</property>
</widget>
@ -249,54 +242,54 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="grbJitterBuffer" >
<property name="title" >
<widget class="QGroupBox" name="grbJitterBuffer">
<property name="title">
<string>Jitter Buffer</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout">
<item>
<widget class="QCheckBox" name="chbAutoJitBuf" >
<property name="text" >
<widget class="QCheckBox" name="chbAutoJitBuf">
<property name="text">
<string>Auto</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblNetBufLabel" >
<property name="minimumSize" >
<widget class="QLabel" name="lblNetBufLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Local</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblNetBufServerLabel" >
<property name="minimumSize" >
<widget class="QLabel" name="lblNetBufServerLabel">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Server</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
@ -304,41 +297,41 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblNetBuf" >
<property name="minimumSize" >
<widget class="QLabel" name="lblNetBuf">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Size</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblNetBufServer" >
<property name="minimumSize" >
<widget class="QLabel" name="lblNetBufServer">
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>Size</string>
</property>
<property name="alignment" >
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<property name="wordWrap" >
<property name="wordWrap">
<bool>false</bool>
</property>
</widget>
@ -346,31 +339,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<number>6</number>
</property>
<property name="leftMargin" >
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number>
</property>
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@ -379,27 +357,27 @@
</spacer>
</item>
<item>
<widget class="QSlider" name="sldNetBuf" >
<property name="pageStep" >
<widget class="QSlider" name="sldNetBuf">
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="tickPosition" >
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@ -408,14 +386,14 @@
</spacer>
</item>
<item>
<widget class="QSlider" name="sldNetBufServer" >
<property name="pageStep" >
<widget class="QSlider" name="sldNetBufServer">
<property name="pageStep">
<number>1</number>
</property>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="tickPosition" >
<property name="tickPosition">
<enum>QSlider::TicksBothSides</enum>
</property>
</widget>
@ -423,16 +401,16 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@ -441,20 +419,20 @@
</spacer>
</item>
<item>
<widget class="CMultiColorLED" native="1" name="ledNetw" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="CMultiColorLED" name="ledNetw" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
@ -464,13 +442,13 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType" >
<property name="sizeType">
<enum>QSizePolicy::Minimum</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>0</width>
<height>0</height>
@ -484,57 +462,58 @@
</widget>
</item>
<item>
<widget class="QGroupBox" name="grbMeasureResults" >
<property name="title" >
<widget class="QGroupBox" name="grbMeasureResults">
<property name="title">
<string>Misc</string>
</property>
<layout class="QVBoxLayout" >
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="chbOpenChatOnNewMessage" >
<property name="text" >
<widget class="QCheckBox" name="chbOpenChatOnNewMessage">
<property name="text">
<string>Open Chat on New Message</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbGUIDesignFancy" >
<property name="text" >
<widget class="QCheckBox" name="chbGUIDesignFancy">
<property name="text">
<string>Fancy Skin</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbUseHighQualityAudio" >
<property name="windowModality" >
<enum>Qt::NonModal</enum>
</property>
<property name="text" >
<string>Use High Quality Audio</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbUseStereo" >
<property name="windowModality" >
<enum>Qt::NonModal</enum>
</property>
<property name="text" >
<widget class="QCheckBox" name="chbUseStereo">
<property name="text">
<string>Stereo Streaming</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="lblCentralServerAddress" >
<property name="text" >
<widget class="QLabel" name="lblAudioQuality">
<property name="text">
<string>Audio Quality</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbxAudioQuality"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblCentralServerAddress">
<property name="text">
<string>Central Server Address:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbDefaultCentralServer" >
<property name="text" >
<widget class="QCheckBox" name="chbDefaultCentralServer">
<property name="text">
<string>Default</string>
</property>
</widget>
@ -542,9 +521,9 @@
</layout>
</item>
<item>
<widget class="QLineEdit" name="edtCentralServerAddress" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Expanding" >
<widget class="QLineEdit" name="edtCentralServerAddress">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
@ -553,10 +532,10 @@
</item>
<item>
<spacer>
<property name="orientation" >
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<property name="sizeHint" stdset="0">
<size>
<width>201</width>
<height>21</height>
@ -565,23 +544,23 @@
</spacer>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblUpstream" >
<property name="text" >
<widget class="QLabel" name="lblUpstream">
<property name="text">
<string>Audio Stream Rate</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblUpstreamValue" >
<property name="minimumSize" >
<widget class="QLabel" name="lblUpstreamValue">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>val</string>
</property>
</widget>
@ -589,29 +568,29 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblPingTime" >
<property name="text" >
<widget class="QLabel" name="lblPingTime">
<property name="text">
<string>Ping Time</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblPingTimeValue" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<widget class="QLabel" name="lblPingTimeValue">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>val</string>
</property>
</widget>
@ -619,53 +598,53 @@
</layout>
</item>
<item>
<layout class="QHBoxLayout" >
<layout class="QHBoxLayout">
<item>
<widget class="QLabel" name="lblOverallDelay" >
<property name="text" >
<widget class="QLabel" name="lblOverallDelay">
<property name="text">
<string>Overall Delay</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" >
<property name="spacing" >
<layout class="QHBoxLayout">
<property name="spacing">
<number>3</number>
</property>
<item>
<widget class="QLabel" name="lblOverallDelayValue" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Maximum" hsizetype="Preferred" >
<widget class="QLabel" name="lblOverallDelayValue">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>50</width>
<height>20</height>
</size>
</property>
<property name="text" >
<property name="text">
<string>val</string>
</property>
</widget>
</item>
<item>
<widget class="CMultiColorLED" native="1" name="ledOverallDelay" >
<property name="sizePolicy" >
<sizepolicy vsizetype="Fixed" hsizetype="Fixed" >
<widget class="CMultiColorLED" name="ledOverallDelay" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize" >
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize" >
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
@ -704,13 +683,12 @@
<tabstop>sldNetBufServer</tabstop>
<tabstop>chbOpenChatOnNewMessage</tabstop>
<tabstop>chbGUIDesignFancy</tabstop>
<tabstop>chbUseHighQualityAudio</tabstop>
<tabstop>chbUseStereo</tabstop>
<tabstop>chbDefaultCentralServer</tabstop>
<tabstop>edtCentralServerAddress</tabstop>
</tabstops>
<resources>
<include location="resources.qrc" />
<include location="resources.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -212,10 +212,11 @@ void CSettings::Load()
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) );
}
// flag whether using high quality audio or not
if ( GetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio", bValue ) )
// audio quality
if ( GetNumericIniSet ( IniXMLDocument, "client", "audioquality",
0, 2 /* AQ_HIGH */, iValue ) )
{
pClient->SetCELTHighQuality ( bValue );
pClient->SetAudioQuality ( static_cast<EAudioQuality> ( iValue ) );
}
// flag whether stereo mode is used
@ -376,9 +377,9 @@ void CSettings::Save()
SetNumericIniSet ( IniXMLDocument, "client", "guidesign",
static_cast<int> ( pClient->GetGUIDesign() ) );
// flag whether using high quality audio or not
SetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio",
pClient->GetCELTHighQuality() );
// audio quality
SetNumericIniSet ( IniXMLDocument, "client", "audioquality",
static_cast<int> ( pClient->GetAudioQuality() ) );
// flag whether stereo mode is used
SetFlagIniSet ( IniXMLDocument, "client", "stereoaudio",

View File

@ -450,6 +450,16 @@ enum EAudComprType
};
// Audio quality enum ----------------------------------------------------------
enum EAudioQuality
{
// used for settings and the comobo box index -> enum values must be fixed!
AQ_LOW = 0,
AQ_NORMAL = 1,
AQ_HIGH = 2
};
// Get data status enum --------------------------------------------------------
enum EGetDataStat
{