Skip to content

Commit 8630648

Browse files
committed
Use L and R below Inputmeters
1 parent 977aaf5 commit 8630648

File tree

3 files changed

+125
-148
lines changed

3 files changed

+125
-148
lines changed

src/clientdlg.cpp

+73-49
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,10 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
7979
QString strInpLevHAccDescr = tr ( "Simulates an analog LED level meter." );
8080

8181
lblInputLEDMeter->setWhatsThis ( strInpLevH );
82-
lblLevelMeterLeft->setWhatsThis ( strInpLevH );
83-
lblLevelMeterRight->setWhatsThis ( strInpLevH );
82+
butPanSelL->setWhatsThis ( "Use this button to set the Input fader to only output Left Channel" );
83+
butPanSelL->setToolTip ( "Enable this button to only output Left Channel." );
84+
butPanSelR->setWhatsThis ( "Use this button to set the Input fader to only output Right Channel" );
85+
butPanSelR->setToolTip ( "Enable this button to only output Right Channel." );
8486
lbrInputLevelL->setWhatsThis ( strInpLevH );
8587
lbrInputLevelL->setAccessibleName ( strInpLevHAccText );
8688
lbrInputLevelL->setAccessibleDescription ( strInpLevHAccDescr );
@@ -263,13 +265,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
263265
lblGlobalInfoLabel->setStyleSheet ( ".QLabel { background: red; }" );
264266
lblGlobalInfoLabel->hide();
265267

266-
// prepare Mute Myself push button (invisible by default)
267-
butGlobalInfoButton->hide();
268-
269268
// setup shortcut for Left, Center, Right and Mute button only NumPad numbers accepted
270269
chbLocalMute->setShortcut ( Qt::Key_0 + Qt::KeypadModifier );
271270
butPanSelL->setShortcut ( Qt::Key_1 + Qt::KeypadModifier );
272-
butPanSelC->setShortcut ( Qt::Key_2 + Qt::KeypadModifier );
273271
butPanSelR->setShortcut ( Qt::Key_3 + Qt::KeypadModifier );
274272

275273
// prepare update check info label (invisible by default)
@@ -455,13 +453,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
455453
// push buttons
456454
QObject::connect ( butConnect, &QPushButton::clicked, this, &CClientDlg::OnConnectDisconBut );
457455

458-
QObject::connect ( butGlobalInfoButton, &QPushButton::clicked, this, &CClientDlg::OnLocalMuteButtonClicked );
459-
460-
QObject::connect ( butPanSelL, &QPushButton::clicked, this, &CClientDlg::OnButtonPanSelLClicked );
461-
462-
QObject::connect ( butPanSelC, &QPushButton::clicked, this, &CClientDlg::OnButtonPanSelCClicked );
456+
QObject::connect ( butPanSelL, &QPushButton::toggled, this, &CClientDlg::OnButtonPanSelLToggled );
463457

464-
QObject::connect ( butPanSelR, &QPushButton::clicked, this, &CClientDlg::OnButtonPanSelRClicked );
458+
QObject::connect ( butPanSelR, &QPushButton::toggled, this, &CClientDlg::OnButtonPanSelRToggled );
465459

466460
// check boxes
467461
QObject::connect ( chbSettings, &QCheckBox::stateChanged, this, &CClientDlg::OnSettingsStateChanged );
@@ -1058,12 +1052,10 @@ void CClientDlg::OnLocalMuteStateChanged ( int value )
10581052
if ( value == Qt::Checked )
10591053
{
10601054
lblGlobalInfoLabel->show();
1061-
// butGlobalInfoButton->show();
10621055
}
10631056
else
10641057
{
10651058
lblGlobalInfoLabel->hide();
1066-
// butGlobalInfoButton->hide();
10671059
}
10681060
}
10691061

@@ -1378,16 +1370,9 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
13781370
"QCheckBox { color: rgb(220, 220, 220);"
13791371
" font: bold; }" );
13801372

