@@ -79,8 +79,10 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
79
79
QString strInpLevHAccDescr = tr ( " Simulates an analog LED level meter." );
80
80
81
81
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." );
84
86
lbrInputLevelL->setWhatsThis ( strInpLevH );
85
87
lbrInputLevelL->setAccessibleName ( strInpLevHAccText );
86
88
lbrInputLevelL->setAccessibleDescription ( strInpLevHAccDescr );
@@ -263,13 +265,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
263
265
lblGlobalInfoLabel->setStyleSheet ( " .QLabel { background: red; }" );
264
266
lblGlobalInfoLabel->hide ();
265
267
266
- // prepare Mute Myself push button (invisible by default)
267
- butGlobalInfoButton->hide ();
268
-
269
268
// setup shortcut for Left, Center, Right and Mute button only NumPad numbers accepted
270
269
chbLocalMute->setShortcut ( Qt::Key_0 + Qt::KeypadModifier );
271
270
butPanSelL->setShortcut ( Qt::Key_1 + Qt::KeypadModifier );
272
- butPanSelC->setShortcut ( Qt::Key_2 + Qt::KeypadModifier );
273
271
butPanSelR->setShortcut ( Qt::Key_3 + Qt::KeypadModifier );
274
272
275
273
// prepare update check info label (invisible by default)
@@ -455,13 +453,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
455
453
// push buttons
456
454
QObject::connect ( butConnect, &QPushButton::clicked, this , &CClientDlg::OnConnectDisconBut );
457
455
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 );
463
457
464
- QObject::connect ( butPanSelR, &QPushButton::clicked , this , &CClientDlg::OnButtonPanSelRClicked );
458
+ QObject::connect ( butPanSelR, &QPushButton::toggled , this , &CClientDlg::OnButtonPanSelRToggled );
465
459
466
460
// check boxes
467
461
QObject::connect ( chbSettings, &QCheckBox::stateChanged, this , &CClientDlg::OnSettingsStateChanged );
@@ -1058,12 +1052,10 @@ void CClientDlg::OnLocalMuteStateChanged ( int value )
1058
1052
if ( value == Qt::Checked )
1059
1053
{
1060
1054
lblGlobalInfoLabel->show ();
1061
- // butGlobalInfoButton->show();
1062
1055
}
1063
1056
else
1064
1057
{
1065
1058
lblGlobalInfoLabel->hide ();
1066
- // butGlobalInfoButton->hide();
1067
1059
}
1068
1060
}
1069
1061
@@ -1378,16 +1370,9 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
1378
1370
" QCheckBox { color: rgb(220, 220, 220);"
1379
1371
" font: bold; }" );
1380
1372
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;}" );
1384
1375
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;" );
1391
1376
#ifdef _WIN32
1392
1377
// Workaround QT-Windows problem: This should not be necessary since in the
1393
1378
// background frame the style sheet for QRadioButton was already set. But it
@@ -1406,14 +1391,9 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
1406
1391
default :
1407
1392
// reset style sheet and set original parameters
1408
1393
backgroundFrame->setStyleSheet ( " " );
1409
- butGlobalInfoButton->setStyleSheet ( " background: red;"
1410
- " border: none;"
1411
- " padding-left: 6px;"
1412
- " padding-right: 6px;" );
1413
1394
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;}" );
1417
1397
1418
1398
#ifdef _WIN32
1419
1399
// Workaround QT-Windows problem: See above description
@@ -1536,38 +1516,82 @@ void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, c
1536
1516
ledDelay->SetLight ( eOverallDelayLEDColor );
1537
1517
}
1538
1518
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
+
1539
1561
void CClientDlg::ButtonUpdate ()
1540
1562
{
1541
1563
int value = pClient->GetAudioInFader ();
1542
1564
1543
1565
switch ( value )
1544
1566
{
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
-
1552
1567
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 );
1557
1575
break ;
1558
1576
1559
1577
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 );
1564
1585
break ;
1565
1586
1566
1587
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 );
1571
1595
break ;
1572
1596
}
1573
1597
}
0 commit comments