added fancy GUI design

This commit is contained in:
Volker Fischer 2009-09-19 08:28:24 +00:00
parent c22d5a95f6
commit 1474ca5ced
18 changed files with 262 additions and 37 deletions

View file

@ -97,6 +97,12 @@ llcon_SOURCES = ../src/buffer.cpp \
../libs/celt/stack_alloc.h \
../libs/celt/vq.h \
../src/resources.qrc \
../src/res/faderbackground.png \
../src/res/faderhandle.png \
../src/res/faderhandlesmall.png \
../src/res/ledbuttonnotpressed.png \
../src/res/ledbuttonpressed.png \
../src/res/mixerboardbackground.png \
../src/res/gig.png \
../src/res/mainicon.png \
../src/res/CLEDBlack.png \

View file

@ -38,15 +38,6 @@ CChannelFader::CChannelFader ( QWidget* pNW,
pcbSolo = new QCheckBox ( "Solo", pNW );
pLabel = new QLabel ( "", pNW );
/*
// TEST custom slider made of custom bitmaps
pFader->setStyleSheet (
"QSlider::groove { image: url(:/png/LEDs/res/CLEDYellowSmall.png) }"
"QSlider::handle { image: url(:/png/fader/res/faderhandle.png) }" );
*/
// setup layout
pMainGrid->setSpacing ( 2 );
@ -57,27 +48,12 @@ pFader->setStyleSheet (
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
// setup fader tag label (use white background of label)
QPalette newPalette = pLabel->palette();
newPalette.setColor ( QPalette::Active, QPalette::Window,
newPalette.color ( QPalette::Active, QPalette::Base ) );
newPalette.setColor ( QPalette::Disabled, QPalette::Window,
newPalette.color ( QPalette::Disabled, QPalette::Base ) );
newPalette.setColor ( QPalette::Inactive, QPalette::Window,
newPalette.color ( QPalette::Inactive, QPalette::Base ) );
pLabel->setPalette ( newPalette );
pLabel->setAutoFillBackground ( true );
pLabel->setFrameShape ( QFrame::Box );
// do not allow HTML tags, align center and use some margin
pLabel->setTextFormat ( Qt::PlainText );
pLabel->setAlignment ( Qt::AlignHCenter );
pLabel->setMargin ( 3 );
// set bold text
QFont curFont = pLabel->font();
curFont.setBold ( true );
pLabel->setFont ( curFont );
pLabel->setStyleSheet (
"QLabel { border: 2px solid black;"
" border-radius: 4px;"
" padding: 1px;"
" background-color: white;"
" font: bold; }" );
// add user controls to grid
pMainGrid->addWidget( pFader, 0, Qt::AlignHCenter );
@ -120,6 +96,54 @@ pFader->setStyleSheet (
this, SIGNAL ( soloStateChanged ( int ) ) );
}
void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
{
switch ( eNewDesign )
{
case GD_ORIGINAL:
// fader
pFader->setStyleSheet (
"QSlider { background-image: url(:/png/fader/res/faderbackground.png);"
" width: 45px; }"
"QSlider::groove { image: url(); }"
"QSlider::handle { image: url(:/png/fader/res/faderhandle.png); }" );
// mute button
pcbMute->setStyleSheet (
"QCheckBox::indicator { width: 43px;"
" height: 24px; }"
"QCheckBox::indicator:unchecked {"
" image: url(:/png/fader/res/ledbuttonnotpressed.png); }"
"QCheckBox::indicator:checked {"
" image: url(:/png/fader/res/ledbuttonpressed.png); }"
"QCheckBox { color: rgb(148, 148, 148);"
" font: bold; }" );
pcbMute->setText ( "MUTE" );
// solo button
pcbSolo->setStyleSheet (
"QCheckBox::indicator { width: 43px;"
" height: 24px; }"
"QCheckBox::indicator:unchecked {"
" image: url(:/png/fader/res/ledbuttonnotpressed.png); }"
"QCheckBox::indicator:checked {"
" image: url(:/png/fader/res/ledbuttonpressed.png); }"
"QCheckBox { color: rgb(148, 148, 148);"
" font: bold; }" );
pcbSolo->setText ( "SOLO" );
break;
default:
// reset style sheet and set original paramters
pFader->setStyleSheet ( "" );
pcbMute->setStyleSheet ( "" );
pcbSolo->setStyleSheet ( "" );
pcbMute->setText ( "Mute" );
pcbSolo->setText ( "Solo" );
break;
}
}
void CChannelFader::Reset()
{
// init gain value -> maximum value as definition according to server
@ -276,6 +300,42 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags f ) :
QObject::connect ( vecpChanFader[9], SIGNAL ( soloStateChanged ( int ) ), this, SLOT ( OnChSoloStateChangedCh9 ( int ) ) );
}
void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign )
{
// apply GUI design to current window
switch ( eNewDesign )
{
case GD_ORIGINAL:
// group box
setStyleSheet (
"QGroupBox { border-image: url(:/png/fader/res/mixerboardbackground.png) 34px 30px 40px 40px;"
" border-top: 34px transparent;"
" border-bottom: 40px transparent;"
" border-left: 30px transparent;"
" border-right: 40px transparent;"
" padding: -5px;"
" margin: -5px, -5px, 0px, 0px; }"
"QGroupBox::title { margin-top: 13px;"
" margin-left: 35px;"
" background-color: transparent;"
" color: rgb(148, 148, 148); }" );
layout()->setMargin ( 3 );
break;
default:
// reset style sheet and set original paramters
setStyleSheet ( "" );
layout()->setMargin ( 9 );
break;
}
// also apply GUI design to child GUI controls
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
{
vecpChanFader[i]->SetGUIDesign ( eNewDesign );
}
}
void CAudioMixerBoard::HideAll()
{
// make old controls invisible

View file

@ -63,6 +63,7 @@ public:
void Show() { pLabel->show(); pcbMute->show(); pcbSolo->show(); pFader->show(); }
void Hide() { pLabel->hide(); pcbMute->hide(); pcbSolo->hide(); pFader->hide(); }
bool IsVisible() { return pLabel->isVisible(); }
void SetGUIDesign ( const EGUIDesign eNewDesign );
void ResetSoloState();
void SetOtherSoloState ( const bool bState );
@ -100,6 +101,7 @@ public:
void HideAll();
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
void SetGUIDesign ( const EGUIDesign eNewDesign );
protected:
QString GenFaderText ( CChannelShortInfo& ChanInfo );

View file

@ -35,6 +35,7 @@ CClient::CClient ( const quint16 iPortNumber ) :
bReverbOnLeftChan ( false ),
vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ), strName ( "" ),
bOpenChatOnNewMessage ( true ),
eGUIDesign ( GD_STANDARD ),
bDoAutoSockBufSize ( true ),
iSndCrdPrefFrameSizeFactor ( FRAME_SIZE_FACTOR_DEFAULT ),
iSndCrdFrameSizeFactor ( FRAME_SIZE_FACTOR_DEFAULT ),