1381-
butPanSelC->setStyleSheet ( ":disabled {background-color: rgb(77, 171, 204); color: rgb(220, 220, 220); font: bold;}" );
1382-
butPanSelL->setStyleSheet ( ":disabled {background-color: rgb(77, 171, 204); color: rgb(220, 220, 220); font: bold;}" );
1383-
butPanSelR->setStyleSheet ( ":disabled {background-color: rgb(77, 171, 204); color: rgb(220, 220, 220); font: bold;}" );
1373+
butPanSelL->setStyleSheet ( ":checked {background-color: rgb(77, 171, 204); color: rgb(220, 220, 220); font: bold; border: none;}" );
1374+
butPanSelR->setStyleSheet ( ":checked {background-color: rgb(77, 171, 204); color: rgb(220, 220, 220); font: bold; border: none;}" );
13841375

1385-
butGlobalInfoButton->setStyleSheet ( "background: red;"
1386-
"border: none;"
1387-
"padding-left: 6px;"
1388-
"padding-right: 6px;"
1389-
"color: rgb(220, 220, 220);"
1390-
"font: bold;" );
13911376
#ifdef _WIN32
13921377
// Workaround QT-Windows problem: This should not be necessary since in the
13931378
// background frame the style sheet for QRadioButton was already set. But it
@@ -1406,14 +1391,9 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
14061391
default:
14071392
// reset style sheet and set original parameters
14081393
backgroundFrame->setStyleSheet ( "" );
1409-
butGlobalInfoButton->setStyleSheet ( "background: red;"
1410-
"border: none;"
1411-
"padding-left: 6px;"
1412-
"padding-right: 6px;" );
14131394

1414-
butPanSelC->setStyleSheet ( ":disabled {background-color: rgb(196, 196, 196); color: rgb(0, 0, 0)}" );
1415-
butPanSelL->setStyleSheet ( ":disabled {background-color: rgb(196, 196, 196); color: rgb(0, 0, 0)}" );
1416-
butPanSelR->setStyleSheet ( ":disabled {background-color: rgb(196, 196, 196); color: rgb(0, 0, 0)}" );
1395+
butPanSelL->setStyleSheet ( ":checked {background-color: rgb(196, 196, 196); color: rgb(0, 0, 0); border: none;}" );
1396+
butPanSelR->setStyleSheet ( ":checked {background-color: rgb(196, 196, 196); color: rgb(0, 0, 0); border: none;}" );
14171397

14181398
#ifdef _WIN32
14191399
// Workaround QT-Windows problem: See above description
@@ -1536,38 +1516,82 @@ void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, c
15361516
ledDelay->SetLight ( eOverallDelayLEDColor );
15371517
}
15381518

