2013-01-23 11:41:13 +01:00
|
|
|
/******************************************************************************\
|
2020-01-01 15:41:43 +01:00
|
|
|
* Copyright (c) 2004-2020
|
2013-01-23 11:41:13 +01:00
|
|
|
*
|
|
|
|
* Author(s):
|
|
|
|
* Volker Fischer
|
|
|
|
*
|
|
|
|
******************************************************************************
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it under
|
|
|
|
* the terms of the GNU General Public License as published by the Free Software
|
|
|
|
* Foundation; either version 2 of the License, or (at your option) any later
|
|
|
|
* version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
\******************************************************************************/
|
|
|
|
|
|
|
|
#include <QLabel>
|
|
|
|
#include <QString>
|
|
|
|
#include <QLineEdit>
|
|
|
|
#include <QPushButton>
|
|
|
|
#include <QProgressBar>
|
|
|
|
#include <QWhatsThis>
|
|
|
|
#include <QTimer>
|
|
|
|
#include <QSlider>
|
|
|
|
#include <QRadioButton>
|
|
|
|
#include <QMenuBar>
|
|
|
|
#include <QLayout>
|
2020-05-19 18:28:52 +02:00
|
|
|
#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
|
|
|
|
# include <QVersionNumber>
|
|
|
|
#endif
|
2013-01-23 11:41:13 +01:00
|
|
|
#include "global.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "settings.h"
|
|
|
|
#include "multicolorled.h"
|
|
|
|
#include "audiomixerboard.h"
|
|
|
|
#include "clientsettingsdlg.h"
|
|
|
|
#include "chatdlg.h"
|
|
|
|
#include "connectdlg.h"
|
2013-02-23 21:15:48 +01:00
|
|
|
#include "analyzerconsole.h"
|
2013-03-24 11:49:25 +01:00
|
|
|
#include "ui_clientdlgbase.h"
|
2015-12-18 21:17:31 +01:00
|
|
|
#if defined ( __APPLE__ ) || defined ( __MACOSX )
|
|
|
|
# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
# include <QtMac>
|
|
|
|
# endif
|
|
|
|
#endif
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Definitions ****************************************************************/
|
|
|
|
// update time for GUI controls
|
|
|
|
#define LEVELMETER_UPDATE_TIME_MS 100 // ms
|
2014-01-03 09:54:49 +01:00
|
|
|
#define BUFFER_LED_UPDATE_TIME_MS 300 // ms
|
2013-01-23 11:41:13 +01:00
|
|
|
#define LED_BAR_UPDATE_TIME_MS 1000 // ms
|
|
|
|
|
|
|
|
// number of ping times > upper bound until error message is shown
|
|
|
|
#define NUM_HIGH_PINGS_UNTIL_ERROR 5
|
|
|
|
|
|
|
|
|
|
|
|
/* Classes ********************************************************************/
|
2013-03-24 16:42:23 +01:00
|
|
|
class CClientDlg : public QDialog, private Ui_CClientDlgBase
|
2013-01-23 11:41:13 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2013-03-24 16:42:23 +01:00
|
|
|
CClientDlg ( CClient* pNCliP,
|
|
|
|
CSettings* pNSetP,
|
2015-03-25 21:29:52 +01:00
|
|
|
const QString& strConnOnStartupAddress,
|
2013-03-24 16:42:23 +01:00
|
|
|
const bool bNewShowComplRegConnList,
|
|
|
|
const bool bShowAnalyzerConsole,
|
2019-04-12 18:42:05 +02:00
|
|
|
QWidget* parent = nullptr,
|
|
|
|
Qt::WindowFlags f = nullptr );
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
|
|
|
void SetMyWindowTitle ( const int iNumClients );
|
2013-05-03 21:11:01 +02:00
|
|
|
void ShowConnectionSetupDialog();
|
2015-01-31 09:18:17 +01:00
|
|
|
void ShowMusicianProfileDialog();
|
2013-01-23 11:41:13 +01:00
|
|
|
void ShowGeneralSettings();
|
2014-02-25 15:38:12 +01:00
|
|
|
void ShowChatWindow ( const bool bForceRaise = true );
|
2013-03-02 20:52:13 +01:00
|
|
|
void ShowAnalyzerConsole();
|
2013-01-23 11:41:13 +01:00
|
|
|
void UpdateAudioFaderSlider();
|
|
|
|
void UpdateRevSelection();
|
2013-05-03 21:11:01 +02:00
|
|
|
void Connect ( const QString& strSelectedAddress,
|
|
|
|
const QString& strMixerBoardLabel );
|
|
|
|
void Disconnect();
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
CClient* pClient;
|
|
|
|
CSettings* pSettings;
|
|
|
|
|
|
|
|
bool bConnected;
|
2020-04-13 07:46:28 +02:00
|
|
|
bool bConnectDlgWasShown;
|
2013-01-23 11:41:13 +01:00
|
|
|
QTimer TimerSigMet;
|
2014-01-03 09:54:49 +01:00
|
|
|
QTimer TimerBuffersLED;
|
2013-01-23 11:41:13 +01:00
|
|
|
QTimer TimerStatus;
|
|
|
|
QTimer TimerPing;
|
|
|
|
|
2020-04-30 16:16:59 +02:00
|
|
|
virtual void closeEvent ( QCloseEvent* Event );
|
2013-01-23 11:41:13 +01:00
|
|
|
void UpdateDisplay();
|
|
|
|
|
|
|
|
QMenu* pViewMenu;
|
|
|
|
QMenuBar* pMenu;
|
2013-02-11 16:53:52 +01:00
|
|
|
QMenu* pInstrPictPopupMenu;
|
2015-01-24 16:38:39 +01:00
|
|
|
QMenu* pCountryFlagPopupMenu;
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
CClientSettingsDlg ClientSettingsDlg;
|
|
|
|
CChatDlg ChatDlg;
|
|
|
|
CConnectDlg ConnectDlg;
|
2013-03-02 20:52:13 +01:00
|
|
|
CAnalyzerConsole AnalyzerConsole;
|
2015-01-31 09:18:17 +01:00
|
|
|
CMusProfDlg MusicianProfileDlg;
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void OnAboutToQuit() { pSettings->Save(); }
|
|
|
|
|
|
|
|
void OnConnectDisconBut();
|
|
|
|
void OnTimerSigMet();
|
2014-01-03 09:54:49 +01:00
|
|
|
void OnTimerBuffersLED();
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
void OnTimerStatus() { UpdateDisplay(); }
|
|
|
|
|
|
|
|
void OnTimerPing();
|
|
|
|
void OnPingTimeResult ( int iPingTime );
|
|
|
|
void OnCLPingTimeWithNumClientsReceived ( CHostAddress InetAddr,
|
|
|
|
int iPingTime,
|
|
|
|
int iNumClients );
|
|
|
|
|
2019-01-12 13:59:16 +01:00
|
|
|
void OnControllerInFaderLevel ( const int iChannelIdx,
|
|
|
|
const int iValue ) { MainMixerBoard->SetFaderLevel ( iChannelIdx,
|
|
|
|
iValue ); }
|
2019-01-12 13:45:08 +01:00
|
|
|
|
2020-05-19 18:28:52 +02:00
|
|
|
void OnVersionAndOSReceived ( COSUtil::EOpSystemType ,
|
2020-05-18 21:28:49 +02:00
|
|
|
QString strVersion );
|
|
|
|
|
2014-02-23 10:46:25 +01:00
|
|
|
#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING
|
2014-02-21 22:25:26 +01:00
|
|
|
void OnCLVersionAndOSReceived ( CHostAddress InetAddr,
|
|
|
|
COSUtil::EOpSystemType eOSType,
|
|
|
|
QString strVersion )
|
|
|
|
{ ConnectDlg.SetVersionAndOSType ( InetAddr, eOSType, strVersion ); }
|
2014-02-23 10:46:25 +01:00
|
|
|
#endif
|
2014-02-21 22:25:26 +01:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
void OnOpenConnectionSetupDialog() { ShowConnectionSetupDialog(); }
|
2015-01-31 09:18:17 +01:00
|
|
|
void OnOpenMusicianProfileDialog() { ShowMusicianProfileDialog(); }
|
2013-01-23 11:41:13 +01:00
|
|
|
void OnOpenGeneralSettings() { ShowGeneralSettings(); }
|
|
|
|
void OnOpenChatDialog() { ShowChatWindow(); }
|
2013-03-02 20:52:13 +01:00
|
|
|
void OnOpenAnalyzerConsole() { ShowAnalyzerConsole(); }
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
void OnSettingsStateChanged ( int value );
|
|
|
|
void OnChatStateChanged ( int value );
|
2020-04-16 17:54:45 +02:00
|
|
|
void OnLocalMuteStateChanged ( int value );
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
void OnAudioPanValueChanged ( int value );
|
|
|
|
|
|
|
|
void OnAudioReverbValueChanged ( int value )
|
|
|
|
{ pClient->SetReverbLevel ( value ); }
|
|
|
|
|
|
|
|
void OnReverbSelLClicked()
|
|
|
|
{ pClient->SetReverbOnLeftChan ( true ); }
|
|
|
|
|
|
|
|
void OnReverbSelRClicked()
|
|
|
|
{ pClient->SetReverbOnLeftChan ( false ); }
|
|
|
|
|
2013-02-11 16:53:52 +01:00
|
|
|
void OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo );
|
2013-01-23 11:41:13 +01:00
|
|
|
void OnChatTextReceived ( QString strChatText );
|
2015-01-23 20:43:18 +01:00
|
|
|
void OnLicenceRequired ( ELicenceType eLicenceType );
|
2013-01-23 11:41:13 +01:00
|
|
|
|
2020-05-26 20:45:10 +02:00
|
|
|
void OnChangeChanGain ( int iId, double dGain, bool bIsMyOwnFader )
|
|
|
|
{ pClient->SetRemoteChanGain ( iId, dGain, bIsMyOwnFader ); }
|
2013-01-23 11:41:13 +01:00
|
|
|
|
2020-04-26 00:55:28 +02:00
|
|
|
void OnChangeChanPan ( int iId, double dPan )
|
2020-05-18 20:46:46 +02:00
|
|
|
{ pClient->SetRemoteChanPan ( iId, dPan ); }
|
2020-04-26 00:55:28 +02:00
|
|
|
|
2013-01-23 11:41:13 +01:00
|
|
|
void OnNewLocalInputText ( QString strChatText )
|
|
|
|
{ pClient->CreateChatTextMes ( strChatText ); }
|
|
|
|
|
|
|
|
void OnReqServerListQuery ( CHostAddress InetAddr )
|
|
|
|
{ pClient->CreateCLReqServerListMes ( InetAddr ); }
|
|
|
|
|
|
|
|
void OnCreateCLServerListPingMes ( CHostAddress InetAddr )
|
|
|
|
{ pClient->CreateCLServerListPingMes ( InetAddr ); }
|
|
|
|
|
2014-02-21 22:25:26 +01:00
|
|
|
void OnCreateCLServerListReqVerAndOSMes ( CHostAddress InetAddr )
|
|
|
|
{ pClient->CreateCLServerListReqVerAndOSMes ( InetAddr ); }
|
|
|
|
|
2015-12-09 16:50:30 +01:00
|
|
|
void OnCreateCLServerListReqConnClientsListMes ( CHostAddress InetAddr )
|
|
|
|
{ pClient->CreateCLServerListReqConnClientsListMes ( InetAddr ); }
|
|
|
|
|
2013-01-23 11:41:13 +01:00
|
|
|
void OnCLServerListReceived ( CHostAddress InetAddr,
|
|
|
|
CVector<CServerInfo> vecServerInfo )
|
|
|
|
{ ConnectDlg.SetServerList ( InetAddr, vecServerInfo ); }
|
|
|
|
|
2015-12-09 16:50:30 +01:00
|
|
|
void OnCLConnClientsListMesReceived ( CHostAddress InetAddr,
|
|
|
|
CVector<CChannelInfo> vecChanInfo )
|
|
|
|
{ ConnectDlg.SetConnClientsList ( InetAddr, vecChanInfo ); }
|
|
|
|
|
2020-05-26 17:28:44 +02:00
|
|
|
void OnClientIDReceived ( int iChanID )
|
|
|
|
{ MainMixerBoard->SetMyChannelID ( iChanID ); }
|
|
|
|
|
2020-05-21 18:26:33 +02:00
|
|
|
void OnMuteStateHasChangedReceived ( int iChanID, bool bIsMuted )
|
|
|
|
{ MainMixerBoard->SetRemoteFaderIsMute ( iChanID, bIsMuted ); }
|
|
|
|
|
2020-03-29 23:42:04 +02:00
|
|
|
void OnCLChannelLevelListReceived ( CHostAddress /* unused */,
|
|
|
|
CVector<uint16_t> vecLevelList )
|
|
|
|
{ MainMixerBoard->SetChannelLevels ( vecLevelList ); }
|
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
void OnConnectDlgAccepted();
|
2020-05-12 18:12:45 +02:00
|
|
|
void OnDisconnected() { Disconnect(); }
|
2020-04-12 12:33:50 +02:00
|
|
|
void OnCentralServerAddressTypeChanged();
|
2013-01-23 11:41:13 +01:00
|
|
|
|
|
|
|
void OnGUIDesignChanged()
|
|
|
|
{ SetGUIDesign ( pClient->GetGUIDesign() ); }
|
|
|
|
|
2020-03-30 22:36:25 +02:00
|
|
|
void OnDisplayChannelLevelsChanged()
|
|
|
|
{ MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); }
|
|
|
|
|
2014-02-24 20:51:57 +01:00
|
|
|
void OnAudioChannelsChanged() { UpdateRevSelection(); }
|
2013-01-23 11:41:13 +01:00
|
|
|
void OnNumClientsChanged ( int iNewNumClients );
|
2015-11-25 16:52:00 +01:00
|
|
|
void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; }
|
2019-04-03 19:12:45 +02:00
|
|
|
|
2019-04-12 18:55:43 +02:00
|
|
|
void accept() { close(); } // introduced by pljones
|
2019-04-12 18:42:05 +02:00
|
|
|
|
|
|
|
void keyPressEvent ( QKeyEvent *e ) // block escape key
|
|
|
|
{ if ( e->key() != Qt::Key_Escape ) QDialog::keyPressEvent ( e ); }
|
2013-01-23 11:41:13 +01:00
|
|
|
};
|