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,54 +744,66 @@ 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;
}
}
else
{
if ( eAudioCompressionType == CT_CELT )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_HIGH_QUALITY;
}
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_MONO_HIGH_QUALITY;
}
}
}
else
{
if ( bUseStereo )
{
if ( eAudioCompressionType == CT_CELT )
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY; iCeltNumCodedBytes = CELT_NUM_BYTES_STEREO_NORMAL_QUALITY;
} }
else
{
iCeltNumCodedBytes = OPUS_NUM_BYTES_STEREO_NORMAL_QUALITY;
}
} }
else else
{ {
if ( eAudioCompressionType == CT_CELT ) if ( eAudioQuality == AQ_LOW )
{
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_LOW_QUALITY;
}
else
{ {
iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY; iCeltNumCodedBytes = CELT_NUM_BYTES_MONO_NORMAL_QUALITY;
} }
}
}
else else
{ {
if ( bUseStereo )
{
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
{
switch ( eAudioQuality )
{
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,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>CClientSettingsDlgBase</class> <class>CClientSettingsDlgBase</class>
<widget class="QDialog" name="CClientSettingsDlgBase"> <widget class="QDialog" name="CClientSettingsDlgBase">
@ -13,7 +14,8 @@
<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>
@ -35,7 +37,7 @@
<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>
@ -51,7 +53,7 @@
<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>
@ -63,16 +65,7 @@
<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>
@ -92,7 +85,7 @@
<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>
@ -105,7 +98,7 @@
<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>
@ -149,7 +142,7 @@
<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>
@ -162,7 +155,7 @@
<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>
@ -197,7 +190,7 @@
<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>
@ -347,21 +340,6 @@
</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">
@ -370,7 +348,7 @@
<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>
@ -399,7 +377,7 @@
<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>
@ -432,7 +410,7 @@
<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,9 +419,9 @@
</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>
@ -470,7 +448,7 @@
<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>
@ -488,7 +466,7 @@
<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">
@ -503,26 +481,27 @@
</property> </property>
</widget> </widget>
</item> </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> <item>
<widget class="QCheckBox" name="chbUseStereo"> <widget class="QCheckBox" name="chbUseStereo">
<property name="windowModality" >
<enum>Qt::NonModal</enum>
</property>
<property name="text"> <property name="text">
<string>Stereo Streaming</string> <string>Stereo Streaming</string>
</property> </property>
</widget> </widget>
</item> </item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<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> <item>
<layout class="QHBoxLayout"> <layout class="QHBoxLayout">
<item> <item>
@ -544,7 +523,7 @@
<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>
@ -556,7 +535,7 @@
<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>
@ -600,7 +579,7 @@
<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>
@ -635,7 +614,7 @@
<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>
@ -652,9 +631,9 @@
</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>
@ -704,7 +683,6 @@
<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>

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