1519+
void CClientDlg::OnButtonPanSelLToggled()
1520+
{
1521+
bool PanSelRChecked = butPanSelR->isChecked();
1522+
bool PanSelLChecked = butPanSelL->isChecked();
1523+
1524+
// When we get here and both buttons are not checked, move Fader to middle
1525+
if ( !PanSelRChecked && !PanSelLChecked )
1526+
{
1527+
ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MIDDLE );
1528+
}
1529+
1530+
// L button has been checked, so set Fader to Left and uncheck R button
1531+
if ( PanSelLChecked )
1532+
{
1533+
ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MIN );
1534+
butPanSelR->blockSignals ( true );
1535+
butPanSelR->setChecked ( false );
1536+
butPanSelR->blockSignals ( false );
1537+
}
1538+
}
1539+
1540+
void CClientDlg::OnButtonPanSelRToggled()
1541+
{
1542+
bool PanSelRChecked = butPanSelR->isChecked();
1543+
bool PanSelLChecked = butPanSelL->isChecked();
1544+
1545+
// When we get here and both buttons are not checked, move Fader to middle
1546+
if ( !PanSelRChecked && !PanSelLChecked )
1547+
{
1548+
ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MIDDLE );
1549+
}
1550+
1551+
// R button has been checked, so set Fader to Right and uncheck L button
1552+
if ( PanSelRChecked )
1553+
{
1554+
ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MAX );
1555+
butPanSelL->blockSignals ( true );
1556+
butPanSelL->setChecked ( false );
1557+
butPanSelL->blockSignals ( false );
1558+
}
1559+
}
1560+
15391561
void CClientDlg::ButtonUpdate()
15401562
{
15411563
int value = pClient->GetAudioInFader();
15421564

15431565
switch ( value )
15441566
{
1545-
case AUD_FADER_IN_MIDDLE:
1546-
// level is C so disable Center button, enable L and R
1547-
butPanSelL->setEnabled ( true );
1548-
butPanSelC->setEnabled ( false );
1549-
butPanSelR->setEnabled ( true );
1550-
break;
1551-
15521567
case AUD_FADER_IN_MIN:
1553-
// right channel only
1554-
butPanSelL->setEnabled ( false );
1555-
butPanSelC->setEnabled ( true );
1556-
butPanSelR->setEnabled ( true );
1568+
// right channel only - do not emit button signals
1569+
butPanSelL->blockSignals ( true );
1570+
butPanSelL->setChecked ( true );
1571+
butPanSelL->blockSignals ( false );
1572+
butPanSelR->blockSignals ( true );
1573+
butPanSelR->setChecked ( false );
1574+
butPanSelR->blockSignals ( false );
15571575
break;
15581576

15591577
case AUD_FADER_IN_MAX:
1560-
// left channel oonly
1561-
butPanSelL->setEnabled ( true );
1562-
butPanSelC->setEnabled ( true );
1563-
butPanSelR->setEnabled ( false );
1578+
// left channel only - do not emit button signals
1579+
butPanSelL->blockSignals ( true );
1580+
butPanSelL->setChecked ( false );
1581+
butPanSelL->blockSignals ( false );
1582+
butPanSelR->blockSignals ( true );
1583+
butPanSelR->setChecked ( true );
1584+
butPanSelR->blockSignals ( false );
15641585
break;
15651586

15661587
default:
1567-
// not L, C or R so enable all buttons
1568-
butPanSelL->setEnabled ( true );
1569-
butPanSelC->setEnabled ( true );
1570-
butPanSelR->setEnabled ( true );
1588+
// not L or R so uncheck both buttons - do not emit button signals
1589+
butPanSelL->blockSignals ( true );
1590+
butPanSelL->setChecked ( false );
1591+
butPanSelL->blockSignals ( false );
1592+
butPanSelR->blockSignals ( true );
1593+
butPanSelR->setChecked ( false );
1594+
butPanSelR->blockSignals ( false );
15711595
break;
15721596
}
15731597
}

src/clientdlg.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ public slots:
183183
void OnLocalMuteStateChanged ( int value );
184184

185185
void OnLocalMuteButtonClicked() { chbLocalMute->setChecked ( false ); }
186-
void OnButtonPanSelLClicked() { ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MIN ); }
187-
void OnButtonPanSelCClicked() { ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MIDDLE ); }
188-
void OnButtonPanSelRClicked() { ClientSettingsDlg.SetSliderAudioPan ( AUD_FADER_IN_MAX ); }
186+
187+
void OnButtonPanSelLToggled();
188+
void OnButtonPanSelRToggled();
189189

190190
void OnAudioReverbValueChanged ( int value ) { pClient->SetReverbLevel ( value ); }
191191

src/clientdlgbase.ui

