Merge pull request #37 from doloopuntil/save_mute_settings
Store mute settings for faders.
This commit is contained in:
commit
e89b871326
8 changed files with 49 additions and 7 deletions
|
@ -250,6 +250,11 @@ void CChannelFader::SetFaderIsSolo ( const bool bIsSolo )
|
|||
pcbSolo->setChecked ( bIsSolo );
|
||||
}
|
||||
|
||||
void CChannelFader::SetFaderIsMute ( const bool bIsMute ) {
|
||||
// changing the state automatically emits the signal, too
|
||||
pcbMute->setChecked ( bIsMute );
|
||||
}
|
||||
|
||||
void CChannelFader::SendFaderLevelToServer ( const int iLevel )
|
||||
{
|
||||
// if mute flag is set or other channel is on solo, do not apply the new
|
||||
|
@ -468,6 +473,7 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
|
|||
vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ),
|
||||
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_FADER_MAX ),
|
||||
vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ),
|
||||
vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ),
|
||||
iNewClientFaderLevel ( 100 ),
|
||||
bNoFaderVisible ( true )
|
||||
{
|
||||
|
@ -690,13 +696,16 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInf
|
|||
// stored settings if we have a matching entry
|
||||
int iStoredFaderLevel;
|
||||
bool bStoredFaderIsSolo;
|
||||
bool bStoredFaderIsMute;
|
||||
|
||||
if ( GetStoredFaderSettings ( vecChanInfo[j],
|
||||
iStoredFaderLevel,
|
||||
bStoredFaderIsSolo ) )
|
||||
bStoredFaderIsSolo,
|
||||
bStoredFaderIsMute ) )
|
||||
{
|
||||
vecpChanFader[i]->SetFaderLevel ( iStoredFaderLevel );
|
||||
vecpChanFader[i]->SetFaderIsSolo ( bStoredFaderIsSolo );
|
||||
vecpChanFader[i]->SetFaderIsMute ( bStoredFaderIsMute );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -783,6 +792,7 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
|
|||
{
|
||||
CVector<int> viOldStoredFaderLevels ( vecStoredFaderLevels );
|
||||
CVector<int> vbOldStoredFaderIsSolo ( vecStoredFaderIsSolo );
|
||||
CVector<int> vbOldStoredFaderIsMute ( vecStoredFaderIsMute );
|
||||
|
||||
// init temporary list count (may be overwritten later on)
|
||||
int iTempListCnt = 0;
|
||||
|
@ -795,6 +805,7 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
|
|||
// current fader level and solo state is at the top of the list
|
||||
vecStoredFaderLevels[0] = pChanFader->GetFaderLevel();
|
||||
vecStoredFaderIsSolo[0] = pChanFader->IsSolo();
|
||||
vecStoredFaderIsMute[0] = pChanFader->IsMute();
|
||||
iTempListCnt = 1;
|
||||
|
||||
for ( int iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
|
||||
|
@ -809,6 +820,7 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
|
|||
{
|
||||
vecStoredFaderLevels[iTempListCnt] = viOldStoredFaderLevels[iIdx];
|
||||
vecStoredFaderIsSolo[iTempListCnt] = vbOldStoredFaderIsSolo[iIdx];
|
||||
vecStoredFaderIsMute[iTempListCnt] = vbOldStoredFaderIsMute[iIdx];
|
||||
|
||||
iTempListCnt++;
|
||||
}
|
||||
|
@ -819,7 +831,8 @@ void CAudioMixerBoard::StoreFaderSettings ( CChannelFader* pChanFader )
|
|||
|
||||
bool CAudioMixerBoard::GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
|
||||
int& iStoredFaderLevel,
|
||||
bool& bStoredFaderIsSolo )
|
||||
bool& bStoredFaderIsSolo,
|
||||
bool& bStoredFaderIsMute)
|
||||
{
|
||||
// only do the check if the name string is not empty
|
||||
if ( !ChanInfo.strName.isEmpty() )
|
||||
|
@ -831,7 +844,8 @@ bool CAudioMixerBoard::GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
|
|||
{
|
||||
// copy stored settings values
|
||||
iStoredFaderLevel = vecStoredFaderLevels[iIdx];
|
||||
bStoredFaderIsSolo = vecStoredFaderIsSolo[iIdx] != false;
|
||||
bStoredFaderIsSolo = vecStoredFaderIsSolo[iIdx] != 0;
|
||||
bStoredFaderIsMute = vecStoredFaderIsMute[iIdx] != 0;
|
||||
|
||||
// values found and copied, return OK
|
||||
return true;
|
||||
|
|
|
@ -53,11 +53,13 @@ public:
|
|||
void Hide() { pFrame->hide(); }
|
||||
bool IsVisible() { return plblLabel->isVisible(); }
|
||||
bool IsSolo() { return pcbSolo->isChecked(); }
|
||||
bool IsMute() { return pcbMute->isChecked(); }
|
||||
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
||||
|
||||
void UpdateSoloState ( const bool bNewOtherSoloState );
|
||||
void SetFaderLevel ( const int iLevel );
|
||||
void SetFaderIsSolo ( const bool bIsSolo );
|
||||
void SetFaderIsMute ( const bool bIsMute );
|
||||
int GetFaderLevel() { return pFader->value(); }
|
||||
void Reset();
|
||||
|
||||
|
@ -109,12 +111,15 @@ public:
|
|||
CVector<QString> vecStoredFaderTags;
|
||||
CVector<int> vecStoredFaderLevels;
|
||||
CVector<int> vecStoredFaderIsSolo;
|
||||
CVector<int> vecStoredFaderIsMute;
|
||||
int iNewClientFaderLevel;
|
||||
|
||||
protected:
|
||||
bool GetStoredFaderSettings ( const CChannelInfo& ChanInfo,
|
||||
int& iStoredFaderLevel,
|
||||
bool& bStoredFaderIsSolo );
|
||||
bool& bStoredFaderIsSolo,
|
||||
bool& bStoredFaderIsMute );
|
||||
|
||||
void StoreFaderSettings ( CChannelFader* pChanFader );
|
||||
void UpdateSoloStates();
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ void CChatDlg::AddChatText ( QString strChatText )
|
|||
#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
|
||||
txvChatWindow, 0, QAccessible::ValueChanged
|
||||
#else
|
||||
new QAccessibleEvent ( txvChatWindow, QAccessible::ValueChanged )
|
||||
new QAccessibleValueChangeEvent ( txvChatWindow, strChatText )
|
||||
#endif
|
||||
);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ CClient::CClient ( const quint16 iPortNumber,
|
|||
vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ),
|
||||
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_FADER_MAX ),
|
||||
vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ),
|
||||
vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ),
|
||||
iNewClientFaderLevel ( 100 ),
|
||||
vecWindowPosMain (), // empty array
|
||||
vecWindowPosSettings (), // empty array
|
||||
|
|
|
@ -282,6 +282,7 @@ public:
|
|||
CVector<QString> vecStoredFaderTags;
|
||||
CVector<int> vecStoredFaderLevels;
|
||||
CVector<int> vecStoredFaderIsSolo;
|
||||
CVector<int> vecStoredFaderIsMute;
|
||||
int iNewClientFaderLevel;
|
||||
|
||||
// window position/state settings
|
||||
|
|
|
@ -189,6 +189,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
|
|||
MainMixerBoard->vecStoredFaderTags = pClient->vecStoredFaderTags;
|
||||
MainMixerBoard->vecStoredFaderLevels = pClient->vecStoredFaderLevels;
|
||||
MainMixerBoard->vecStoredFaderIsSolo = pClient->vecStoredFaderIsSolo;
|
||||
MainMixerBoard->vecStoredFaderIsMute = pClient->vecStoredFaderIsMute;
|
||||
MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel;
|
||||
|
||||
// init status label
|
||||
|
@ -568,6 +569,7 @@ void CClientDlg::closeEvent ( QCloseEvent* Event )
|
|||
pClient->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags;
|
||||
pClient->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels;
|
||||
pClient->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo;
|
||||
pClient->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute;
|
||||
pClient->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel;
|
||||
|
||||
// default implementation of this event handler routine
|
||||
|
|
|
@ -167,7 +167,7 @@ LED bar: lbr
|
|||
#define MAX_NUM_SERVER_ADDR_ITEMS 6
|
||||
|
||||
// maximum number of fader settings to be stored (together with the fader tags)
|
||||
#define MAX_NUM_STORED_FADER_SETTINGS 70
|
||||
#define MAX_NUM_STORED_FADER_SETTINGS 200
|
||||
|
||||
// defines for LED input level meter
|
||||
#define NUM_STEPS_INP_LEV_METER 8
|
||||
|
|
|
@ -88,6 +88,17 @@ void CSettings::Load()
|
|||
}
|
||||
}
|
||||
|
||||
// stored fader muted state
|
||||
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
|
||||
{
|
||||
if ( GetFlagIniSet ( IniXMLDocument, "client",
|
||||
QString ( "storedfaderismute%1" ).arg ( iIdx ),
|
||||
bValue ) )
|
||||
{
|
||||
pClient->vecStoredFaderIsMute[iIdx] = bValue;
|
||||
}
|
||||
}
|
||||
|
||||
// new client level
|
||||
if ( GetNumericIniSet ( IniXMLDocument, "client", "newclientlevel",
|
||||
0, 100, iValue ) )
|
||||
|
@ -392,7 +403,15 @@ void CSettings::Save()
|
|||
{
|
||||
SetFlagIniSet ( IniXMLDocument, "client",
|
||||
QString ( "storedfaderissolo%1" ).arg ( iIdx ),
|
||||
pClient->vecStoredFaderIsSolo[iIdx] != false );
|
||||
pClient->vecStoredFaderIsSolo[iIdx] != 0 );
|
||||
}
|
||||
|
||||
// stored fader muted states
|
||||
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
|
||||
{
|
||||
SetFlagIniSet ( IniXMLDocument, "client",
|
||||
QString ( "storedfaderismute%1" ).arg ( iIdx ),
|
||||
pClient->vecStoredFaderIsMute[iIdx] != 0 );
|
||||
}
|
||||
|
||||
// new client level
|
||||
|
|
Loading…
Reference in a new issue