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 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 3.3.1

View file

@ -33,8 +33,8 @@ CClient::CClient ( const quint16 iPortNumber ) :
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_LEVELS, AUD_MIX_FADER_MAX ), vecStoredFaderLevels ( MAX_NUM_STORED_FADER_LEVELS, AUD_MIX_FADER_MAX ),
Channel ( false ), /* we need a client channel -> "false" */ Channel ( false ), /* we need a client channel -> "false" */
eAudioCompressionType ( CT_OPUS ), eAudioCompressionType ( CT_OPUS ),
iCeltNumCodedBytes ( CELT_NUM_BYTES_MONO_NORMAL_QUALITY ), iCeltNumCodedBytes ( CELT_NUM_BYTES_MONO_LOW_QUALITY ),
bCeltDoHighQuality ( false ), eAudioQuality ( AQ_LOW ),
bUseStereo ( false ), bUseStereo ( false ),
bIsInitializationPhase ( true ), bIsInitializationPhase ( true ),
Socket ( &Channel, iPortNumber ), 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 // init with new parameter, if client was running then first
// stop it and restart again after new initialization // stop it and restart again after new initialization
@ -435,7 +435,7 @@ void CClient::SetCELTHighQuality ( const bool bNCeltHighQualityFlag )
} }
// set new parameter // set new parameter
bCeltDoHighQuality = bNCeltHighQualityFlag; eAudioQuality = eNAudioQuality;
Init(); Init();
if ( bWasRunning ) if ( bWasRunning )
@ -744,29 +744,29 @@ void CClient::Init()
AudioReverbL.Init ( SYSTEM_SAMPLE_RATE_HZ ); AudioReverbL.Init ( SYSTEM_SAMPLE_RATE_HZ );
AudioReverbR.Init ( SYSTEM_SAMPLE_RATE_HZ ); AudioReverbR.Init ( SYSTEM_SAMPLE_RATE_HZ );
// inits for CELT coding // inits for audio coding
if ( bCeltDoHighQuality ) if ( eAudioCompressionType == CT_CELT )
{ {
if ( bUseStereo ) 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 else
{ {
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_HIGH_QUALITY; iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
} }
} }
else else
{ {
if ( eAudioCompressionType == CT_CELT ) if ( eAudioQuality == AQ_LOW )
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_HIGH_QUALITY; iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_LOW_QUALITY;
} }
else 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 ( bUseStereo )
{ {
if ( eAudioCompressionType == CT_CELT ) switch ( eAudioQuality )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
else
{ {
case AQ_LOW:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_LOW_QUALITY;
break;
case AQ_NORMAL:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY; iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY;
break;
case AQ_HIGH:
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_HIGH_QUALITY;
break;
} }
} }
else else
{ {
if ( eAudioCompressionType == CT_CELT ) switch ( eAudioQuality )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY;
}
else
{ {
case AQ_LOW:
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_LOW_QUALITY;
break;
case AQ_NORMAL:
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_NORMAL_QUALITY; 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 #define AUD_REVERB_MAX 100
// CELT number of coded bytes per audio packet // CELT number of coded bytes per audio packet
// 24: mono low/normal quality 156 kbps (128) / 114 kbps (256) // 24: mono low quality 156 kbps (128) / 114 kbps (256)
// 44: mono high quality 216 kbps (128) / 174 kbps (256) // 44: mono normal quality 216 kbps (128) / 174 kbps (256)
// NOTE: Must be > CELT_MINIMUM_NUM_BYTES (greater, not equal to!) // NOTE: Must be > CELT_MINIMUM_NUM_BYTES (greater, not equal to!)
#define CELT_NUM_BYTES_MONO_NORMAL_QUALITY 24 #define CELT_NUM_BYTES_MONO_LOW_QUALITY 24
#define CELT_NUM_BYTES_MONO_HIGH_QUALITY 44 #define CELT_NUM_BYTES_MONO_NORMAL_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
// 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 // OPUS number of coded bytes per audio packet
// TODO we have to use new numbers for OPUS to avoid that old CELT packets // 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) // Fs: sampling rate (SYSTEM_SAMPLE_RATE_HZ)
// L: number of samples per packet (SYSTEM_FRAME_SIZE_SAMPLES) // L: number of samples per packet (SYSTEM_FRAME_SIZE_SAMPLES)
// N: number of bytes per packet (values below) // 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_STEREO_LOW_QUALITY 47
#define OPUS_NUM_BYTES_MONO_HIGH_QUALITY 45 #define OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY 71
#define OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY 47 #define OPUS_NUM_BYTES_STEREO_HIGH_QUALITY 142
#define OPUS_NUM_BYTES_STEREO_HIGH_QUALITY 71
/* Classes ********************************************************************/ /* Classes ********************************************************************/
@ -115,10 +116,10 @@ public:
void SetOpenChatOnNewMessage ( const bool bNV ) { bOpenChatOnNewMessage = bNV; } void SetOpenChatOnNewMessage ( const bool bNV ) { bOpenChatOnNewMessage = bNV; }
EGUIDesign GetGUIDesign() const { return eGUIDesign; } EGUIDesign GetGUIDesign() const { return eGUIDesign; }
void SetGUIDesign ( const EGUIDesign bNGD ) { eGUIDesign = bNGD; } void SetGUIDesign ( const EGUIDesign eNGD ) { eGUIDesign = eNGD; }
bool GetCELTHighQuality() const { return bCeltDoHighQuality; } EAudioQuality GetAudioQuality() const { return eAudioQuality; }
void SetCELTHighQuality ( const bool bNCeltHighQualityFlag ); void SetAudioQuality ( const EAudioQuality eNAudioQuality );
bool GetUseStereo() const { return bUseStereo; } bool GetUseStereo() const { return bUseStereo; }
void SetUseStereo ( const bool bNUseStereo ); void SetUseStereo ( const bool bNUseStereo );
@ -303,7 +304,7 @@ void SetAudoCompressiontype ( const EAudComprType eNAudCompressionType );
OpusCustomDecoder* OpusDecoderStereo; OpusCustomDecoder* OpusDecoderStereo;
EAudComprType eAudioCompressionType; EAudComprType eAudioCompressionType;
int iCeltNumCodedBytes; int iCeltNumCodedBytes;
bool bCeltDoHighQuality; EAudioQuality eAudioQuality;
bool bUseStereo; bool bUseStereo;
bool bIsInitializationPhase; bool bIsInitializationPhase;
CVector<unsigned char> vecCeltData; CVector<unsigned char> vecCeltData;

View file

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

View file

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

View file

@ -212,10 +212,11 @@ void CSettings::Load()
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) ); pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) );
} }
// flag whether using high quality audio or not // audio quality
if ( GetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio", bValue ) ) 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 // flag whether stereo mode is used
@ -376,9 +377,9 @@ void CSettings::Save()
SetNumericIniSet ( IniXMLDocument, "client", "guidesign", SetNumericIniSet ( IniXMLDocument, "client", "guidesign",
static_cast<int> ( pClient->GetGUIDesign() ) ); static_cast<int> ( pClient->GetGUIDesign() ) );
// flag whether using high quality audio or not // audio quality
SetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio", SetNumericIniSet ( IniXMLDocument, "client", "audioquality",
pClient->GetCELTHighQuality() ); static_cast<int> ( pClient->GetAudioQuality() ) );
// flag whether stereo mode is used // flag whether stereo mode is used
SetFlagIniSet ( IniXMLDocument, "client", "stereoaudio", 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 -------------------------------------------------------- // Get data status enum --------------------------------------------------------
enum EGetDataStat enum EGetDataStat
{ {