moved some settings from client class in the settings class

This commit is contained in:
Volker Fischer 2020-07-04 19:55:04 +02:00
parent e6c564a373
commit 9fe9c4c261
8 changed files with 133 additions and 124 deletions

View file

@ -33,24 +33,7 @@ CClient::CClient ( const quint16 iPortNumber,
const QString& strNClientName ) : const QString& strNClientName ) :
vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ), vstrIPAddress ( MAX_NUM_SERVER_ADDR_ITEMS, "" ),
ChannelInfo (), ChannelInfo (),
vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ),
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_FADER_MAX ),
vecStoredPanValues ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_PAN_MAX / 2 ),
vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderGroupID ( MAX_NUM_STORED_FADER_SETTINGS, INVALID_INDEX ),
iNewClientFaderLevel ( 100 ),
bConnectDlgShowAllMusicians ( true ),
strClientName ( strNClientName ), strClientName ( strNClientName ),
vecWindowPosMain (), // empty array
vecWindowPosSettings (), // empty array
vecWindowPosChat (), // empty array
vecWindowPosProfile (), // empty array
vecWindowPosConnect (), // empty array
bWindowWasShownSettings ( false ),
bWindowWasShownChat ( false ),
bWindowWasShownProfile ( false ),
bWindowWasShownConnect ( false ),
Channel ( false ), /* we need a client channel -> "false" */ Channel ( false ), /* we need a client channel -> "false" */
CurOpusEncoder ( nullptr ), CurOpusEncoder ( nullptr ),
CurOpusDecoder ( nullptr ), CurOpusDecoder ( nullptr ),

View file

@ -280,27 +280,8 @@ public:
// settings // settings
CVector<QString> vstrIPAddress; CVector<QString> vstrIPAddress;
CChannelCoreInfo ChannelInfo; CChannelCoreInfo ChannelInfo;
CVector<QString> vecStoredFaderTags;
CVector<int> vecStoredFaderLevels;
CVector<int> vecStoredPanValues;
CVector<int> vecStoredFaderIsSolo;
CVector<int> vecStoredFaderIsMute;
CVector<int> vecStoredFaderGroupID;
int iNewClientFaderLevel;
bool bConnectDlgShowAllMusicians;
QString strClientName; QString strClientName;
// window position/state settings
QByteArray vecWindowPosMain;
QByteArray vecWindowPosSettings;
QByteArray vecWindowPosChat;
QByteArray vecWindowPosProfile;
QByteArray vecWindowPosConnect;
bool bWindowWasShownSettings;
bool bWindowWasShownChat;
bool bWindowWasShownProfile;
bool bWindowWasShownConnect;
#ifdef LLCON_VST_PLUGIN #ifdef LLCON_VST_PLUGIN
// VST version must have direct access to sound object // VST version must have direct access to sound object
CSound* GetSound() { return &Sound; } CSound* GetSound() { return &Sound; }

View file

