CMultiColorLEDBar -> CLevelMeter
This commit is contained in:
parent
b082fde2e7
commit
50ce30f236
8 changed files with 66 additions and 66 deletions
|
@ -33,32 +33,32 @@ CChannelFader::CChannelFader ( QWidget* pNW )
|
||||||
// create new GUI control objects and store pointers to them (note that
|
// create new GUI control objects and store pointers to them (note that
|
||||||
// QWidget takes the ownership of the pMainGrid so that this only has
|
// QWidget takes the ownership of the pMainGrid so that this only has
|
||||||
// to be created locally in this constructor)
|
// to be created locally in this constructor)
|
||||||
pFrame = new QFrame ( pNW );
|
pFrame = new QFrame ( pNW );
|
||||||
|
|
||||||
pLevelsBox = new QWidget ( pFrame );
|
pLevelsBox = new QWidget ( pFrame );
|
||||||
plbrChannelLevel = new CMultiColorLEDBar ( pLevelsBox );
|
plbrChannelLevel = new CLevelMeter ( pLevelsBox );
|
||||||
pFader = new QSlider ( Qt::Vertical, pLevelsBox );
|
pFader = new QSlider ( Qt::Vertical, pLevelsBox );
|
||||||
pPan = new QDial ( pLevelsBox );
|
pPan = new QDial ( pLevelsBox );
|
||||||
pPanLabel = new QLabel ( tr ( "Pan" ), pLevelsBox );
|
pPanLabel = new QLabel ( tr ( "Pan" ), pLevelsBox );
|
||||||
pInfoLabel = new QLabel ( "", pLevelsBox );
|
pInfoLabel = new QLabel ( "", pLevelsBox );
|
||||||
|
|
||||||
pMuteSoloBox = new QWidget ( pFrame );
|
pMuteSoloBox = new QWidget ( pFrame );
|
||||||
pcbMute = new QCheckBox ( tr ( "Mute" ), pMuteSoloBox );
|
pcbMute = new QCheckBox ( tr ( "Mute" ), pMuteSoloBox );
|
||||||
pcbSolo = new QCheckBox ( tr ( "Solo" ), pMuteSoloBox );
|
pcbSolo = new QCheckBox ( tr ( "Solo" ), pMuteSoloBox );
|
||||||
pcbGroup = new QCheckBox ( tr ( "Grp" ), pMuteSoloBox );
|
pcbGroup = new QCheckBox ( tr ( "Grp" ), pMuteSoloBox );
|
||||||
|
|
||||||
pLabelInstBox = new QGroupBox ( pFrame );
|
pLabelInstBox = new QGroupBox ( pFrame );
|
||||||
plblLabel = new QLabel ( "", pFrame );
|
plblLabel = new QLabel ( "", pFrame );
|
||||||
plblInstrument = new QLabel ( pFrame );
|
plblInstrument = new QLabel ( pFrame );
|
||||||
plblCountryFlag = new QLabel ( pFrame );
|
plblCountryFlag = new QLabel ( pFrame );
|
||||||
|
|
||||||
QVBoxLayout* pMainGrid = new QVBoxLayout ( pFrame );
|
QVBoxLayout* pMainGrid = new QVBoxLayout ( pFrame );
|
||||||
QHBoxLayout* pLevelsGrid = new QHBoxLayout ( pLevelsBox );
|
QHBoxLayout* pLevelsGrid = new QHBoxLayout ( pLevelsBox );
|
||||||
QVBoxLayout* pMuteSoloGrid = new QVBoxLayout ( pMuteSoloBox );
|
QVBoxLayout* pMuteSoloGrid = new QVBoxLayout ( pMuteSoloBox );
|
||||||
pLabelGrid = new QHBoxLayout ( pLabelInstBox );
|
pLabelGrid = new QHBoxLayout ( pLabelInstBox );
|
||||||
pLabelPictGrid = new QVBoxLayout ( );
|
pLabelPictGrid = new QVBoxLayout ( );
|
||||||
QVBoxLayout* pPanGrid = new QVBoxLayout ( );
|
QVBoxLayout* pPanGrid = new QVBoxLayout ( );
|
||||||
QHBoxLayout* pPanInfoGrid = new QHBoxLayout ( );
|
QHBoxLayout* pPanInfoGrid = new QHBoxLayout ( );
|
||||||
|
|
||||||
// setup channel level
|
// setup channel level
|
||||||
plbrChannelLevel->setContentsMargins ( 0, 3, 2, 3 );
|
plbrChannelLevel->setContentsMargins ( 0, 3, 2, 3 );
|
||||||
|
@ -211,7 +211,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
|
||||||
pcbMute->setText ( tr ( "MUTE" ) );
|
pcbMute->setText ( tr ( "MUTE" ) );
|
||||||
pcbSolo->setText ( tr ( "SOLO" ) );
|
pcbSolo->setText ( tr ( "SOLO" ) );
|
||||||
pcbGroup->setText ( tr ( "GRP" ) );
|
pcbGroup->setText ( tr ( "GRP" ) );
|
||||||
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
|
plbrChannelLevel->SetLevelMeterType ( CLevelMeter::MT_LED );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GD_SLIMFADER:
|
case GD_SLIMFADER:
|
||||||
|
@ -225,7 +225,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
|
||||||
pcbMute->setText ( tr ( "M" ) );
|
pcbMute->setText ( tr ( "M" ) );
|
||||||
pcbSolo->setText ( tr ( "S" ) );
|
pcbSolo->setText ( tr ( "S" ) );
|
||||||
pcbGroup->setText ( tr ( "G" ) );
|
pcbGroup->setText ( tr ( "G" ) );
|
||||||
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_SLIM_BAR );
|
plbrChannelLevel->SetLevelMeterType ( CLevelMeter::MT_SLIM_BAR );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -240,7 +240,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
|
||||||
pcbMute->setText ( tr ( "Mute" ) );
|
pcbMute->setText ( tr ( "Mute" ) );
|
||||||
pcbSolo->setText ( tr ( "Solo" ) );
|
pcbSolo->setText ( tr ( "Solo" ) );
|
||||||
pcbGroup->setText ( tr ( "Grp" ) );
|
pcbGroup->setText ( tr ( "Grp" ) );
|
||||||
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR );
|
plbrChannelLevel->SetLevelMeterType ( CLevelMeter::MT_BAR );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,32 +87,32 @@ protected:
|
||||||
void SendFaderLevelToServer ( const int iLevel,
|
void SendFaderLevelToServer ( const int iLevel,
|
||||||
const bool bIsGroupUpdate );
|
const bool bIsGroupUpdate );
|
||||||
|
|
||||||
QFrame* pFrame;
|
QFrame* pFrame;
|
||||||
|
|
||||||
QWidget* pLevelsBox;
|
QWidget* pLevelsBox;
|
||||||
QWidget* pMuteSoloBox;
|
QWidget* pMuteSoloBox;
|
||||||
CMultiColorLEDBar* plbrChannelLevel;
|
CLevelMeter* plbrChannelLevel;
|
||||||
QSlider* pFader;
|
QSlider* pFader;
|
||||||
QDial* pPan;
|
QDial* pPan;
|
||||||
QLabel* pPanLabel;
|
QLabel* pPanLabel;
|
||||||
QLabel* pInfoLabel;
|
QLabel* pInfoLabel;
|
||||||
QHBoxLayout* pLabelGrid;
|
QHBoxLayout* pLabelGrid;
|
||||||
QVBoxLayout* pLabelPictGrid;
|
QVBoxLayout* pLabelPictGrid;
|
||||||
|
|
||||||
QCheckBox* pcbMute;
|
QCheckBox* pcbMute;
|
||||||
QCheckBox* pcbSolo;
|
QCheckBox* pcbSolo;
|
||||||
QCheckBox* pcbGroup;
|
QCheckBox* pcbGroup;
|
||||||
|
|
||||||
QGroupBox* pLabelInstBox;
|
QGroupBox* pLabelInstBox;
|
||||||
QLabel* plblLabel;
|
QLabel* plblLabel;
|
||||||
QLabel* plblInstrument;
|
QLabel* plblInstrument;
|
||||||
QLabel* plblCountryFlag;
|
QLabel* plblCountryFlag;
|
||||||
|
|
||||||
CChannelInfo cReceivedChanInfo;
|
CChannelInfo cReceivedChanInfo;
|
||||||
|
|
||||||
bool bOtherChannelIsSolo;
|
bool bOtherChannelIsSolo;
|
||||||
bool bIsMyOwnFader;
|
bool bIsMyOwnFader;
|
||||||
int iPreviousFaderLevel;
|
int iPreviousFaderLevel;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void OnLevelValueChanged ( int value ) { SendFaderLevelToServer ( value, false ); }
|
void OnLevelValueChanged ( int value ) { SendFaderLevelToServer ( value, false ); }
|
||||||
|
|
|
@ -1212,8 +1212,8 @@ rbtReverbSelR->setStyleSheet ( "color: rgb(220, 220, 220);"
|
||||||
"font: bold;" );
|
"font: bold;" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lbrInputLevelL->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
|
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_LED );
|
||||||
lbrInputLevelR->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
|
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_LED );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -1226,8 +1226,8 @@ rbtReverbSelL->setStyleSheet ( "" );
|
||||||
rbtReverbSelR->setStyleSheet ( "" );
|
rbtReverbSelR->setStyleSheet ( "" );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
lbrInputLevelL->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR );
|
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_BAR );
|
||||||
lbrInputLevelR->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR );
|
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_BAR );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -240,7 +240,7 @@
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="CMultiColorLEDBar" name="lbrInputLevelL" native="true">
|
<widget class="CLevelMeter" name="lbrInputLevelL" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -256,7 +256,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="CMultiColorLEDBar" name="lbrInputLevelR" native="true">
|
<widget class="CLevelMeter" name="lbrInputLevelR" native="true">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
<sizepolicy hsizetype="Fixed" vsizetype="Expanding">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
|
@ -574,7 +574,7 @@
|
||||||
<header>audiomixerboard.h</header>
|
<header>audiomixerboard.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>CMultiColorLEDBar</class>
|
<class>CLevelMeter</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header>levelmeter.h</header>
|
<header>levelmeter.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
|
|
|
@ -171,7 +171,7 @@ LED bar: lbr
|
||||||
#define LOW_BOUND_SIG_METER ( -50.0 ) // dB
|
#define LOW_BOUND_SIG_METER ( -50.0 ) // dB
|
||||||
#define UPPER_BOUND_SIG_METER ( 0.0 ) // dB
|
#define UPPER_BOUND_SIG_METER ( 0.0 ) // dB
|
||||||
|
|
||||||
// defines for LED level meter CMultiColorLEDBar
|
// defines for LED level meter CLevelMeter
|
||||||
#define NUM_STEPS_LED_BAR 8
|
#define NUM_STEPS_LED_BAR 8
|
||||||
#define RED_BOUND_LED_BAR 7
|
#define RED_BOUND_LED_BAR 7
|
||||||
#define YELLOW_BOUND_LED_BAR 5
|
#define YELLOW_BOUND_LED_BAR 5
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Implementation *************************************************************/
|
/* Implementation *************************************************************/
|
||||||
CMultiColorLEDBar::CMultiColorLEDBar ( QWidget* parent, Qt::WindowFlags f ) :
|
CLevelMeter::CLevelMeter ( QWidget* parent, Qt::WindowFlags f ) :
|
||||||
QWidget ( parent, f ),
|
QWidget ( parent, f ),
|
||||||
eLevelMeterType ( MT_BAR )
|
eLevelMeterType ( MT_BAR )
|
||||||
{
|
{
|
||||||
|
@ -78,7 +78,7 @@ CMultiColorLEDBar::CMultiColorLEDBar ( QWidget* parent, Qt::WindowFlags f ) :
|
||||||
SetLevelMeterType ( eLevelMeterType );
|
SetLevelMeterType ( eLevelMeterType );
|
||||||
}
|
}
|
||||||
|
|
||||||
CMultiColorLEDBar::~CMultiColorLEDBar()
|
CLevelMeter::~CLevelMeter()
|
||||||
{
|
{
|
||||||
// clean up the LED objects
|
// clean up the LED objects
|
||||||
for ( int iLEDIdx = 0; iLEDIdx < NUM_STEPS_LED_BAR; iLEDIdx++ )
|
for ( int iLEDIdx = 0; iLEDIdx < NUM_STEPS_LED_BAR; iLEDIdx++ )
|
||||||
|
@ -87,7 +87,7 @@ CMultiColorLEDBar::~CMultiColorLEDBar()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiColorLEDBar::changeEvent ( QEvent* curEvent )
|
void CLevelMeter::changeEvent ( QEvent* curEvent )
|
||||||
{
|
{
|
||||||
// act on enabled changed state
|
// act on enabled changed state
|
||||||
if ( curEvent->type() == QEvent::EnabledChange )
|
if ( curEvent->type() == QEvent::EnabledChange )
|
||||||
|
@ -97,7 +97,7 @@ void CMultiColorLEDBar::changeEvent ( QEvent* curEvent )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiColorLEDBar::Reset ( const bool bEnabled )
|
void CLevelMeter::Reset ( const bool bEnabled )
|
||||||
{
|
{
|
||||||
// update state of all LEDs
|
// update state of all LEDs
|
||||||
for ( int iLEDIdx = 0; iLEDIdx < NUM_STEPS_LED_BAR; iLEDIdx++ )
|
for ( int iLEDIdx = 0; iLEDIdx < NUM_STEPS_LED_BAR; iLEDIdx++ )
|
||||||
|
@ -114,7 +114,7 @@ void CMultiColorLEDBar::Reset ( const bool bEnabled )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiColorLEDBar::SetLevelMeterType ( const ELevelMeterType eNType )
|
void CLevelMeter::SetLevelMeterType ( const ELevelMeterType eNType )
|
||||||
{
|
{
|
||||||
eLevelMeterType = eNType;
|
eLevelMeterType = eNType;
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ void CMultiColorLEDBar::SetLevelMeterType ( const ELevelMeterType eNType )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiColorLEDBar::setValue ( const double dValue )
|
void CLevelMeter::setValue ( const double dValue )
|
||||||
{
|
{
|
||||||
if ( this->isEnabled() )
|
if ( this->isEnabled() )
|
||||||
{
|
{
|
||||||
|
@ -200,7 +200,7 @@ void CMultiColorLEDBar::setValue ( const double dValue )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CMultiColorLEDBar::cLED::cLED ( QWidget* parent ) :
|
CLevelMeter::cLED::cLED ( QWidget* parent ) :
|
||||||
BitmCubeRoundBlack ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDBlackSmall.png" ) ),
|
BitmCubeRoundBlack ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDBlackSmall.png" ) ),
|
||||||
BitmCubeRoundGreen ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDGreenSmall.png" ) ),
|
BitmCubeRoundGreen ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDGreenSmall.png" ) ),
|
||||||
BitmCubeRoundYellow ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDYellowSmall.png" ) ),
|
BitmCubeRoundYellow ( QString::fromUtf8 ( ":/png/LEDs/res/HLEDYellowSmall.png" ) ),
|
||||||
|
@ -214,7 +214,7 @@ CMultiColorLEDBar::cLED::cLED ( QWidget* parent ) :
|
||||||
eCurLightColor = RL_BLACK;
|
eCurLightColor = RL_BLACK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMultiColorLEDBar::cLED::setColor ( const ELightColor eNewColor )
|
void CLevelMeter::cLED::setColor ( const ELightColor eNewColor )
|
||||||
{
|
{
|
||||||
// only update LED if color has changed
|
// only update LED if color has changed
|
||||||
if ( eNewColor != eCurLightColor )
|
if ( eNewColor != eCurLightColor )
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
|
|
||||||
|
|
||||||
/* Classes ********************************************************************/
|
/* Classes ********************************************************************/
|
||||||
class CMultiColorLEDBar : public QWidget
|
class CLevelMeter : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
@ -47,8 +47,8 @@ public:
|
||||||
MT_SLIM_BAR
|
MT_SLIM_BAR
|
||||||
};
|
};
|
||||||
|
|
||||||
CMultiColorLEDBar ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
CLevelMeter ( QWidget* parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||||
virtual ~CMultiColorLEDBar();
|
virtual ~CLevelMeter();
|
||||||
|
|
||||||
void setValue ( const double dValue );
|
void setValue ( const double dValue );
|
||||||
void SetLevelMeterType ( const ELevelMeterType eNType );
|
void SetLevelMeterType ( const ELevelMeterType eNType );
|
||||||
|
|
|
@ -358,7 +358,7 @@ CONNECTION LESS MESSAGES
|
||||||
n is number of connected clients
|
n is number of connected clients
|
||||||
|
|
||||||
the values are the maximum channel levels for a client frame converted
|
the values are the maximum channel levels for a client frame converted
|
||||||
to the range of CMultiColorLEDBar in 4 bits, two entries per byte
|
to the range of CLevelMeter in 4 bits, two entries per byte
|
||||||
with the earlier channel in the lower half of the byte
|
with the earlier channel in the lower half of the byte
|
||||||
|
|
||||||
where an odd number of clients is connected, there will be four unused
|
where an odd number of clients is connected, there will be four unused
|
||||||
|
|
Loading…
Reference in a new issue