add new "slim channel" skin, intended for large ensembles (#339)

This commit is contained in:
Volker Fischer 2020-06-11 16:42:50 +02:00
parent ea4a3134f8
commit cf7a01d231
11 changed files with 104 additions and 90 deletions

View file

@ -5,6 +5,7 @@
3.5.7git
- add new "slim channel" skin, intended for large ensembles (#339)

View file

@ -54,8 +54,8 @@ CChannelFader::CChannelFader ( QWidget* pNW )
QVBoxLayout* pMainGrid = new QVBoxLayout ( pFrame );
QHBoxLayout* pLevelsGrid = new QHBoxLayout ( pLevelsBox );
QVBoxLayout* pMuteSoloGrid = new QVBoxLayout ( pMuteSoloBox );
QHBoxLayout* pLabelGrid = new QHBoxLayout ( pLabelInstBox );
QVBoxLayout* pLabelPictGrid = new QVBoxLayout ( );
pLabelGrid = new QHBoxLayout ( pLabelInstBox );
pLabelPictGrid = new QVBoxLayout ( );
QVBoxLayout* pPanGrid = new QVBoxLayout ( );
QHBoxLayout* pPanInfoGrid = new QHBoxLayout ( );
@ -64,7 +64,6 @@ CChannelFader::CChannelFader ( QWidget* pNW )
// setup slider
pFader->setPageStep ( 1 );
pFader->setTickPosition ( QSlider::TicksBothSides );
pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
pFader->setMinimumHeight ( 85 ); // if this value is too small, the fader might not be movable with the mouse for fancy skin (#292)
@ -72,7 +71,6 @@ CChannelFader::CChannelFader ( QWidget* pNW )
// setup panning control
pPan->setRange ( 0, AUD_MIX_PAN_MAX );
pPan->setValue ( AUD_MIX_PAN_MAX / 2 );
pPan->setFixedSize ( 50, 50 );
pPan->setNotchesVisible ( true );
pPanInfoGrid->addWidget ( pPanLabel, 0, Qt::AlignLeft );
pPanInfoGrid->addWidget ( pInfoLabel );
@ -82,10 +80,7 @@ CChannelFader::CChannelFader ( QWidget* pNW )
// setup fader tag label (black bold text which is centered)
plblLabel->setTextFormat ( Qt::PlainText );
plblLabel->setAlignment ( Qt::AlignHCenter | Qt::AlignVCenter );
plblLabel->setMinimumHeight ( 40 ); // maximum hight of the instrument+flag pictures
plblLabel->setStyleSheet (
"QLabel { color: black;"
" font: bold; }" );
plblLabel->setStyleSheet ( "QLabel { color: black; font: bold; }" );
// set margins of the layouts to zero to get maximum space for the controls
pMainGrid->setContentsMargins ( 0, 0, 0, 0 );
@ -106,7 +101,7 @@ CChannelFader::CChannelFader ( QWidget* pNW )
pLabelPictGrid->addWidget ( plblInstrument, 0, Qt::AlignHCenter );
pLabelGrid->addLayout ( pLabelPictGrid );
pLabelGrid->addWidget ( plblLabel, 0, Qt::AlignVCenter );
pLabelGrid->addWidget ( plblLabel, 0, Qt::AlignVCenter ); // note: just initial add, may be changed later
pLevelsGrid->addWidget ( plbrChannelLevel, 0, Qt::AlignRight );
pLevelsGrid->addWidget ( pFader, 0, Qt::AlignLeft );
@ -188,7 +183,6 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
switch ( eNewDesign )
{
case GD_ORIGINAL:
// fader
pFader->setStyleSheet (
"QSlider { width: 45px;"
" border-image: url(:/png/fader/res/faderbackground.png) repeat;"
@ -202,15 +196,34 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
" padding-bottom: -15px; }"
"QSlider::handle { image: url(:/png/fader/res/faderhandle.png); }" );
pLabelGrid->addWidget ( plblLabel, 0, Qt::AlignVCenter ); // label next to icons
pLabelInstBox->setMinimumHeight ( 52 ); // maximum hight of the instrument+flag pictures
pPan->setFixedSize ( 50, 50 );
pPanLabel->setText ( tr ( "PAN" ) );
pcbMute->setText ( tr ( "MUTE" ) );
pcbSolo->setText ( tr ( "SOLO" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
break;
case GD_SLIMFADER:
pLabelPictGrid->addWidget ( plblLabel, 0, Qt::AlignHCenter ); // label below icons
pLabelInstBox->setMinimumHeight ( 80 ); // maximum hight of the instrument+flag+label
pPan->setFixedSize ( 28, 28 );
pFader->setTickPosition ( QSlider::NoTicks );
pFader->setStyleSheet ( "" );
pPanLabel->setText ( tr ( "Pan" ) );
pcbMute->setText ( tr ( "M" ) );
pcbSolo->setText ( tr ( "S" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_SLIM_BAR );
break;
default:
// reset style sheet and set original paramters
pFader->setTickPosition ( QSlider::TicksBothSides );
pFader->setStyleSheet ( "" );
pLabelGrid->addWidget ( plblLabel, 0, Qt::AlignVCenter ); // label next to icons
pLabelInstBox->setMinimumHeight ( 52 ); // maximum hight of the instrument+flag pictures
pPan->setFixedSize ( 50, 50 );
pPanLabel->setText ( tr ( "Pan" ) );
pcbMute->setText ( tr ( "Mute" ) );
pcbSolo->setText ( tr ( "Solo" ) );
@ -356,13 +369,10 @@ void CChannelFader::SetRemoteFaderIsMute ( const bool bIsMute )
{
// show orange utf8 SPEAKER WITH CANCELLATION STROKE (U+1F507)
pInfoLabel->setText ( "<font color=""orange"">&#128263;</font>" );
//QPixmap CancelledSpeakerPixmap ( QString::fromUtf8 ( ":/png/main/res/speakerwithcancellationstroke.png" ) );
//pInfoLabel->setPixmap ( CancelledSpeakerPixmap.scaled ( 15, 15, Qt::KeepAspectRatio ) );
}
else
{
pInfoLabel->setText ( "" );
//pInfoLabel->setPixmap ( QPixmap() );
}
}

View file

@ -90,6 +90,8 @@ protected:
QDial* pPan;
QLabel* pPanLabel;
QLabel* pInfoLabel;
QHBoxLayout* pLabelGrid;
QVBoxLayout* pLabelPictGrid;
QCheckBox* pcbMute;
QCheckBox* pcbSolo;

View file

@ -215,9 +215,7 @@ public slots:
void OnConnectDlgAccepted();
void OnDisconnected() { Disconnect(); }
void OnCentralServerAddressTypeChanged();
void OnGUIDesignChanged()
{ SetGUIDesign ( pClient->GetGUIDesign() ); }
void OnGUIDesignChanged() { SetGUIDesign ( pClient->GetGUIDesign() ); }
void OnDisplayChannelLevelsChanged()
{ MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); }

View file

@ -183,10 +183,10 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
butDriverSetup->setToolTip ( strSndCrdBufDelayTT );
// fancy skin
chbGUIDesignFancy->setWhatsThis ( "<b>" + tr ( "Fancy Skin" ) + ":</b> " + tr (
"If enabled, a fancy skin will be applied to the main window." ) );
cbxSkin->setWhatsThis ( "<b>" + tr ( "Skin" ) + ":</b> " + tr (
"Select the skin to be used for the main window." ) );
chbGUIDesignFancy->setAccessibleName ( tr ( "Fancy skin check box" ) );
cbxSkin->setAccessibleName ( tr ( "Skin combo box" ) );
// display channel levels
chbDisplayChannelLevels->setWhatsThis ( "<b>" + tr ( "Display Channel Levels" ) + ":</b> " +
@ -312,33 +312,30 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
// init sound card channel selection frame
UpdateSoundChannelSelectionFrame();
// fancy GUI design check box
if ( pClient->GetGUIDesign() == GD_STANDARD )
{
chbGUIDesignFancy->setCheckState ( Qt::Unchecked );
}
else
{
chbGUIDesignFancy->setCheckState ( Qt::Checked );
}
// Display Channel Levels check box
chbDisplayChannelLevels->setCheckState ( pClient->GetDisplayChannelLevels() ? Qt::Checked : Qt::Unchecked );
// "Audio Channels" combo box
// Audio Channels combo box
cbxAudioChannels->clear();
cbxAudioChannels->addItem ( tr ( "Mono" ) ); // CC_MONO
cbxAudioChannels->addItem ( tr ( "Mono-in/Stereo-out" ) ); // CC_MONO_IN_STEREO_OUT
cbxAudioChannels->addItem ( tr ( "Stereo" ) ); // CC_STEREO
cbxAudioChannels->setCurrentIndex ( static_cast<int> ( pClient->GetAudioChannels() ) );
// "Audio Quality" combo box
// Audio Quality combo box
cbxAudioQuality->clear();
cbxAudioQuality->addItem ( tr ( "Low" ) ); // AQ_LOW
cbxAudioQuality->addItem ( tr ( "Normal" ) ); // AQ_NORMAL
cbxAudioQuality->addItem ( tr ( "High" ) ); // AQ_HIGH
cbxAudioQuality->setCurrentIndex ( static_cast<int> ( pClient->GetAudioQuality() ) );
// GUI design (skin) combo box
cbxSkin->clear();
cbxSkin->addItem ( tr ( "Normal" ) ); // GD_STANDARD
cbxSkin->addItem ( tr ( "Fancy" ) ); // GD_ORIGINAL
cbxSkin->addItem ( tr ( "Slim Channel" ) ); // GD_SLIMFADER
cbxSkin->setCurrentIndex ( static_cast<int> ( pClient->GetGUIDesign() ) );
// custom central server address
edtCentralServerAddress->setText ( pClient->GetServerListCentralServerAddress() );
@ -380,9 +377,6 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
this, &CClientSettingsDlg::OnNetBufServerValueChanged );
// check boxes
QObject::connect ( chbGUIDesignFancy, &QCheckBox::stateChanged,
this, &CClientSettingsDlg::OnGUIDesignFancyStateChanged );
QObject::connect ( chbDisplayChannelLevels, &QCheckBox::stateChanged,
this, &CClientSettingsDlg::OnDisplayChannelLevelsStateChanged );
@ -421,6 +415,9 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
QObject::connect ( cbxAudioQuality, static_cast<void (QComboBox::*) ( int )> ( &QComboBox::activated ),
this, &CClientSettingsDlg::OnAudioQualityActivated );
QObject::connect ( cbxSkin, static_cast<void (QComboBox::*) ( int )> ( &QComboBox::activated ),
this, &CClientSettingsDlg::OnGUIDesignActivated );
// buttons
QObject::connect ( butDriverSetup, &QPushButton::clicked,
this, &CClientSettingsDlg::OnDriverSetupClicked );
@ -639,6 +636,13 @@ void CClientSettingsDlg::OnAudioQualityActivated ( int iQualityIdx )
UpdateDisplay(); // upload rate will be changed
}
void CClientSettingsDlg::OnGUIDesignActivated ( int iDesignIdx )
{
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iDesignIdx ) );
emit GUIDesignChanged();
UpdateDisplay();
}
void CClientSettingsDlg::OnAutoJitBufStateChanged ( int value )
{
pClient->SetDoAutoSockBufSize ( value == Qt::Checked );
@ -651,20 +655,6 @@ void CClientSettingsDlg::OnEnableOPUS64StateChanged ( 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::OnDisplayChannelLevelsStateChanged ( int value )
{
pClient->SetDisplayChannelLevels ( value != Qt::Unchecked );

View file

@ -87,7 +87,6 @@ protected:
void OnNetBufValueChanged ( int value );
void OnNetBufServerValueChanged ( int value );
void OnAutoJitBufStateChanged ( int value );
void OnGUIDesignFancyStateChanged ( int value );
void OnDisplayChannelLevelsStateChanged ( int value );
void OnEnableOPUS64StateChanged ( int value );
void OnCentralServerAddressEditingFinished();
@ -100,6 +99,7 @@ protected:
void OnROutChanActivated ( int iChanIdx );
void OnAudioChannelsActivated ( int iChanIdx );
void OnAudioQualityActivated ( int iQualityIdx );
void OnGUIDesignActivated ( int iDesignIdx );
void OnDriverSetupClicked();
signals:

View file

@ -508,6 +508,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="lblSkin">
<property name="text">
<string>Skin</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -532,18 +539,12 @@
</item>
</layout>
</item>
</layout>
<item>
<widget class="QComboBox" name="cbxSkin"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout">
<item>
<widget class="QCheckBox" name="chbGUIDesignFancy">
<property name="text">
<string>Fancy Skin</string>
</property>
</widget>
</layout>
</item>
<item>
<widget class="QCheckBox" name="chbDisplayChannelLevels">
@ -552,8 +553,6 @@
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="lblCentralServerAddress">
<property name="text">
@ -726,7 +725,7 @@
<tabstop>cbxAudioChannels</tabstop>
<tabstop>cbxAudioQuality</tabstop>
<tabstop>edtNewClientLevel</tabstop>
<tabstop>chbGUIDesignFancy</tabstop>
<tabstop>cbxSkin</tabstop>
<tabstop>chbDisplayChannelLevels</tabstop>
<tabstop>edtCentralServerAddress</tabstop>
</tabstops>

View file

@ -62,11 +62,6 @@ CMultiColorLEDBar::CMultiColorLEDBar ( QWidget* parent, Qt::WindowFlags f ) :
pProgressBar->setOrientation ( Qt::Vertical );
pProgressBar->setRange ( 0, 100 * NUM_STEPS_LED_BAR );
pProgressBar->setFormat ( "" ); // suppress percent numbers
pProgressBar->setStyleSheet (
"QProgressBar { margin: 1px;"
" padding: 1px; "
" width: 15px; }"
"QProgressBar::chunk { background: green; }" );
// setup stacked layout for meter type switching mechanism
pStackedLayout = new QStackedLayout ( this );
@ -76,7 +71,7 @@ CMultiColorLEDBar::CMultiColorLEDBar ( QWidget* parent, Qt::WindowFlags f ) :
// according to QScrollArea description: "When using a scroll area to display the
// contents of a custom widget, it is important to ensure that the size hint of
// the child widget is set to a suitable value."
pProgressBar->setMinimumSize ( QSize ( 19, 1 ) ); // 15px + 2 * 1px + 2 * 1px = 19px
pProgressBar->setMinimumSize ( QSize ( 1, 1 ) );
pLEDMeter->setMinimumSize ( QSize ( 1, 1 ) );
// update the meter type (using the default value of the meter type)
@ -131,6 +126,27 @@ void CMultiColorLEDBar::SetLevelMeterType ( const ELevelMeterType eNType )
case MT_BAR:
pStackedLayout->setCurrentIndex ( 1 );
pProgressBar->setStyleSheet (
"QProgressBar { margin: 1px;"
" padding: 1px; "
" width: 15px; }"
"QProgressBar::chunk { background: green; }" );
break;
case MT_SLIM_BAR:
// set all LEDs to disabled, otherwise we would not get our desired small width
for ( int iLEDIdx = 0; iLEDIdx < NUM_STEPS_LED_BAR; iLEDIdx++ )
{
vecpLEDs[iLEDIdx]->setColor ( cLED::RL_DISABLED );
}
pStackedLayout->setCurrentIndex ( 1 );
pProgressBar->setStyleSheet (
"QProgressBar { border: 0px;"
" margin: 0px;"
" padding: 0px; "
" width: 4px; }"
"QProgressBar::chunk { background: green; }" );
break;
}
}
@ -177,6 +193,7 @@ void CMultiColorLEDBar::setValue ( const double dValue )
break;
case MT_BAR:
case MT_SLIM_BAR:
pProgressBar->setValue ( 100 * dValue );
break;
}
@ -184,7 +201,6 @@ void CMultiColorLEDBar::setValue ( const double dValue )
}
CMultiColorLEDBar::cLED::cLED ( QWidget* parent ) :
BitmCubeRoundDisabled ( QString::fromUtf8 ( ":/png/LEDs/res/CLEDDisabledSmall.png" ) ),
BitmCubeRoundBlack ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDBlackSmall.png" ) ),
BitmCubeRoundGreen ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDGreenSmall.png" ) ),
BitmCubeRoundYellow ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDYellowSmall.png" ) ),
@ -193,9 +209,6 @@ CMultiColorLEDBar::cLED::cLED ( QWidget* parent ) :
// create LED label
pLEDLabel = new QLabel ( "", parent );
// bitmap defines minimum size of the label
pLEDLabel->setMinimumSize ( BitmCubeRoundBlack.width(), BitmCubeRoundBlack.height() );
// set initial bitmap
pLEDLabel->setPixmap ( BitmCubeRoundBlack );
eCurLightColor = RL_BLACK;
@ -209,7 +222,7 @@ void CMultiColorLEDBar::cLED::setColor ( const ELightColor eNewColor )
switch ( eNewColor )
{
case RL_DISABLED:
pLEDLabel->setPixmap ( BitmCubeRoundDisabled );
pLEDLabel->setPixmap ( QPixmap() );
break;
case RL_BLACK:

View file

@ -50,7 +50,8 @@ public:
enum ELevelMeterType
{
MT_LED,
MT_BAR
MT_BAR,
MT_SLIM_BAR
};
CMultiColorLEDBar ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
@ -77,7 +78,6 @@ protected:
QLabel* getLabelPointer() { return pLEDLabel; }
protected:
QPixmap BitmCubeRoundDisabled;
QPixmap BitmCubeRoundBlack;
QPixmap BitmCubeRoundGreen;
QPixmap BitmCubeRoundYellow;

View file

@ -269,7 +269,7 @@ void CSettings::Load()
// GUI design
if ( GetNumericIniSet ( IniXMLDocument, "client", "guidesign",
0, 1 /* GD_ORIGINAL */, iValue ) )
0, 2 /* GD_SLIMFADER */, iValue ) )
{
pClient->SetGUIDesign ( static_cast<EGUIDesign> ( iValue ) );
}

View file

@ -549,7 +549,8 @@ enum EGUIDesign
{
// used for settings -> enum values should be fixed
GD_STANDARD = 0,
GD_ORIGINAL = 1
GD_ORIGINAL = 1,
GD_SLIMFADER = 2
};