View file

@ -81,19 +81,22 @@ public:
double GetTimingStdDev() { return CycleTimeVariance.GetStdDev(); }
bool GetOpenChatOnNewMessage() { return bOpenChatOnNewMessage; }
bool GetOpenChatOnNewMessage() const { return bOpenChatOnNewMessage; }
void SetOpenChatOnNewMessage ( const bool bNV ) { bOpenChatOnNewMessage = bNV; }
bool GetCELTHighQuality() { return bCeltDoHighQuality; }
EGUIDesign GetGUIDesign() const { return eGUIDesign; }
void SetGUIDesign ( const EGUIDesign bNGD ) { eGUIDesign = bNGD; }
bool GetCELTHighQuality() const { return bCeltDoHighQuality; }
void SetCELTHighQuality ( const bool bNCeltHighQualityFlag );
int GetAudioInFader() { return iAudioInFader; }
int GetAudioInFader() const { return iAudioInFader; }
void SetAudioInFader ( const int iNV ) { iAudioInFader = iNV; }
int GetReverbLevel() { return iReverbLevel; }
int GetReverbLevel() const { return iReverbLevel; }
void SetReverbLevel ( const int iNL ) { iReverbLevel = iNL; }
bool IsReverbOnLeftChan() { return bReverbOnLeftChan; }
bool IsReverbOnLeftChan() const { return bReverbOnLeftChan; }
void SetReverbOnLeftChan ( const bool bIL )
{
bReverbOnLeftChan = bIL;
@ -101,7 +104,7 @@ public:
}
void SetDoAutoSockBufSize ( const bool bValue ) { bDoAutoSockBufSize = bValue; }
bool GetDoAutoSockBufSize() { return bDoAutoSockBufSize; }
bool GetDoAutoSockBufSize() const { return bDoAutoSockBufSize; }
void SetSockBufNumFrames ( const int iNumBlocks )
{
// only change parameter if new parameter is different from current one
@ -189,6 +192,7 @@ protected:
int iStereoBlockSizeSam;
bool bOpenChatOnNewMessage;
EGUIDesign eGUIDesign;
CVector<int16_t> vecsAudioSndCrdMono;
CVector<int16_t> vecsAudioSndCrdStereo;

View file

@ -83,6 +83,16 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
cbOpenChatOnNewMessage->setCheckState ( Qt::Unchecked );
}
// fancy GUI design check box
if ( pClient->GetGUIDesign() == GD_STANDARD )
{
cbGUIDesignFancy->setCheckState ( Qt::Unchecked );
}
else
{
cbGUIDesignFancy->setCheckState ( Qt::Checked );
}
// "High Quality Audio" check box
if ( pClient->GetCELTHighQuality() )
{
@ -117,6 +127,7 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
// timers
QObject::connect ( &TimerStatus, SIGNAL ( timeout() ),
this, SLOT ( OnTimerStatus() ) );
QObject::connect ( &TimerPing, SIGNAL ( timeout() ),
this, SLOT ( OnTimerPing() ) );
@ -127,8 +138,13 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
// check boxes
QObject::connect ( cbOpenChatOnNewMessage, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnOpenChatOnNewMessageStateChanged ( int ) ) );
QObject::connect ( cbGUIDesignFancy, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnGUIDesignFancyStateChanged ( int ) ) );
QObject::connect ( cbUseHighQualityAudio, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnUseHighQualityAudioStateChanged ( int ) ) );
QObject::connect ( cbAutoJitBuf, SIGNAL ( stateChanged ( int ) ),
this, SLOT ( OnAutoJitBuf ( int ) ) );
@ -294,6 +310,20 @@ void CClientSettingsDlg::OnOpenChatOnNewMessageStateChanged ( int value )
UpdateDisplay();
}
void CClientSettingsDlg::OnGUIDesignFancyStateChanged ( int value )
{
if ( value == Qt::Unchecked )
{
pClient->SetGUIDesign ( GD_STANDARD );
}
else
{
pClient->SetGUIDesign ( GD_ORIGINAL );
}
emit GUIDesignChanged();
UpdateDisplay();
}
void CClientSettingsDlg::OnUseHighQualityAudioStateChanged ( int value )
{
pClient->SetCELTHighQuality ( value == Qt::Checked );

View file

@ -83,9 +83,13 @@ protected:
void OnSliderSndCrdBufferDelay ( int value );
void OnAutoJitBuf ( int value );
void OnOpenChatOnNewMessageStateChanged ( int value );
void OnGUIDesignFancyStateChanged ( int value );
void OnUseHighQualityAudioStateChanged ( int value );
void OnSndCrdBufferDelayButtonGroupClicked ( QAbstractButton* button );
void OnPingTimeResult ( int iPingTime );
void OnSoundCrdSelection ( int iSndDevIdx );
void OnDriverSetupBut();
signals:
void GUIDesignChanged();
};