@ -39,7 +39,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
pSettings ( pNSetP ), pSettings ( pNSetP ),
bConnectDlgWasShown ( false ), bConnectDlgWasShown ( false ),
bMIDICtrlUsed ( iCtrlMIDIChannel != INVALID_MIDI_CH ), bMIDICtrlUsed ( iCtrlMIDIChannel != INVALID_MIDI_CH ),
ClientSettingsDlg ( pNCliP, parent, Qt::Window ), ClientSettingsDlg ( pNCliP, pNSetP, parent, Qt::Window ),
ChatDlg ( parent, Qt::Window ), ChatDlg ( parent, Qt::Window ),
ConnectDlg ( pNCliP, bNewShowComplRegConnList, parent, Qt::Dialog ), ConnectDlg ( pNCliP, bNewShowComplRegConnList, parent, Qt::Dialog ),
AnalyzerConsole ( pNCliP, parent, Qt::Window ), AnalyzerConsole ( pNCliP, parent, Qt::Window ),
@ -189,13 +189,13 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() );
// restore fader settings // restore fader settings
MainMixerBoard->vecStoredFaderTags = pClient->vecStoredFaderTags; MainMixerBoard->vecStoredFaderTags = pSettings->vecStoredFaderTags;
MainMixerBoard->vecStoredFaderLevels = pClient->vecStoredFaderLevels; MainMixerBoard->vecStoredFaderLevels = pSettings->vecStoredFaderLevels;
MainMixerBoard->vecStoredPanValues = pClient->vecStoredPanValues; MainMixerBoard->vecStoredPanValues = pSettings->vecStoredPanValues;
MainMixerBoard->vecStoredFaderIsSolo = pClient->vecStoredFaderIsSolo; MainMixerBoard->vecStoredFaderIsSolo = pSettings->vecStoredFaderIsSolo;
MainMixerBoard->vecStoredFaderIsMute = pClient->vecStoredFaderIsMute; MainMixerBoard->vecStoredFaderIsMute = pSettings->vecStoredFaderIsMute;
MainMixerBoard->vecStoredFaderGroupID = pClient->vecStoredFaderGroupID; MainMixerBoard->vecStoredFaderGroupID = pSettings->vecStoredFaderGroupID;
MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; MainMixerBoard->iNewClientFaderLevel = pSettings->iNewClientFaderLevel;
// init status label // init status label
OnTimerStatus(); OnTimerStatus();
@ -226,7 +226,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
UpdateRevSelection(); UpdateRevSelection();
// init connect dialog // init connect dialog
ConnectDlg.SetShowAllMusicians ( pClient->bConnectDlgShowAllMusicians ); ConnectDlg.SetShowAllMusicians ( pSettings->bConnectDlgShowAllMusicians );
// set window title (with no clients connected -> "0") // set window title (with no clients connected -> "0")
SetMyWindowTitle ( 0 ); SetMyWindowTitle ( 0 );
@ -370,48 +370,48 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
// Window positions -------------------------------------------------------- // Window positions --------------------------------------------------------
// main window // main window
if ( !pClient->vecWindowPosMain.isEmpty() && !pClient->vecWindowPosMain.isNull() ) if ( !pSettings->vecWindowPosMain.isEmpty() && !pSettings->vecWindowPosMain.isNull() )
{ {
restoreGeometry ( pClient->vecWindowPosMain ); restoreGeometry ( pSettings->vecWindowPosMain );
} }
// settings window // settings window
if ( !pClient->vecWindowPosSettings.isEmpty() && !pClient->vecWindowPosSettings.isNull() ) if ( !pSettings->vecWindowPosSettings.isEmpty() && !pSettings->vecWindowPosSettings.isNull() )
{ {
ClientSettingsDlg.restoreGeometry ( pClient->vecWindowPosSettings ); ClientSettingsDlg.restoreGeometry ( pSettings->vecWindowPosSettings );
} }
if ( pClient->bWindowWasShownSettings ) if ( pSettings->bWindowWasShownSettings )
{ {
ShowGeneralSettings(); ShowGeneralSettings();
} }
// chat window // chat window
if ( !pClient->vecWindowPosChat.isEmpty() && !pClient->vecWindowPosChat.isNull() ) if ( !pSettings->vecWindowPosChat.isEmpty() && !pSettings->vecWindowPosChat.isNull() )
{ {
ChatDlg.restoreGeometry ( pClient->vecWindowPosChat ); ChatDlg.restoreGeometry ( pSettings->vecWindowPosChat );
} }
if ( pClient->bWindowWasShownChat ) if ( pSettings->bWindowWasShownChat )
{ {
ShowChatWindow(); ShowChatWindow();
} }
// musician profile window // musician profile window
if ( !pClient->vecWindowPosProfile.isEmpty() && !pClient->vecWindowPosProfile.isNull() ) if ( !pSettings->vecWindowPosProfile.isEmpty() && !pSettings->vecWindowPosProfile.isNull() )
{ {
MusicianProfileDlg.restoreGeometry ( pClient->vecWindowPosProfile ); MusicianProfileDlg.restoreGeometry ( pSettings->vecWindowPosProfile );
} }
if ( pClient->bWindowWasShownProfile ) if ( pSettings->bWindowWasShownProfile )
{ {
ShowMusicianProfileDialog(); ShowMusicianProfileDialog();
} }
// connection setup window // connection setup window
if ( !pClient->vecWindowPosConnect.isEmpty() && !pClient->vecWindowPosConnect.isNull() ) if ( !pSettings->vecWindowPosConnect.isEmpty() && !pSettings->vecWindowPosConnect.isNull() )
{ {
ConnectDlg.restoreGeometry ( pClient->vecWindowPosConnect ); ConnectDlg.restoreGeometry ( pSettings->vecWindowPosConnect );
} }
@ -564,7 +564,7 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
TimerStatus.start ( LED_BAR_UPDATE_TIME_MS ); TimerStatus.start ( LED_BAR_UPDATE_TIME_MS );
// restore connect dialog // restore connect dialog
if ( pClient->bWindowWasShownConnect ) if ( pSettings->bWindowWasShownConnect )
{ {
ShowConnectionSetupDialog(); ShowConnectionSetupDialog();
} }
@ -573,16 +573,16 @@ CClientDlg::CClientDlg ( CClient* pNCliP,
void CClientDlg::closeEvent ( QCloseEvent* Event ) void CClientDlg::closeEvent ( QCloseEvent* Event )
{ {
// store window positions // store window positions
pClient->vecWindowPosMain = saveGeometry(); pSettings->vecWindowPosMain = saveGeometry();
pClient->vecWindowPosSettings = ClientSettingsDlg.saveGeometry(); pSettings->vecWindowPosSettings = ClientSettingsDlg.saveGeometry();
pClient->vecWindowPosChat = ChatDlg.saveGeometry(); pSettings->vecWindowPosChat = ChatDlg.saveGeometry();
pClient->vecWindowPosProfile = MusicianProfileDlg.saveGeometry(); pSettings->vecWindowPosProfile = MusicianProfileDlg.saveGeometry();
pClient->vecWindowPosConnect = ConnectDlg.saveGeometry(); pSettings->vecWindowPosConnect = ConnectDlg.saveGeometry();
pClient->bWindowWasShownSettings = ClientSettingsDlg.isVisible(); pSettings->bWindowWasShownSettings = ClientSettingsDlg.isVisible();
pClient->bWindowWasShownChat = ChatDlg.isVisible(); pSettings->bWindowWasShownChat = ChatDlg.isVisible();
pClient->bWindowWasShownProfile = MusicianProfileDlg.isVisible(); pSettings->bWindowWasShownProfile = MusicianProfileDlg.isVisible();
pClient->bWindowWasShownConnect = ConnectDlg.isVisible(); pSettings->bWindowWasShownConnect = ConnectDlg.isVisible();
// if settings/connect dialog or chat dialog is open, close it // if settings/connect dialog or chat dialog is open, close it
ClientSettingsDlg.close(); ClientSettingsDlg.close();
@ -601,14 +601,14 @@ void CClientDlg::closeEvent ( QCloseEvent* Event )
// initiate a storage of the current mixer fader levels in case we are // initiate a storage of the current mixer fader levels in case we are
// just in a connected state) and other settings // just in a connected state) and other settings
MainMixerBoard->HideAll(); MainMixerBoard->HideAll();
pClient->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags; pSettings->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags;
pClient->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels; pSettings->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels;
pClient->vecStoredPanValues = MainMixerBoard->vecStoredPanValues; pSettings->vecStoredPanValues = MainMixerBoard->vecStoredPanValues;
pClient->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo; pSettings->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo;
pClient->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute; pSettings->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute;
pClient->vecStoredFaderGroupID = MainMixerBoard->vecStoredFaderGroupID; pSettings->vecStoredFaderGroupID = MainMixerBoard->vecStoredFaderGroupID;
pClient->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel; pSettings->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel;
pClient->bConnectDlgShowAllMusicians = ConnectDlg.GetShowAllMusicians(); pSettings->bConnectDlgShowAllMusicians = ConnectDlg.GetShowAllMusicians();
// default implementation of this event handler routine // default implementation of this event handler routine
Event->accept(); Event->accept();

View file

@ -230,7 +230,7 @@ public slots:
void OnAudioChannelsChanged() { UpdateRevSelection(); } void OnAudioChannelsChanged() { UpdateRevSelection(); }
void OnNumClientsChanged ( int iNewNumClients ); void OnNumClientsChanged ( int iNewNumClients );
void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; } void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pSettings->iNewClientFaderLevel; }
void accept() { close(); } // introduced by pljones void accept() { close(); } // introduced by pljones

View file

@ -26,8 +26,13 @@
/* Implementation *************************************************************/ /* Implementation *************************************************************/
CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent, CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP,
Qt::WindowFlags f ) : QDialog ( parent, f ), pClient ( pNCliP ) CClientSettings* pNSetP,
QWidget* parent,
Qt::WindowFlags f ) :
QDialog ( parent, f ),
pClient ( pNCliP ),
pSettings ( pNSetP )
{ {
setupUi ( this ); setupUi ( this );
@ -340,7 +345,7 @@ CClientSettingsDlg::CClientSettingsDlg ( CClient* pNCliP, QWidget* parent,
edtCentralServerAddress->setText ( pClient->GetServerListCentralServerAddress() ); edtCentralServerAddress->setText ( pClient->GetServerListCentralServerAddress() );
// update new client fader level edit box // update new client fader level edit box
edtNewClientLevel->setText ( QString::number ( pClient->iNewClientFaderLevel ) ); edtNewClientLevel->setText ( QString::number ( pSettings->iNewClientFaderLevel ) );
// update enable small network buffers check box // update enable small network buffers check box
chbEnableOPUS64->setCheckState ( pClient->GetEnableOPUS64() ? Qt::Checked : Qt::Unchecked ); chbEnableOPUS64->setCheckState ( pClient->GetEnableOPUS64() ? Qt::Checked : Qt::Unchecked );
@ -671,8 +676,7 @@ void CClientSettingsDlg::OnCentralServerAddressEditingFinished()
void CClientSettingsDlg::OnNewClientLevelEditingFinished() void CClientSettingsDlg::OnNewClientLevelEditingFinished()
{ {
// store new setting in the client // store new setting in the client
pClient->iNewClientFaderLevel = pSettings->iNewClientFaderLevel = edtNewClientLevel->text().toInt();
edtNewClientLevel->text().toInt();
// inform that the level has changed and the mixer board settings must // inform that the level has changed and the mixer board settings must
// be updated // be updated

View file

@ -39,6 +39,7 @@
#include <QMessageBox> #include <QMessageBox>
#include "global.h" #include "global.h"
#include "client.h" #include "client.h"
#include "settings.h"
#include "multicolorled.h" #include "multicolorled.h"
#include "ui_clientsettingsdlgbase.h" #include "ui_clientsettingsdlgbase.h"
@ -55,6 +56,7 @@ class CClientSettingsDlg : public QDialog, private Ui_CClientSettingsDlgBase
public: public:
CClientSettingsDlg ( CClient* pNCliP, CClientSettingsDlg ( CClient* pNCliP,
CClientSettings* pNSetP,
QWidget* parent = nullptr, QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr ); Qt::WindowFlags f = nullptr );
@ -82,6 +84,7 @@ protected:
virtual void showEvent ( QShowEvent* ) { UpdateDisplay(); } virtual void showEvent ( QShowEvent* ) { UpdateDisplay(); }
CClient* pClient; CClient* pClient;
CClientSettings* pSettings;
QTimer TimerStatus; QTimer TimerStatus;
QButtonGroup SndCrdBufferDelayButtonGroup; QButtonGroup SndCrdBufferDelayButtonGroup;

View file

@ -229,7 +229,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
// stored fader tags // stored fader tags
for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ ) for ( iIdx = 0; iIdx < MAX_NUM_STORED_FADER_SETTINGS; iIdx++ )
{ {
pClient->vecStoredFaderTags[iIdx] = FromBase64ToString ( vecStoredFaderTags[iIdx] = FromBase64ToString (
GetIniSetting ( IniXMLDocument, "client", GetIniSetting ( IniXMLDocument, "client",
QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) ); QString ( "storedfadertag%1_base64" ).arg ( iIdx ), "" ) );
} }
@ -241,7 +241,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
QString ( "storedfaderlevel%1" ).arg ( iIdx ), QString ( "storedfaderlevel%1" ).arg ( iIdx ),
0, AUD_MIX_FADER_MAX, iValue ) ) 0, AUD_MIX_FADER_MAX, iValue ) )
{ {
pClient->vecStoredFaderLevels[iIdx] = iValue; vecStoredFaderLevels[iIdx] = iValue;
} }
} }
@ -252,7 +252,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
QString ( "storedpanvalue%1" ).arg ( iIdx ), QString ( "storedpanvalue%1" ).arg ( iIdx ),
0, AUD_MIX_PAN_MAX, iValue ) ) 0, AUD_MIX_PAN_MAX, iValue ) )
{ {
pClient->vecStoredPanValues[iIdx] = iValue; vecStoredPanValues[iIdx] = iValue;
} }
} }
@ -263,7 +263,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
QString ( "storedfaderissolo%1" ).arg ( iIdx ), QString ( "storedfaderissolo%1" ).arg ( iIdx ),
bValue ) ) bValue ) )
{ {
pClient->vecStoredFaderIsSolo[iIdx] = bValue; vecStoredFaderIsSolo[iIdx] = bValue;
} }
} }
@ -274,7 +274,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
QString ( "storedfaderismute%1" ).arg ( iIdx ), QString ( "storedfaderismute%1" ).arg ( iIdx ),
bValue ) ) bValue ) )
{ {
pClient->vecStoredFaderIsMute[iIdx] = bValue; vecStoredFaderIsMute[iIdx] = bValue;
} }
} }
@ -286,7 +286,7 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
QString ( "storedgroupid%1" ).arg ( iIdx ), QString ( "storedgroupid%1" ).arg ( iIdx ),
0, MAX_NUM_FADER_GROUPS - 1, iValue ) ) 0, MAX_NUM_FADER_GROUPS - 1, iValue ) )
{ {
pClient->vecStoredFaderGroupID[iIdx] = iValue; vecStoredFaderGroupID[iIdx] = iValue;
} }
} }
@ -294,13 +294,13 @@ void CClientSettings::ReadFromXML ( const QDomDocument& IniXMLDocument )
if ( GetNumericIniSet ( IniXMLDocument, "client", "newclientlevel", if ( GetNumericIniSet ( IniXMLDocument, "client", "newclientlevel",
0, 100, iValue ) ) 0, 100, iValue ) )
{ {
pClient->iNewClientFaderLevel = iValue; iNewClientFaderLevel = iValue;
} }
// connect dialog show all musicians // connect dialog show all musicians
if ( GetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians", bValue ) ) if ( GetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians", bValue ) )
{ {
pClient->bConnectDlgShowAllMusicians = bValue; bConnectDlgShowAllMusicians = bValue;
} }
// name // name
@ -501,47 +501,47 @@ if ( GetFlagIniSet ( IniXMLDocument, "client", "defcentservaddr", bValue ) )
} }
// window position of the main window // window position of the main window
pClient->vecWindowPosMain = FromBase64ToByteArray ( vecWindowPosMain = FromBase64ToByteArray (
GetIniSetting ( IniXMLDocument, "client", "winposmain_base64" ) ); GetIniSetting ( IniXMLDocument, "client", "winposmain_base64" ) );
// window position of the settings window // window position of the settings window
pClient->vecWindowPosSettings = FromBase64ToByteArray ( vecWindowPosSettings = FromBase64ToByteArray (
GetIniSetting ( IniXMLDocument, "client", "winposset_base64" ) ); GetIniSetting ( IniXMLDocument, "client", "winposset_base64" ) );
// window position of the chat window // window position of the chat window
pClient->vecWindowPosChat = FromBase64ToByteArray ( vecWindowPosChat = FromBase64ToByteArray (
GetIniSetting ( IniXMLDocument, "client", "winposchat_base64" ) ); GetIniSetting ( IniXMLDocument, "client", "winposchat_base64" ) );
// window position of the musician profile window // window position of the musician profile window
pClient->vecWindowPosProfile = FromBase64ToByteArray ( vecWindowPosProfile = FromBase64ToByteArray (
GetIniSetting ( IniXMLDocument, "client", "winposprofile_base64" ) ); GetIniSetting ( IniXMLDocument, "client", "winposprofile_base64" ) );
// window position of the connect window // window position of the connect window
pClient->vecWindowPosConnect = FromBase64ToByteArray ( vecWindowPosConnect = FromBase64ToByteArray (
GetIniSetting ( IniXMLDocument, "client", "winposcon_base64" ) ); GetIniSetting ( IniXMLDocument, "client", "winposcon_base64" ) );
// visibility state of the settings window // visibility state of the settings window
if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisset", bValue ) ) if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisset", bValue ) )
{ {
pClient->bWindowWasShownSettings = bValue; bWindowWasShownSettings = bValue;
} }
// visibility state of the chat window // visibility state of the chat window
if ( GetFlagIniSet ( IniXMLDocument, "client", "winvischat", bValue ) ) if ( GetFlagIniSet ( IniXMLDocument, "client", "winvischat", bValue ) )
{ {
pClient->bWindowWasShownChat = bValue; bWindowWasShownChat = bValue;
} }
// visibility state of the musician profile window // visibility state of the musician profile window
if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisprofile", bValue ) ) if ( GetFlagIniSet ( IniXMLDocument, "client", "winvisprofile", bValue ) )
{ {
pClient->bWindowWasShownProfile = bValue; bWindowWasShownProfile = bValue;
} }
// visibility state of the connect window // visibility state of the connect window
if ( GetFlagIniSet ( IniXMLDocument, "client", "winviscon", bValue ) ) if ( GetFlagIniSet ( IniXMLDocument, "client", "winviscon", bValue ) )
{ {
pClient->bWindowWasShownConnect = bValue; bWindowWasShownConnect = bValue;
} }
} }
@ -562,7 +562,7 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
PutIniSetting ( IniXMLDocument, "client", PutIniSetting ( IniXMLDocument, "client",
QString ( "storedfadertag%1_base64" ).arg ( iIdx ), QString ( "storedfadertag%1_base64" ).arg ( iIdx ),
ToBase64 ( pClient->vecStoredFaderTags[iIdx] ) ); ToBase64 ( vecStoredFaderTags[iIdx] ) );
} }
// stored fader levels // stored fader levels
@ -570,7 +570,7 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
SetNumericIniSet ( IniXMLDocument, "client", SetNumericIniSet ( IniXMLDocument, "client",
QString ( "storedfaderlevel%1" ).arg ( iIdx ), QString ( "storedfaderlevel%1" ).arg ( iIdx ),
pClient->vecStoredFaderLevels[iIdx] ); vecStoredFaderLevels[iIdx] );
} }
// stored pan values // stored pan values
@ -578,7 +578,7 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
SetNumericIniSet ( IniXMLDocument, "client", SetNumericIniSet ( IniXMLDocument, "client",
QString ( "storedpanvalue%1" ).arg ( iIdx ), QString ( "storedpanvalue%1" ).arg ( iIdx ),
pClient->vecStoredPanValues[iIdx] ); vecStoredPanValues[iIdx] );
} }
// stored fader solo states // stored fader solo states
@ -586,7 +586,7 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
SetFlagIniSet ( IniXMLDocument, "client", SetFlagIniSet ( IniXMLDocument, "client",
QString ( "storedfaderissolo%1" ).arg ( iIdx ), QString ( "storedfaderissolo%1" ).arg ( iIdx ),
pClient->vecStoredFaderIsSolo[iIdx] != 0 ); vecStoredFaderIsSolo[iIdx] != 0 );
} }
// stored fader muted states // stored fader muted states
@ -594,7 +594,7 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
SetFlagIniSet ( IniXMLDocument, "client", SetFlagIniSet ( IniXMLDocument, "client",
QString ( "storedfaderismute%1" ).arg ( iIdx ), QString ( "storedfaderismute%1" ).arg ( iIdx ),
pClient->vecStoredFaderIsMute[iIdx] != 0 ); vecStoredFaderIsMute[iIdx] != 0 );
} }
// stored fader group ID // stored fader group ID
@ -602,16 +602,16 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
{ {
SetNumericIniSet ( IniXMLDocument, "client", SetNumericIniSet ( IniXMLDocument, "client",
QString ( "storedgroupid%1" ).arg ( iIdx ), QString ( "storedgroupid%1" ).arg ( iIdx ),
pClient->vecStoredFaderGroupID[iIdx] ); vecStoredFaderGroupID[iIdx] );
} }
// new client level // new client level
SetNumericIniSet ( IniXMLDocument, "client", "newclientlevel", SetNumericIniSet ( IniXMLDocument, "client", "newclientlevel",
pClient->iNewClientFaderLevel ); iNewClientFaderLevel );
// connect dialog show all musicians // connect dialog show all musicians
SetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians", SetFlagIniSet ( IniXMLDocument, "client", "connectdlgshowallmusicians",
pClient->bConnectDlgShowAllMusicians ); bConnectDlgShowAllMusicians );
// name // name
PutIniSetting ( IniXMLDocument, "client", "name_base64", PutIniSetting ( IniXMLDocument, "client", "name_base64",
@ -711,39 +711,39 @@ void CClientSettings::WriteToXML ( QDomDocument& IniXMLDocument )
// window position of the main window // window position of the main window
PutIniSetting ( IniXMLDocument, "client", "winposmain_base64", PutIniSetting ( IniXMLDocument, "client", "winposmain_base64",
ToBase64 ( pClient->vecWindowPosMain ) ); ToBase64 ( vecWindowPosMain ) );
// window position of the settings window // window position of the settings window
PutIniSetting ( IniXMLDocument, "client", "winposset_base64", PutIniSetting ( IniXMLDocument, "client", "winposset_base64",
ToBase64 ( pClient->vecWindowPosSettings ) ); ToBase64 ( vecWindowPosSettings ) );
// window position of the chat window // window position of the chat window
PutIniSetting ( IniXMLDocument, "client", "winposchat_base64", PutIniSetting ( IniXMLDocument, "client", "winposchat_base64",
ToBase64 ( pClient->vecWindowPosChat ) ); ToBase64 ( vecWindowPosChat ) );
// window position of the musician profile window // window position of the musician profile window
PutIniSetting ( IniXMLDocument, "client", "winposprofile_base64", PutIniSetting ( IniXMLDocument, "client", "winposprofile_base64",
ToBase64 ( pClient->vecWindowPosProfile ) ); ToBase64 ( vecWindowPosProfile ) );
// window position of the connect window // window position of the connect window
PutIniSetting ( IniXMLDocument, "client", "winposcon_base64", PutIniSetting ( IniXMLDocument, "client", "winposcon_base64",
ToBase64 ( pClient->vecWindowPosConnect ) ); ToBase64 ( vecWindowPosConnect ) );
// visibility state of the settings window // visibility state of the settings window
SetFlagIniSet ( IniXMLDocument, "client", "winvisset", SetFlagIniSet ( IniXMLDocument, "client", "winvisset",
pClient->bWindowWasShownSettings ); bWindowWasShownSettings );
// visibility state of the chat window // visibility state of the chat window
SetFlagIniSet ( IniXMLDocument, "client", "winvischat", SetFlagIniSet ( IniXMLDocument, "client", "winvischat",
pClient->bWindowWasShownChat ); bWindowWasShownChat );
// visibility state of the musician profile window // visibility state of the musician profile window
SetFlagIniSet ( IniXMLDocument, "client", "winvisprofile", SetFlagIniSet ( IniXMLDocument, "client", "winvisprofile",
pClient->bWindowWasShownProfile ); bWindowWasShownProfile );
// visibility state of the connect window // visibility state of the connect window
SetFlagIniSet ( IniXMLDocument, "client", "winviscon", SetFlagIniSet ( IniXMLDocument, "client", "winviscon",
pClient->bWindowWasShownConnect ); bWindowWasShownConnect );
} }

