@@ -263,11 +263,23 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
263
263
lblGlobalInfoLabel->setStyleSheet ( " .QLabel { background: red; }" );
264
264
lblGlobalInfoLabel->hide ();
265
265
266
+ // prepare Mute Myself push button (invisible by default)
267
+ butGlobalInfoButton->hide ();
268
+
269
+ // setup shortcut for Left, Center, Right and Mute button only NumPad numbers accepted
270
+ chbLocalMute->setShortcut ( Qt::Key_0 + Qt::KeypadModifier );
271
+ butPanSelL->setShortcut ( Qt::Key_1 + Qt::KeypadModifier );
272
+ butPanSelC->setShortcut ( Qt::Key_2 + Qt::KeypadModifier );
273
+ butPanSelR->setShortcut ( Qt::Key_3 + Qt::KeypadModifier );
274
+
266
275
// prepare update check info label (invisible by default)
267
276
lblUpdateCheck->setOpenExternalLinks ( true ); // enables opening a web browser if one clicks on a html link
268
277
lblUpdateCheck->setText ( " <font color=\" red\" ><b>" + APP_UPGRADE_AVAILABLE_MSG_TEXT.arg ( APP_NAME ).arg ( VERSION ) + " </b></font>" );
269
278
lblUpdateCheck->hide ();
270
279
280
+ // init buttons, based on saved settings
281
+ ButtonUpdate ();
282
+
271
283
// setup timers
272
284
TimerCheckAudioDeviceOk.setSingleShot ( true ); // only check once after connection
273
285
TimerDetectFeedback.setSingleShot ( true );
@@ -443,6 +455,14 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
443
455
// push buttons
444
456
QObject::connect ( butConnect, &QPushButton::clicked, this , &CClientDlg::OnConnectDisconBut );
445
457
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 );
463
+
464
+ QObject::connect ( butPanSelR, &QPushButton::clicked, this , &CClientDlg::OnButtonPanSelRClicked );
465
+
446
466
// check boxes
447
467
QObject::connect ( chbSettings, &QCheckBox::stateChanged, this , &CClientDlg::OnSettingsStateChanged );
448
468
@@ -539,6 +559,8 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
539
559
540
560
QObject::connect ( &ConnectDlg, &CConnectDlg::ReqServerListQuery, this , &CClientDlg::OnReqServerListQuery );
541
561
562
+ QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::PanFaderChanged, this , &CClientDlg::ButtonUpdate );
563
+
542
564
// note that this connection must be a queued connection, otherwise the server list ping
543
565
// times are not accurate and the client list may not be retrieved for all servers listed
544
566
// (it seems the sendto() function needs to be called from different threads to fire the
@@ -1036,10 +1058,12 @@ void CClientDlg::OnLocalMuteStateChanged ( int value )
1036
1058
if ( value == Qt::Checked )
1037
1059
{
1038
1060
lblGlobalInfoLabel->show ();
1061
+ // butGlobalInfoButton->show();
1039
1062
}
1040
1063
else
1041
1064
{
1042
1065
lblGlobalInfoLabel->hide ();
1066
+ // butGlobalInfoButton->hide();
1043
1067
}
1044
1068
}
1045
1069
@@ -1354,6 +1378,16 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
1354
1378
" QCheckBox { color: rgb(220, 220, 220);"
1355
1379
" font: bold; }" );
1356
1380
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;}" );
1384
+
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;" );
1357
1391
#ifdef _WIN32
1358
1392
// Workaround QT-Windows problem: This should not be necessary since in the
1359
1393
// background frame the style sheet for QRadioButton was already set. But it
@@ -1372,6 +1406,14 @@ void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
1372
1406
default :
1373
1407
// reset style sheet and set original parameters
1374
1408
backgroundFrame->setStyleSheet ( " " );
1409
+ butGlobalInfoButton->setStyleSheet ( " background: red;"
1410
+ " border: none;"
1411
+ " padding-left: 6px;"
1412
+ " padding-right: 6px;" );
1413
+
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)}" );
1375
1417
1376
1418
#ifdef _WIN32
1377
1419
// Workaround QT-Windows problem: See above description
@@ -1493,3 +1535,39 @@ void CClientDlg::SetPingTime ( const int iPingTime, const int iOverallDelayMs, c
1493
1535
// set current LED status
1494
1536
ledDelay->SetLight ( eOverallDelayLEDColor );
1495
1537
}
1538
+
1539
+ void CClientDlg::ButtonUpdate ()
1540
+ {
1541
+ int value = pClient->GetAudioInFader ();
1542
+
1543
+ switch ( value )
1544
+ {
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
+ case AUD_FADER_IN_MIN:
1553
+ // right channel only
1554
+ butPanSelL->setEnabled ( false );
1555
+ butPanSelC->setEnabled ( true );
1556
+ butPanSelR->setEnabled ( true );
1557
+ break ;
1558
+
1559
+ case AUD_FADER_IN_MAX:
1560
+ // left channel oonly
1561
+ butPanSelL->setEnabled ( true );
1562
+ butPanSelC->setEnabled ( true );
1563
+ butPanSelR->setEnabled ( false );
1564
+ break ;
1565
+
1566
+ default :
1567
+ // not L, C or R so enable all buttons
1568
+ butPanSelL->setEnabled ( true );
1569
+ butPanSelC->setEnabled ( true );
1570
+ butPanSelR->setEnabled ( true );
1571
+ break ;
1572
+ }
1573
+ }
0 commit comments