View file

@ -301,6 +301,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbGUIDesignFancy" >
<property name="text" >
<string>Fancy GUI Design</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbUseHighQualityAudio" >
<property name="windowModality" >
@ -319,7 +326,7 @@
<property name="sizeHint" >
<size>
<width>201</width>
<height>41</height>
<height>71</height>
</size>
</property>
</spacer>

View file

@ -135,6 +135,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
"<li> The CPU of the client or server is at 100%.</li>"
"</ul>" ) );
// init GUI design
SetGUIDesign ( pClient->GetGUIDesign() );
// init fader tag line edit
LineEditFaderTag->setText ( pClient->strName );
@ -240,26 +243,31 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
// timers
QObject::connect ( &TimerSigMet, SIGNAL ( timeout() ),
this, SLOT ( OnTimerSigMet() ) );
QObject::connect ( &TimerStatus, SIGNAL ( timeout() ),
this, SLOT ( OnTimerStatus() ) );
// sliders
QObject::connect ( SliderAudInFader, SIGNAL ( valueChanged ( int ) ),
this, SLOT ( OnSliderAudInFader ( int ) ) );
QObject::connect ( SliderAudReverb, SIGNAL ( valueChanged ( int ) ),
this, SLOT ( OnSliderAudReverb ( int ) ) );
// radio buttons
QObject::connect ( RadioButtonRevSelL, SIGNAL ( clicked() ),
this, SLOT ( OnRevSelL() ) );
QObject::connect ( RadioButtonRevSelR, SIGNAL ( clicked() ),
this, SLOT ( OnRevSelR() ) );
// line edits
QObject::connect ( LineEditFaderTag, SIGNAL ( textChanged ( const QString& ) ),
this, SLOT ( OnFaderTagTextChanged ( const QString& ) ) );
QObject::connect ( LineEditServerAddr, SIGNAL ( editTextChanged ( const QString ) ),
this, SLOT ( OnLineEditServerAddrTextChanged ( const QString ) ) );
QObject::connect ( LineEditServerAddr, SIGNAL ( activated ( int ) ),
this, SLOT ( OnLineEditServerAddrActivated ( int ) ) );
@ -267,17 +275,25 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
QObject::connect ( pClient,
SIGNAL ( ConClientListMesReceived ( CVector<CChannelShortInfo> ) ),
this, SLOT ( OnConClientListMesReceived ( CVector<CChannelShortInfo> ) ) );
QObject::connect ( pClient,
SIGNAL ( Disconnected() ),
this, SLOT ( OnDisconnected() ) );
QObject::connect ( pClient,
SIGNAL ( Stopped() ),
this, SLOT ( OnStopped() ) );
QObject::connect ( pClient,
SIGNAL ( ChatTextReceived ( QString ) ),
this, SLOT ( OnChatTextReceived ( QString ) ) );
QObject::connect ( &ClientSettingsDlg, SIGNAL ( GUIDesignChanged() ),
this, SLOT ( OnGUIDesignChanged() ) );
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
this, SLOT ( OnChangeChanGain ( int, double ) ) );
QObject::connect ( &ChatDlg, SIGNAL ( NewLocalInputText ( QString ) ),
this, SLOT ( OnNewLocalInputText ( QString ) ) );
@ -569,6 +585,77 @@ void CLlconClientDlg::UpdateDisplay()
}
void CLlconClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
{
// apply GUI design to current window
switch ( eNewDesign )
{
case GD_ORIGINAL:
// group box
groupBoxLocal->setStyleSheet (
"QGroupBox { border-image: url(:/png/fader/res/mixerboardbackground.png) 34px 30px 40px 40px;"
" border-top: 34px transparent;"
" border-bottom: 40px transparent;"
" border-left: 30px transparent;"
" border-right: 40px transparent;"
" padding: -5px;"
" margin: -5px, -5px, 0px, 0px; }"
"QGroupBox::title { margin-top: 13px;"
" margin-left: 35px;"
" background-color: transparent;"
" color: rgb(148, 148, 148); }" );
groupBoxLocal->layout()->setMargin ( 3 );
// audio fader
SliderAudInFader->setStyleSheet (
"QSlider { background-image: url(:/png/fader/res/faderbackground.png);"
" width: 45px; }"
"QSlider::groove { image: url(); }"
"QSlider::handle { image: url(:/png/fader/res/faderhandlesmall.png); }" );
TextLabelAudFader->setStyleSheet (
"QLabel { color: rgb(148, 148, 148);"
" font: bold; }" );
TextAudInFader->setStyleSheet (
"QLabel { color: rgb(148, 148, 148);"
" font: bold; }" );
// Reverberation
SliderAudReverb->setStyleSheet (
"QSlider { background-image: url(:/png/fader/res/faderbackground.png);"
" width: 45px; }"
"QSlider::groove { image: url(); }"
"QSlider::handle { image: url(:/png/fader/res/faderhandlesmall.png); }" );
RadioButtonRevSelL->setStyleSheet (
"QRadioButton { color: rgb(148, 148, 148);"
" font: bold; }" );
RadioButtonRevSelR->setStyleSheet (
"QRadioButton { color: rgb(148, 148, 148);"
" font: bold; }" );
TextLabelAudReverb->setStyleSheet (
"QLabel { color: rgb(148, 148, 148);"
" font: bold; }" );
break;
default:
// reset style sheet and set original paramters
groupBoxLocal->setStyleSheet ( "" );
groupBoxLocal->layout()->setMargin ( 9 );
SliderAudInFader->setStyleSheet ( "" );
SliderAudReverb->setStyleSheet ( "" );
RadioButtonRevSelL->setStyleSheet ( "" );
RadioButtonRevSelR->setStyleSheet ( "" );
TextLabelAudReverb->setStyleSheet ( "" );
TextLabelAudFader->setStyleSheet ( "" );
TextAudInFader->setStyleSheet ( "" );
break;
}
// also apply GUI design to child GUI controls
MainMixerBoard->SetGUIDesign ( eNewDesign );
}
void CLlconClientDlg::customEvent ( QEvent* Event )
{
if ( Event->type() == QEvent::User + 11 )

View file

@ -71,6 +71,7 @@ public:
QWidget* parent = 0, Qt::WindowFlags f = 0 );
protected:
void SetGUIDesign ( const EGUIDesign eNewDesign );
void ShowChatWindow();
void UpdateAudioFaderSlider();
void ConnectDisconnect ( const bool bDoStart );
@ -113,4 +114,5 @@ public slots:
void OnLineEditServerAddrActivated ( int index );
void OnDisconnected();
void OnStopped();
void OnGUIDesignChanged() { SetGUIDesign ( pClient->GetGUIDesign() ); }
};