View file

@ -110,9 +110,47 @@ protected:
class CClientSettings : public CSettings class CClientSettings : public CSettings
{ {
public: public:
CClientSettings ( CClient* pNCliP, const QString& sNFiName ) : pClient ( pNCliP ) CClientSettings ( CClient* pNCliP, const QString& sNFiName ) :
vecStoredFaderTags ( MAX_NUM_STORED_FADER_SETTINGS, "" ),
vecStoredFaderLevels ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_FADER_MAX ),
vecStoredPanValues ( MAX_NUM_STORED_FADER_SETTINGS, AUD_MIX_PAN_MAX / 2 ),
vecStoredFaderIsSolo ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderIsMute ( MAX_NUM_STORED_FADER_SETTINGS, false ),
vecStoredFaderGroupID ( MAX_NUM_STORED_FADER_SETTINGS, INVALID_INDEX ),
iNewClientFaderLevel ( 100 ),
bConnectDlgShowAllMusicians ( true ),
vecWindowPosMain ( ), // empty array
vecWindowPosSettings ( ), // empty array
vecWindowPosChat ( ), // empty array
vecWindowPosProfile ( ), // empty array
vecWindowPosConnect ( ), // empty array
bWindowWasShownSettings ( false ),
bWindowWasShownChat ( false ),
bWindowWasShownProfile ( false ),
bWindowWasShownConnect ( false ),
pClient ( pNCliP )
{ SetFileName ( sNFiName, DEFAULT_INI_FILE_NAME ); } { SetFileName ( sNFiName, DEFAULT_INI_FILE_NAME ); }
CVector<QString> vecStoredFaderTags;
CVector<int> vecStoredFaderLevels;
CVector<int> vecStoredPanValues;
CVector<int> vecStoredFaderIsSolo;
CVector<int> vecStoredFaderIsMute;
CVector<int> vecStoredFaderGroupID;
int iNewClientFaderLevel;
bool bConnectDlgShowAllMusicians;
// window position/state settings
QByteArray vecWindowPosMain;
QByteArray vecWindowPosSettings;
QByteArray vecWindowPosChat;
QByteArray vecWindowPosProfile;
QByteArray vecWindowPosConnect;
bool bWindowWasShownSettings;
bool bWindowWasShownChat;
bool bWindowWasShownProfile;
bool bWindowWasShownConnect;
protected: protected:
virtual void ReadFromXML ( const QDomDocument& IniXMLDocument ) override; virtual void ReadFromXML ( const QDomDocument& IniXMLDocument ) override;
virtual void WriteToXML ( QDomDocument& IniXMLDocument ) override; virtual void WriteToXML ( QDomDocument& IniXMLDocument ) override;