+49-96
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>511</width>
9+
<width>725</width>
1010
<height>490</height>
1111
</rect>
1212
</property>
@@ -289,23 +289,65 @@
289289
</item>
290290
<item>
291291
<layout class="QHBoxLayout">
292+
<property name="spacing">
293+
<number>0</number>
294+
</property>
292295
<item>
293-
<widget class="QLabel" name="lblLevelMeterLeft">
296+
<widget class="QPushButton" name="butPanSelL">
297+
<property name="enabled">
298+
<bool>true</bool>
299+
</property>
300+
<property name="sizePolicy">
301+
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
302+
<horstretch>0</horstretch>
303+
<verstretch>0</verstretch>
304+
</sizepolicy>
305+
</property>
306+
<property name="minimumSize">
307+
<size>
308+
<width>19</width>
309+
<height>23</height>
310+
</size>
311+
</property>
312+
<property name="autoFillBackground">
313+
<bool>false</bool>
314+
</property>
294315
<property name="text">
295316
<string>L</string>
296317
</property>
297-
<property name="alignment">
298-
<set>Qt::AlignCenter</set>
318+
<property name="checkable">
319+
<bool>true</bool>
320+
</property>
321+
<property name="checked">
322+
<bool>false</bool>
323+
</property>
324+
<property name="autoDefault">
325+
<bool>false</bool>
299326
</property>
300327
</widget>
301328
</item>
302329
<item>
303-
<widget class="QLabel" name="lblLevelMeterRight">
330+
<widget class="QPushButton" name="butPanSelR">
331+
<property name="sizePolicy">
332+
<sizepolicy hsizetype="Ignored" vsizetype="Fixed">
333+
<horstretch>0</horstretch>
334+
<verstretch>0</verstretch>
335+
</sizepolicy>
336+
</property>
337+
<property name="minimumSize">
338+
<size>
339+
<width>19</width>
340+
<height>23</height>
341+
</size>
342+
</property>
304343
<property name="text">
305344
<string>R</string>
306345
</property>
307-
<property name="alignment">
308-
<set>Qt::AlignCenter</set>
346+
<property name="checkable">
347+
<bool>true</bool>
348+
</property>
349+
<property name="autoDefault">
350+
<bool>false</bool>
309351
</property>
310352
</widget>
311353
</item>
@@ -549,95 +591,6 @@
549591
</item>
550592
</layout>
551593
</item>
552-
<item>
553-
<layout class="QVBoxLayout" name="verticalLayout_31">
554-
<property name="spacing">
555-
<number>6</number>
556-
</property>
557-
<item>
558-
<widget class="QPushButton" name="butPanSelL">
559-
<property name="enabled">
560-
<bool>true</bool>
561-
</property>
562-
<property name="minimumSize">
563-
<size>
564-
<width>0</width>
565-
<height>140</height>
566-
</size>
567-
</property>
568-
<property name="autoFillBackground">
569-
<bool>false</bool>
570-
</property>
571-
<property name="text">
572-
<string>Left</string>
573-
</property>
574-
<property name="checkable">
575-
<bool>false</bool>
576-
</property>
577-
<property name="checked">
578-
<bool>false</bool>
579-
</property>
580-
<property name="autoDefault">
581-
<bool>false</bool>
582-
</property>
583-
</widget>
584-
</item>
585-
<item>
586-
<widget class="QPushButton" name="butPanSelC">
587-
<property name="minimumSize">
588-
<size>
589-
<width>0</width>
590-
<height>140</height>
591-
</size>
592-
</property>
593-
<property name="text">
594-
<string>Center</string>
595-
</property>
596-
<property name="checkable">
597-
<bool>false</bool>
598-
</property>
599-
<property name="autoDefault">
600-
<bool>false</bool>
601-
</property>
602-
</widget>
603-
</item>
604-
<item>
605-
<widget class="QPushButton" name="butPanSelR">
606-
<property name="minimumSize">
607-
<size>
608-
<width>0</width>
609-
<height>140</height>
610-
</size>
611-
</property>
612-
<property name="text">
613-
<string>Right</string>
614-
</property>
615-
<property name="checkable">
616-
<bool>false</bool>
617-
</property>
618-
<property name="autoDefault">
619-
<bool>false</bool>
620-
</property>
621-
</widget>
622-
</item>
623-
</layout>
624-
</item>
625-
<item>
626-
<widget class="QPushButton" name="butGlobalInfoButton">
627-
<property name="sizePolicy">
628-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
629-
<horstretch>0</horstretch>
630-
<verstretch>0</verstretch>
631-
</sizepolicy>
632-
</property>
633-
<property name="text">
634-
<string>MUTED (Other people won't hear you)</string>
635-
</property>
636-
<property name="flat">
637-
<bool>true</bool>
638-
</property>
639-
</widget>
640-
</item>
641594
<item>
642595
<layout class="QVBoxLayout" name="verticalLayout">
643596
<item>

0 commit comments

Comments
 (0)