BIN
src/res/faderbackground.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
src/res/faderhandlesmall.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Binary file not shown.

BIN
src/res/mixerboardbackground.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View file

@ -34,7 +34,12 @@
<file>res/VRLEDYellowSmall.png</file>
</qresource>
<qresource prefix="/png/fader" >
<file>res/faderbackground.png</file>
<file>res/faderhandle.png</file>
<file>res/faderhandlesmall.png</file>
<file>res/ledbuttonnotpressed.png</file>
<file>res/ledbuttonpressed.png</file>
<file>res/mixerboardbackground.png</file>
</qresource>
<qresource prefix="/png/main" >
<file>res/gig.png</file>

View file

@ -141,6 +141,13 @@ void CSettings::ReadIniFile ( const QString& sFileName )
pClient->SetOpenChatOnNewMessage ( bValue );
}
// GUI design
if ( GetNumericIniSet ( IniXMLDocument, "client", "guidesign",
0, 1 /* GD_ORIGINAL */, iValue ) )
{
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) );
}
// flag whether using high quality audio or not
if ( GetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio", bValue ) )
{
@ -199,6 +206,10 @@ void CSettings::WriteIniFile ( const QString& sFileName )
SetFlagIniSet ( IniXMLDocument, "client", "openchatonnewmessage",
pClient->GetOpenChatOnNewMessage() );
// GUI design
SetNumericIniSet ( IniXMLDocument, "client", "guidesign",
static_cast<int> ( pClient->GetGUIDesign() ) );
// flag whether using high quality audio or not
SetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio",
pClient->GetCELTHighQuality() );

View file

@ -443,6 +443,12 @@ enum EGetDataStat
GS_CHAN_NOT_CONNECTED
};
enum EGUIDesign
{
GD_STANDARD = 0,
GD_ORIGINAL = 1
};
class CNetworkTransportProps
{
public: