diff --git a/linux/Makefile.am b/linux/Makefile.am index ce7dfc68..8501dc49 100755 --- a/linux/Makefile.am +++ b/linux/Makefile.am @@ -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 \ diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 23447d78..63247980 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -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 diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 47e2da37..02ddb13e 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -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& vecChanInfo ); + void SetGUIDesign ( const EGUIDesign eNewDesign ); protected: QString GenFaderText ( CChannelShortInfo& ChanInfo ); diff --git a/src/client.cpp b/src/client.cpp index 559c6b6a..4e5a75dd 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -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 ), diff --git a/src/client.h b/src/client.h index b71e2def..775a6b07 100755 --- a/src/client.h +++ b/src/client.h @@ -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 vecsAudioSndCrdMono; CVector vecsAudioSndCrdStereo; diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index 1b65eed1..79225674 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -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 ); diff --git a/src/clientsettingsdlg.h b/src/clientsettingsdlg.h index 95310006..1c309740 100755 --- a/src/clientsettingsdlg.h +++ b/src/clientsettingsdlg.h @@ -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(); }; diff --git a/src/clientsettingsdlgbase.ui b/src/clientsettingsdlgbase.ui index 58797307..b20d099b 100755 --- a/src/clientsettingsdlgbase.ui +++ b/src/clientsettingsdlgbase.ui @@ -301,6 +301,13 @@ + + + + Fancy GUI Design + + + @@ -319,7 +326,7 @@ 201 - 41 + 71 diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index 1ee8706c..92d2018b 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -135,6 +135,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, "
  • The CPU of the client or server is at 100%.
  • " "" ) ); + // 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 ) ), this, SLOT ( OnConClientListMesReceived ( CVector ) ) ); + 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 ) diff --git a/src/llconclientdlg.h b/src/llconclientdlg.h index 2f82334e..c8379f3d 100755 --- a/src/llconclientdlg.h +++ b/src/llconclientdlg.h @@ -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() ); } }; diff --git a/src/res/faderbackground.png b/src/res/faderbackground.png new file mode 100755 index 00000000..5c3c56ce Binary files /dev/null and b/src/res/faderbackground.png differ diff --git a/src/res/faderhandlesmall.png b/src/res/faderhandlesmall.png new file mode 100755 index 00000000..c5cf2a82 Binary files /dev/null and b/src/res/faderhandlesmall.png differ diff --git a/src/res/ledbuttonnotpressed.xcf b/src/res/ledbuttonnotpressed.xcf deleted file mode 100755 index 9a277935..00000000 Binary files a/src/res/ledbuttonnotpressed.xcf and /dev/null differ diff --git a/src/res/ledbuttonpressed.xcf b/src/res/ledbuttonpressed.xcf deleted file mode 100755 index 711e9a56..00000000 Binary files a/src/res/ledbuttonpressed.xcf and /dev/null differ diff --git a/src/res/mixerboardbackground.png b/src/res/mixerboardbackground.png new file mode 100755 index 00000000..b87b6680 Binary files /dev/null and b/src/res/mixerboardbackground.png differ diff --git a/src/resources.qrc b/src/resources.qrc index 619856d6..05afdb1c 100755 --- a/src/resources.qrc +++ b/src/resources.qrc @@ -34,7 +34,12 @@ res/VRLEDYellowSmall.png + res/faderbackground.png res/faderhandle.png + res/faderhandlesmall.png + res/ledbuttonnotpressed.png + res/ledbuttonpressed.png + res/mixerboardbackground.png res/gig.png diff --git a/src/settings.cpp b/src/settings.cpp index f235a0a6..cb5151c8 100755 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -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 ( 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 ( pClient->GetGUIDesign() ) ); + // flag whether using high quality audio or not SetFlagIniSet ( IniXMLDocument, "client", "highqualityaudio", pClient->GetCELTHighQuality() ); diff --git a/src/util.h b/src/util.h index 82c1bc49..eb234e12 100755 --- a/src/util.h +++ b/src/util.h @@ -443,6 +443,12 @@ enum EGetDataStat GS_CHAN_NOT_CONNECTED }; +enum EGUIDesign +{ + GD_STANDARD = 0, + GD_ORIGINAL = 1 +}; + class CNetworkTransportProps { public: