Merge pull request #379 from Alberstein8/master

New Select switch to change several faders like one
This commit is contained in:
Volker Fischer 2020-06-20 17:31:10 +02:00 committed by GitHub
commit d6759e4d92
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 80 additions and 5 deletions

View file

@ -45,6 +45,7 @@ CChannelFader::CChannelFader ( QWidget* pNW )
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 );
pcbSelect = new QCheckBox ( tr ( "Select"), pMuteSoloBox );
pLabelInstBox = new QGroupBox ( pFrame ); pLabelInstBox = new QGroupBox ( pFrame );
plblLabel = new QLabel ( "", pFrame ); plblLabel = new QLabel ( "", pFrame );
@ -108,6 +109,7 @@ CChannelFader::CChannelFader ( QWidget* pNW )
pMuteSoloGrid->addWidget ( pcbMute, 0, Qt::AlignLeft ); pMuteSoloGrid->addWidget ( pcbMute, 0, Qt::AlignLeft );
pMuteSoloGrid->addWidget ( pcbSolo, 0, Qt::AlignLeft ); pMuteSoloGrid->addWidget ( pcbSolo, 0, Qt::AlignLeft );
pMuteSoloGrid->addWidget ( pcbSelect, 0, Qt::AlignLeft );
pMainGrid->addLayout ( pPanGrid ); pMainGrid->addLayout ( pPanGrid );
pMainGrid->addWidget ( pLevelsBox, 0, Qt::AlignHCenter ); pMainGrid->addWidget ( pLevelsBox, 0, Qt::AlignHCenter );
@ -152,6 +154,13 @@ CChannelFader::CChannelFader ( QWidget* pNW )
"one channel to solo." ) ); "one channel to solo." ) );
pcbSolo->setAccessibleName ( tr ( "Solo button" ) ); pcbSolo->setAccessibleName ( tr ( "Solo button" ) );
pcbSelect->setWhatsThis ( "<b>" + tr ( "Select" ) + ":</b> " + tr ( "With the Select checkbox, the "
"audio channel can be selected among others which means that all changes "
" made in any of the selected channels' fader are adjusted to the rest like all were the same "
) );
pcbSelect->setAccessibleName ( tr ( "Select button" ) );
QString strFaderText = "<b>" + tr ( "Fader Tag" ) + ":</b> " + tr ( "The fader tag " QString strFaderText = "<b>" + tr ( "Fader Tag" ) + ":</b> " + tr ( "The fader tag "
"identifies the connected client. The tag name, a picture of your " "identifies the connected client. The tag name, a picture of your "
"instrument and the flag of your country can be set in the main window." ); "instrument and the flag of your country can be set in the main window." );
@ -176,6 +185,9 @@ CChannelFader::CChannelFader ( QWidget* pNW )
QObject::connect ( pcbSolo, &QCheckBox::stateChanged, QObject::connect ( pcbSolo, &QCheckBox::stateChanged,
this, &CChannelFader::soloStateChanged ); this, &CChannelFader::soloStateChanged );
QObject::connect ( pcbSelect, &QCheckBox::stateChanged,
this, &CChannelFader::OnSelectStateChanged );
} }
void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign ) void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
@ -202,6 +214,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
pPanLabel->setText ( tr ( "PAN" ) ); pPanLabel->setText ( tr ( "PAN" ) );
pcbMute->setText ( tr ( "MUTE" ) ); pcbMute->setText ( tr ( "MUTE" ) );
pcbSolo->setText ( tr ( "SOLO" ) ); pcbSolo->setText ( tr ( "SOLO" ) );
pcbSelect->setText ( tr ( "SELECT" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_LED ); plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_LED );
break; break;
@ -214,6 +227,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
pPanLabel->setText ( tr ( "Pan" ) ); pPanLabel->setText ( tr ( "Pan" ) );
pcbMute->setText ( tr ( "M" ) ); pcbMute->setText ( tr ( "M" ) );
pcbSolo->setText ( tr ( "S" ) ); pcbSolo->setText ( tr ( "S" ) );
pcbSelect->setText ( tr ( "SL" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_SLIM_BAR ); plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_SLIM_BAR );
break; break;
@ -227,6 +241,7 @@ void CChannelFader::SetGUIDesign ( const EGUIDesign eNewDesign )
pPanLabel->setText ( tr ( "Pan" ) ); pPanLabel->setText ( tr ( "Pan" ) );
pcbMute->setText ( tr ( "Mute" ) ); pcbMute->setText ( tr ( "Mute" ) );
pcbSolo->setText ( tr ( "Solo" ) ); pcbSolo->setText ( tr ( "Solo" ) );
pcbSelect->setText ( tr ( "Select" ) );
plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR ); plbrChannelLevel->SetLevelMeterType ( CMultiColorLEDBar::MT_BAR );
break; break;
} }
@ -302,9 +317,10 @@ void CChannelFader::Reset()
pFader->setValue ( AUD_MIX_FADER_MAX ); pFader->setValue ( AUD_MIX_FADER_MAX );
pPan->setValue ( AUD_MIX_PAN_MAX / 2 ); pPan->setValue ( AUD_MIX_PAN_MAX / 2 );
// reset mute/solo check boxes and level meter // reset mute/solo/select check boxes and level meter
pcbMute->setChecked ( false ); pcbMute->setChecked ( false );
pcbSolo->setChecked ( false ); pcbSolo->setChecked ( false );
pcbSelect->setChecked ( false );
plbrChannelLevel->setValue ( 0 ); plbrChannelLevel->setValue ( 0 );
// clear instrument picture, country flag, tool tips and label text // clear instrument picture, country flag, tool tips and label text
@ -325,6 +341,7 @@ void CChannelFader::Reset()
bOtherChannelIsSolo = false; bOtherChannelIsSolo = false;
bIsMyOwnFader = false; bIsMyOwnFader = false;
bIsSelected = false;
} }
void CChannelFader::SetFaderLevel ( const int iLevel ) void CChannelFader::SetFaderLevel ( const int iLevel )
@ -376,6 +393,11 @@ void CChannelFader::SetRemoteFaderIsMute ( const bool bIsMute )
} }
} }
void CChannelFader::SetFaderIsSelect ( const bool bIsSelected )
{
pcbSelect->setChecked ( bIsSelected );
}
void CChannelFader::SendFaderLevelToServer ( const int iLevel ) void CChannelFader::SendFaderLevelToServer ( const int iLevel )
{ {
// if mute flag is set or other channel is on solo, do not apply the new // if mute flag is set or other channel is on solo, do not apply the new
@ -603,6 +625,17 @@ double CChannelFader::CalcFaderGain ( const int value )
} }
} }
void CChannelFader::OnSelectStateChanged ( int value )
{
// call selecting function
SetSelected ( static_cast<Qt::CheckState> ( value ) == Qt::Checked );
}
void CChannelFader::SetSelected ( const bool bState )
{
// Just in case we need future actions here...
bIsSelected = bState;
}
/******************************************************************************\ /******************************************************************************\
* CAudioMixerBoard * * CAudioMixerBoard *
@ -614,6 +647,7 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
vecStoredPanValues ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_PAN_MAX / 2 ), vecStoredPanValues ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_PAN_MAX / 2 ),
vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ), vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ), vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderIsSelect( MAX_NUM_STORED_FADER_SETTINGS, false ),
iNewClientFaderLevel ( 100 ), iNewClientFaderLevel ( 100 ),
bDisplayPans ( false ), bDisplayPans ( false ),
bIsPanSupported ( false ), bIsPanSupported ( false ),
@ -908,17 +942,20 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInf
int iStoredPanValue; int iStoredPanValue;
bool bStoredFaderIsSolo; bool bStoredFaderIsSolo;
bool bStoredFaderIsMute; bool bStoredFaderIsMute;
bool bStoredFaderIsSelect;
if ( GetStoredFaderSettings ( vecChanInfo[j], if ( GetStoredFaderSettings ( vecChanInfo[j],
iStoredFaderLevel, iStoredFaderLevel,
iStoredPanValue, iStoredPanValue,
bStoredFaderIsSolo, bStoredFaderIsSolo,
bStoredFaderIsMute ) ) bStoredFaderIsMute,
bStoredFaderIsSelect) )
{ {
vecpChanFader[i]->SetFaderLevel ( iStoredFaderLevel ); vecpChanFader[i]->SetFaderLevel ( iStoredFaderLevel );
vecpChanFader[i]->SetPanValue ( iStoredPanValue ); vecpChanFader[i]->SetPanValue ( iStoredPanValue );
vecpChanFader[i]->SetFaderIsSolo ( bStoredFaderIsSolo ); vecpChanFader[i]->SetFaderIsSolo ( bStoredFaderIsSolo );
vecpChanFader[i]->SetFaderIsMute ( bStoredFaderIsMute ); vecpChanFader[i]->SetFaderIsMute ( bStoredFaderIsMute );
vecpChanFader[i]->SetFaderIsSelect ( bStoredFaderIsSelect );
} }
} }
@ -1005,7 +1042,32 @@ void CAudioMixerBoard::UpdateGainValue ( const int iChannelIdx,
const double dValue, const double dValue,
const bool bIsMyOwnFader ) const bool bIsMyOwnFader )
{ {
emit ChangeChanGain ( iChannelIdx, dValue, bIsMyOwnFader ); if ( !vecpChanFader[iChannelIdx]->IsSelect() )
{
emit ChangeChanGain ( iChannelIdx, dValue, bIsMyOwnFader );
}
else // This is selected, so all selected must be updated as well
{
// update current, don't touch fader
emit ChangeChanGain ( iChannelIdx, dValue, bIsMyOwnFader );
for ( int i = MAX_NUM_CHANNELS - 1; i >= 0; i-- )
{
// update rest of faders selected
if ( vecpChanFader[i]->IsSelect() )
{
if ( i != iChannelIdx )
{
// temporaly unselect so it does not repeat this again and again...
vecpChanFader[i]->SetFaderIsSelect( FALSE );
// "move" faders with moving fader level
vecpChanFader[i]->SetFaderLevel( vecpChanFader[iChannelIdx]->GetFaderLevel() );
// back to selected status
vecpChanFader[i]->SetFaderIsSelect( TRUE );
}
}
}
}
} }
void CAudioMixerBoard::UpdatePanValue ( const int iChannelIdx, void CAudioMixerBoard::UpdatePanValue ( const int iChannelIdx,
@ -1024,6 +1086,7 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
CVector<int> viOldStoredPanValues ( vecStoredPanValues ); CVector<int> viOldStoredPanValues ( vecStoredPanValues );
CVector<int> vbOldStoredFaderIsSolo ( vecStoredFaderIsSolo ); CVector<int> vbOldStoredFaderIsSolo ( vecStoredFaderIsSolo );
CVector<int> vbOldStoredFaderIsMute ( vecStoredFaderIsMute ); CVector<int> vbOldStoredFaderIsMute ( vecStoredFaderIsMute );
CVector<int> vbOldStoredFaderIsSelected ( vecStoredFaderIsSelect );
// init temporary list count (may be overwritten later on) // init temporary list count (may be overwritten later on)
int iTempListCnt = 0; int iTempListCnt = 0;
@ -1038,6 +1101,7 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
vecStoredPanValues[0] = pChanFader->GetPanValue(); vecStoredPanValues[0] = pChanFader->GetPanValue();
vecStoredFaderIsSolo[0] = pChanFader->IsSolo(); vecStoredFaderIsSolo[0] = pChanFader->IsSolo();
vecStoredFaderIsMute[0] = pChanFader->IsMute(); vecStoredFaderIsMute[0] = pChanFader->IsMute();
vecStoredFaderIsSelect[0] = pChanFader->IsSelect();
iTempListCnt = 1; iTempListCnt = 1;
for ( int iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ ) for ( int iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
@ -1066,7 +1130,8 @@ bool CAudioMixerBoard::GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
int& iStoredFaderLevel, int& iStoredFaderLevel,
int& iStoredPanValue, int& iStoredPanValue,
bool& bStoredFaderIsSolo, bool& bStoredFaderIsSolo,
bool& bStoredFaderIsMute) bool& bStoredFaderIsMute,
bool& bStoredFaderIsSelect)
{ {
// only do the check if the name string is not empty // only do the check if the name string is not empty
if ( !ChanInfo.strName.isEmpty() ) if ( !ChanInfo.strName.isEmpty() )
@ -1081,6 +1146,7 @@ bool CAudioMixerBoard::GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
iStoredPanValue = vecStoredPanValues[iIdx]; iStoredPanValue = vecStoredPanValues[iIdx];
bStoredFaderIsSolo = vecStoredFaderIsSolo[iIdx] != 0; bStoredFaderIsSolo = vecStoredFaderIsSolo[iIdx] != 0;
bStoredFaderIsMute = vecStoredFaderIsMute[iIdx] != 0; bStoredFaderIsMute = vecStoredFaderIsMute[iIdx] != 0;
bStoredFaderIsSelect = vecStoredFaderIsSelect[iIdx] != 0;
// values found and copied, return OK // values found and copied, return OK
return true; return true;

View file

@ -57,6 +57,7 @@ public:
bool IsVisible() { return !pFrame->isHidden(); } bool IsVisible() { return !pFrame->isHidden(); }
bool IsSolo() { return pcbSolo->isChecked(); } bool IsSolo() { return pcbSolo->isChecked(); }
bool IsMute() { return pcbMute->isChecked(); } bool IsMute() { return pcbMute->isChecked(); }
bool IsSelect() { return pcbSelect->isChecked(); }
void SetGUIDesign ( const EGUIDesign eNewDesign ); void SetGUIDesign ( const EGUIDesign eNewDesign );
void SetDisplayChannelLevel ( const bool eNDCL ); void SetDisplayChannelLevel ( const bool eNDCL );
bool GetDisplayChannelLevel(); bool GetDisplayChannelLevel();
@ -69,6 +70,7 @@ public:
void SetFaderIsSolo ( const bool bIsSolo ); void SetFaderIsSolo ( const bool bIsSolo );
void SetFaderIsMute ( const bool bIsMute ); void SetFaderIsMute ( const bool bIsMute );
void SetRemoteFaderIsMute ( const bool bIsMute ); void SetRemoteFaderIsMute ( const bool bIsMute );
void SetFaderIsSelect ( const bool bIsMute );
int GetFaderLevel() { return pFader->value(); } int GetFaderLevel() { return pFader->value(); }
int GetPanValue() { return pPan->value(); } int GetPanValue() { return pPan->value(); }
void Reset(); void Reset();
@ -81,6 +83,7 @@ protected:
void SendFaderLevelToServer ( const int iLevel ); void SendFaderLevelToServer ( const int iLevel );
void SendPanValueToServer ( const int iPan ); void SendPanValueToServer ( const int iPan );
void SetupFaderTag ( const ESkillLevel eSkillLevel ); void SetupFaderTag ( const ESkillLevel eSkillLevel );
void SetSelected ( const bool bState );
QFrame* pFrame; QFrame* pFrame;
@ -96,6 +99,7 @@ protected:
QCheckBox* pcbMute; QCheckBox* pcbMute;
QCheckBox* pcbSolo; QCheckBox* pcbSolo;
QCheckBox* pcbSelect;
QGroupBox* pLabelInstBox; QGroupBox* pLabelInstBox;
QLabel* plblLabel; QLabel* plblLabel;
@ -106,11 +110,13 @@ protected:
bool bOtherChannelIsSolo; bool bOtherChannelIsSolo;
bool bIsMyOwnFader; bool bIsMyOwnFader;
bool bIsSelected;
public slots: public slots:
void OnLevelValueChanged ( int value ) { SendFaderLevelToServer ( value ); } void OnLevelValueChanged ( int value ) { SendFaderLevelToServer ( value ); }
void OnPanValueChanged ( int value ) { SendPanValueToServer ( value ); } void OnPanValueChanged ( int value ) { SendPanValueToServer ( value ); }
void OnMuteStateChanged ( int value ); void OnMuteStateChanged ( int value );
void OnSelectStateChanged ( int value );
signals: signals:
void gainValueChanged ( double value, bool bIsMyOwnFader ); void gainValueChanged ( double value, bool bIsMyOwnFader );
@ -166,12 +172,14 @@ public:
void SetRecorderState ( const ERecorderState newRecorderState ); void SetRecorderState ( const ERecorderState newRecorderState );
// settings // settings
CVector<QString> vecStoredFaderTags; CVector<QString> vecStoredFaderTags;
CVector<int> vecStoredFaderLevels; CVector<int> vecStoredFaderLevels;
CVector<int> vecStoredPanValues; CVector<int> vecStoredPanValues;
CVector<int> vecStoredFaderIsSolo; CVector<int> vecStoredFaderIsSolo;
CVector<int> vecStoredFaderIsMute; CVector<int> vecStoredFaderIsMute;
CVector<int> vecStoredFaderIsSelect;
int iNewClientFaderLevel; int iNewClientFaderLevel;
protected: protected:
@ -194,7 +202,8 @@ protected:
int& iStoredFaderLevel, int& iStoredFaderLevel,
int& iStoredPanValue, int& iStoredPanValue,
bool& bStoredFaderIsSolo, bool& bStoredFaderIsSolo,
bool& bStoredFaderIsMute ); bool& bStoredFaderIsMute,
bool& bStoredFaderIsSelect);
void StoreFaderSettings ( CChannelFader* pChanFader ); void StoreFaderSettings ( CChannelFader* pChanFader );
void UpdateSoloStates(); void UpdateSoloStates();