From e5ac6cdcb3c4408c7dcd74befc90c69e7bf1e9ce Mon Sep 17 00:00:00 2001 From: DonC Date: Tue, 23 Feb 2021 16:17:59 +0100 Subject: [PATCH 1/3] Simpler Recording Indication In class audiomixerboard: - added EGUIDesign eDesign to save GUI design - in UpdateTitle added setStyleSheet - in HideAll (in lieu of Disconnect) added setStyleSheet --- src/audiomixerboard.cpp | 16 ++++++++++++++++ src/audiomixerboard.h | 1 + 2 files changed, 17 insertions(+) diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index bb584646e4..1d25a103f9 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -837,6 +837,7 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent ) : iNumMixerPanelRows ( 1 ), strServerName ( "" ), eRecorderState ( RS_UNDEFINED ), + eDesign ( GD_ORIGINAL ), eChSortType ( ST_NO_SORT ) { // add group box and hboxlayout @@ -938,6 +939,8 @@ void CAudioMixerBoard::SetServerName ( const QString& strNewServerName ) void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign ) { + eDesign = eNewDesign; + // move the channels tighter together in slim fader mode if ( eNewDesign == GD_SLIMFADER ) { @@ -995,6 +998,9 @@ void CAudioMixerBoard::HideAll() // use original order of channel (by server ID) ChangeFaderOrder ( ST_NO_SORT ); + // Reset recording indication styleSheet + setStyleSheet( "" ); + // emit status of connected clients emit NumClientsChanged ( 0 ); // -> no clients connected } @@ -1099,6 +1105,16 @@ void CAudioMixerBoard::UpdateTitle() if ( eRecorderState == RS_RECORDING ) { strTitlePrefix = "[" + tr ( "RECORDING ACTIVE" ) + "] "; + setStyleSheet ( + "QGroupBox::title { subcontrol-origin: margin; " + " subcontrol-position: left top;" + " left: 7px;" + " color: rgb(255,255,255);" + " background-color: rgb(255,0,0); }" ); + } + else + { + setStyleSheet ( "" ); } setTitle ( strTitlePrefix + tr ( "Personal Mix at: " ) + strServerName ); diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index b67a11d5ab..0cd4feed03 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -264,6 +264,7 @@ class CAudioMixerBoard : int iNumMixerPanelRows; QString strServerName; ERecorderState eRecorderState; + EGUIDesign eDesign; QMutex Mutex; EChSortType eChSortType; From b2d7d99f41b49882572eb5e650e855238e0babac Mon Sep 17 00:00:00 2001 From: DonC Date: Wed, 24 Feb 2021 11:29:30 +0100 Subject: [PATCH 2/3] Placed recording style in a define --- src/audiomixerboard.cpp | 7 +------ src/audiomixerboard.h | 5 +++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 1d25a103f9..c6d6b10de4 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -1105,12 +1105,7 @@ void CAudioMixerBoard::UpdateTitle() if ( eRecorderState == RS_RECORDING ) { strTitlePrefix = "[" + tr ( "RECORDING ACTIVE" ) + "] "; - setStyleSheet ( - "QGroupBox::title { subcontrol-origin: margin; " - " subcontrol-position: left top;" - " left: 7px;" - " color: rgb(255,255,255);" - " background-color: rgb(255,0,0); }" ); + setStyleSheet ( AM_RECORDING_STYLE ); } else { diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 0cd4feed03..5fb6cf1dd7 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -184,6 +184,11 @@ class CAudioMixerBoardSlots : public CAudioMixerBoardSlots template<> class CAudioMixerBoardSlots<0> {}; +#define AM_RECORDING_STYLE "QGroupBox::title { subcontrol-origin: margin; \ + subcontrol-position: left top; \ + left: 7px; \ + color: rgb(255,255,255); \ + background-color: rgb(255,0,0); }" class CAudioMixerBoard : public QGroupBox, From 4328c34f399de8a89e37d5652f5519091dc59419 Mon Sep 17 00:00:00 2001 From: DonC Date: Wed, 24 Feb 2021 11:41:58 +0100 Subject: [PATCH 3/3] Removed unused variable eDesign in AudioMixerBoard class --- src/audiomixerboard.cpp | 3 --- src/audiomixerboard.h | 1 - 2 files changed, 4 deletions(-) diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index c6d6b10de4..c2371bf039 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -837,7 +837,6 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent ) : iNumMixerPanelRows ( 1 ), strServerName ( "" ), eRecorderState ( RS_UNDEFINED ), - eDesign ( GD_ORIGINAL ), eChSortType ( ST_NO_SORT ) { // add group box and hboxlayout @@ -939,8 +938,6 @@ void CAudioMixerBoard::SetServerName ( const QString& strNewServerName ) void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign ) { - eDesign = eNewDesign; - // move the channels tighter together in slim fader mode if ( eNewDesign == GD_SLIMFADER ) { diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h index 5fb6cf1dd7..71f5cf0a14 100755 --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -269,7 +269,6 @@ class CAudioMixerBoard : int iNumMixerPanelRows; QString strServerName; ERecorderState eRecorderState; - EGUIDesign eDesign; QMutex Mutex; EChSortType eChSortType;