enable pan if supported by the server (check server version)

This commit is contained in:
Volker Fischer 2020-05-19 18:28:52 +02:00
parent 5b7ccfcdc2
commit 546e3f96e0
4 changed files with 46 additions and 20 deletions

View File

@ -39,7 +39,8 @@ CChannelFader::CChannelFader ( QWidget* pNW,
pLevelsBox = new QWidget ( pFrame );
plbrChannelLevel = new CMultiColorLEDBar ( pLevelsBox );
pFader = new QSlider ( Qt::Vertical, pLevelsBox );
pPan = new QSlider ( Qt::Horizontal, pLevelsBox );
pPan = new QDial ( pLevelsBox );
pPanLabel = new QLabel ( tr ( "Pan" ) , pLevelsBox );
pMuteSoloBox = new QWidget ( pFrame );
pcbMute = new QCheckBox ( tr ( "Mute" ), pMuteSoloBox );
@ -60,14 +61,17 @@ CChannelFader::CChannelFader ( QWidget* pNW,
plbrChannelLevel->setContentsMargins ( 0, 3, 2, 3 );
// setup slider
pFader->setPageStep ( 1 );
pFader->setTickPosition ( QSlider::TicksBothSides );
pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
pFader->setPageStep ( 1 );
pFader->setTickPosition ( QSlider::TicksBothSides );
pFader->setRange ( 0, AUD_MIX_FADER_MAX );
pFader->setTickInterval ( AUD_MIX_FADER_MAX / 9 );
pFader->setMinimumHeight ( 90 );
// setup panning slider
// setup panning control
pPan->setRange ( 0, AUD_MIX_PAN_MAX );
pPan->setValue ( AUD_MIX_PAN_MAX / 2 );
pPan->setFixedSize ( 55, 55 );
pPan->setNotchesVisible ( true );
// setup fader tag label (black bold text which is centered)
plblLabel->setTextFormat ( Qt::PlainText );
@ -101,7 +105,8 @@ CChannelFader::CChannelFader ( QWidget* pNW,
pMuteSoloGrid->addWidget ( pcbMute, 0, Qt::AlignLeft );
pMuteSoloGrid->addWidget ( pcbSolo, 0, Qt::AlignLeft );
pMainGrid->addWidget ( pPan, 0, Qt::AlignCenter );
pMainGrid->addWidget ( pPanLabel, 0, Qt::AlignLeft );
pMainGrid->addWidget ( pPan, 0, Qt::AlignHCenter );
pMainGrid->addWidget ( pLevelsBox, 0, Qt::AlignHCenter );
pMainGrid->addWidget ( pMuteSoloBox, 0, Qt::AlignHCenter );
pMainGrid->addWidget ( pLabelInstBox );
@ -186,6 +191,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
" padding-bottom: -15px; }"
"QSlider::handle { image: url(:/png/fader/res/faderhandle.png); }" );
pPanLabel->setText ( tr ( "PAN" ) );
pcbMute->setText ( tr ( "MUTE" ) );
pcbSolo->setText ( tr ( "SOLO" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
@ -194,6 +200,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
default:
// reset style sheet and set original paramters
pFader->setStyleSheet ( "" );
pPanLabel->setText ( tr ( "Pan" ) );
pcbMute->setText ( tr ( "Mute" ) );
pcbSolo->setText ( tr ( "Solo" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR );
@ -211,6 +218,12 @@ bool CChannelFader::GetDisplayChannelLevel()
return !plbrChannelLevel->isHidden();
}
void CChannelFader::SetDisplayPans ( const bool eNDP )
{
pPanLabel->setHidden ( !eNDP );
pPan->setHidden ( !eNDP );
}
void CChannelFader::SetupFaderTag ( const ESkillLevel eSkillLevel )
{
// setup group box for label/instrument picture: set a thick black border
@ -587,8 +600,6 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
setMinimumWidth ( 200 ); // at least two faders shall be visible
setWidget ( pGroupBox );
setWidgetResizable ( true ); // make sure it fills the entire scroll area
setVerticalScrollBarPolicy ( Qt::ScrollBarAlwaysOff );
setHorizontalScrollBarPolicy ( Qt::ScrollBarAsNeeded );
setFrameShape ( QFrame::NoFrame );
@ -668,6 +679,14 @@ void CAudioMixerBoard::SetDisplayChannelLevels ( const bool eNDCL )
}
}
void CAudioMixerBoard::SetPanIsSupported()
{
for ( int i = 0; i < MAX_NUM_CHANNELS; i++ )
{
vecpChanFader[i]->SetDisplayPans ( true );
}
}
void CAudioMixerBoard::HideAll()
{
// make all controls invisible
@ -678,6 +697,7 @@ void CAudioMixerBoard::HideAll()
vecpChanFader[i]->SetChannelLevel ( 0 );
vecpChanFader[i]->SetDisplayChannelLevel ( false );
vecpChanFader[i]->SetDisplayPans ( false );
vecpChanFader[i]->Hide();
}

View File

@ -32,6 +32,7 @@
#include <QLayout>
#include <QString>
#include <QSlider>
#include <QDial>
#include <QSizePolicy>
#include <QHostAddress>
#include "global.h"
@ -58,6 +59,7 @@ public:
void SetGUIDesign ( const EGUIDesign eNewDesign );
void SetDisplayChannelLevel ( const bool eNDCL );
bool GetDisplayChannelLevel();
void SetDisplayPans ( const bool eNDP );
void UpdateSoloState ( const bool bNewOtherSoloState );
void SetFaderLevel ( const int iLevel );
@ -82,7 +84,8 @@ protected:
QWidget* pMuteSoloBox;
CMultiColorLEDBar* plbrChannelLevel;
QSlider* pFader;
QSlider* pPan;
QDial* pPan;
QLabel* pPanLabel;
QCheckBox* pcbMute;
QCheckBox* pcbSolo;
@ -139,6 +142,7 @@ public:
void SetServerName ( const QString& strNewServerName );
void SetGUIDesign ( const EGUIDesign eNewDesign );
void SetDisplayChannelLevels ( const bool eNDCL );
void SetPanIsSupported();
void SetFaderLevel ( const int iChannelIdx,
const int iValue );

View File

@ -753,17 +753,16 @@ void CClientDlg::OnCentralServerAddressTypeChanged()
}
}
void CClientDlg::OnVersionAndOSReceived ( COSUtil::EOpSystemType eOSType,
void CClientDlg::OnVersionAndOSReceived ( COSUtil::EOpSystemType ,
QString strVersion )
{
// TODO the implementation of: check for version number if Pan is supported -> enable Pan controls in mixer board if version is sufficient
// TEST
qDebug() << strVersion;
// check if Pan is supported by the server (minimum version is 3.5.4)
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
if ( QVersionNumber::compare ( QVersionNumber::fromString ( strVersion ), QVersionNumber ( 3, 5, 4 ) ) >= 0 )
{
MainMixerBoard->SetPanIsSupported();
}
#endif
}
void CClientDlg::OnChatTextReceived ( QString strChatText )

View File

@ -33,6 +33,9 @@
#include <QRadioButton>
#include <QMenuBar>
#include <QLayout>
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
# include <QVersionNumber>
#endif
#include "global.h"
#include "client.h"
#include "settings.h"
@ -131,7 +134,7 @@ public slots:
const int iValue ) { MainMixerBoard->SetFaderLevel ( iChannelIdx,
iValue ); }
void OnVersionAndOSReceived ( COSUtil::EOpSystemType eOSType,
void OnVersionAndOSReceived ( COSUtil::EOpSystemType ,
QString strVersion );
#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING