2011-06-16 20:33:48 +02:00
|
|
|
/******************************************************************************\
|
2020-01-01 15:41:43 +01:00
|
|
|
* Copyright (c) 2004-2020
|
2011-06-16 20:33:48 +02: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.,
|
2020-06-08 22:58:11 +02:00
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
2011-06-16 20:33:48 +02:00
|
|
|
*
|
|
|
|
\******************************************************************************/
|
|
|
|
|
2013-03-24 11:49:25 +01:00
|
|
|
#include "clientdlg.h"
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Implementation *************************************************************/
|
2020-06-29 20:43:41 +02:00
|
|
|
CClientDlg::CClientDlg ( CClient* pNCliP,
|
|
|
|
CClientSettings* pNSetP,
|
|
|
|
const QString& strConnOnStartupAddress,
|
|
|
|
const int iCtrlMIDIChannel,
|
|
|
|
const bool bNewShowComplRegConnList,
|
|
|
|
const bool bShowAnalyzerConsole,
|
|
|
|
QWidget* parent,
|
|
|
|
Qt::WindowFlags f ) :
|
2020-04-13 07:46:28 +02:00
|
|
|
QDialog ( parent, f ),
|
|
|
|
pClient ( pNCliP ),
|
|
|
|
pSettings ( pNSetP ),
|
|
|
|
bConnectDlgWasShown ( false ),
|
2020-06-06 15:51:54 +02:00
|
|
|
bMIDICtrlUsed ( iCtrlMIDIChannel != INVALID_MIDI_CH ),
|
2020-07-04 19:55:04 +02:00
|
|
|
ClientSettingsDlg ( pNCliP, pNSetP, parent, Qt::Window ),
|
2020-04-13 07:46:28 +02:00
|
|
|
ChatDlg ( parent, Qt::Window ),
|
2020-05-16 17:35:38 +02:00
|
|
|
ConnectDlg ( pNCliP, bNewShowComplRegConnList, parent, Qt::Dialog ),
|
2020-04-13 07:46:28 +02:00
|
|
|
AnalyzerConsole ( pNCliP, parent, Qt::Window ),
|
|
|
|
MusicianProfileDlg ( pNCliP, parent )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
setupUi ( this );
|
|
|
|
|
|
|
|
|
|
|
|
// Add help text to controls -----------------------------------------------
|
|
|
|
// input level meter
|
2020-06-04 13:33:50 +02:00
|
|
|
QString strInpLevH = "<b>" + tr ( "Input Level Meter" ) + ":</b> " + tr ( "This shows "
|
|
|
|
"the level of the two stereo channels "
|
|
|
|
"for your audio input." ) + "<br>" +
|
2020-05-06 20:50:32 +02:00
|
|
|
tr ( "Make sure not to clip the input signal to avoid distortions of the "
|
2011-06-16 20:33:48 +02:00
|
|
|
"audio signal." );
|
|
|
|
|
2020-06-04 13:33:50 +02:00
|
|
|
QString strInpLevHTT = tr ( "If the application "
|
|
|
|
"is connected to a server and "
|
|
|
|
"you play your instrument/sing into the microphone, the VU "
|
2011-06-16 20:33:48 +02:00
|
|
|
"meter should flicker. If this is not the case, you have "
|
2020-06-04 13:33:50 +02:00
|
|
|
"probably selected the wrong input channel (e.g. 'line in' instead "
|
2011-06-16 20:33:48 +02:00
|
|
|
"of the microphone input) or set the input gain too low in the "
|
2020-06-04 13:33:50 +02:00
|
|
|
"(Windows) audio mixer." ) + "<br>" + tr ( "For proper usage of the "
|
|
|
|
"application, you should not hear your singing/instrument through "
|
|
|
|
"the loudspeaker or your headphone when the software is not connected."
|
|
|
|
"This can be achieved by muting your input audio channel in the "
|
|
|
|
"Playback mixer (not the Recording mixer!)." ) + TOOLTIP_COM_END_TEXT;
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
QString strInpLevHAccText = tr ( "Input level meter" );
|
|
|
|
QString strInpLevHAccDescr = tr ( "Simulates an analog LED level meter." );
|
|
|
|
|
|
|
|
lblInputLEDMeter->setWhatsThis ( strInpLevH );
|
|
|
|
lblLevelMeterLeft->setWhatsThis ( strInpLevH );
|
|
|
|
lblLevelMeterRight->setWhatsThis ( strInpLevH );
|
|
|
|
lbrInputLevelL->setWhatsThis ( strInpLevH );
|
|
|
|
lbrInputLevelL->setAccessibleName ( strInpLevHAccText );
|
|
|
|
lbrInputLevelL->setAccessibleDescription ( strInpLevHAccDescr );
|
|
|
|
lbrInputLevelL->setToolTip ( strInpLevHTT );
|
|
|
|
lbrInputLevelR->setWhatsThis ( strInpLevH );
|
|
|
|
lbrInputLevelR->setAccessibleName ( strInpLevHAccText );
|
|
|
|
lbrInputLevelR->setAccessibleDescription ( strInpLevHAccDescr );
|
|
|
|
lbrInputLevelR->setToolTip ( strInpLevHTT );
|
|
|
|
|
|
|
|
// connect/disconnect button
|
2020-05-06 21:22:24 +02:00
|
|
|
butConnect->setWhatsThis ( "<b>" + tr ( "Connect/Disconnect Button" ) + ":</b> " +
|
2020-06-04 15:31:19 +02:00
|
|
|
tr ( "Opens a dialog where you can select a server to connect to. "
|
2020-06-04 13:33:50 +02:00
|
|
|
"If you are connected, pressing this button will end the session." ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
butConnect->setAccessibleName (
|
|
|
|
tr ( "Connect and disconnect toggle button" ) );
|
|
|
|
|
|
|
|
butConnect->setAccessibleDescription ( tr ( "Clicking on this "
|
|
|
|
"button changes the caption of the button from Connect to "
|
|
|
|
"Disconnect, i.e., it implements a toggle functionality for connecting "
|
2020-06-04 13:33:50 +02:00
|
|
|
"and disconnecting the application." ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// local audio input fader
|
2020-05-06 21:22:24 +02:00
|
|
|
QString strAudFader = "<b>" + tr ( "Local Audio Input Fader" ) + ":</b> " +
|
2020-06-04 13:33:50 +02:00
|
|
|
tr ( "Controls the relative levels of the left and right local audio "
|
|
|
|
"channels. For a mono signal it acts as a pan between the two channels."
|
|
|
|
"For example, if a microphone is connected to "
|
2011-06-16 20:33:48 +02:00
|
|
|
"the right input channel and an instrument is connected to the left "
|
|
|
|
"input channel which is much louder than the microphone, move the "
|
2020-05-06 21:22:24 +02:00
|
|
|
"audio fader in a direction where the label above the fader shows " ) +
|
|
|
|
"<i>" + tr ( "L" ) + " -x</i>" + tr ( ", where" ) + " <i>x</i> " +
|
|
|
|
tr ( "is the current attenuation indicator." );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
lblAudioPan->setWhatsThis ( strAudFader );
|
|
|
|
lblAudioPanValue->setWhatsThis ( strAudFader );
|
|
|
|
sldAudioPan->setWhatsThis ( strAudFader );
|
|
|
|
|
|
|
|
sldAudioPan->setAccessibleName ( tr ( "Local audio input fader (left/right)" ) );
|
|
|
|
|
|
|
|
// reverberation level
|
2020-06-04 13:33:50 +02:00
|
|
|
QString strAudReverb = "<b>" + tr ( "Reverb effect" ) + ":</b> " +
|
|
|
|
tr ( "Reverb can be applied to one local mono audio channel or to both "
|
2020-05-10 22:55:47 +02:00
|
|
|
"channels in stereo mode. The mono channel selection and the "
|
2020-06-04 13:33:50 +02:00
|
|
|
"reverb level can be modified. For example, if "
|
|
|
|
"a microphone signal is fed in to the right audio channel of the "
|
|
|
|
"sound card and a reverb effect needs to be applied, set the "
|
2011-06-16 20:33:48 +02:00
|
|
|
"channel selector to right and move the fader upwards until the "
|
2020-06-05 13:10:59 +02:00
|
|
|
"desired reverb level is reached." );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
lblAudioReverb->setWhatsThis ( strAudReverb );
|
|
|
|
sldAudioReverb->setWhatsThis ( strAudReverb );
|
|
|
|
|
2020-06-04 13:33:50 +02:00
|
|
|
sldAudioReverb->setAccessibleName ( tr ( "Reverb effect level setting" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// reverberation channel selection
|
2020-06-04 13:33:50 +02:00
|
|
|
QString strRevChanSel = "<b>" + tr ( "Reverb Channel Selection" ) + ":</b> " +
|
2020-05-06 21:29:51 +02:00
|
|
|
tr ( "With these radio buttons the audio input channel on which the "
|
2020-06-04 13:33:50 +02:00
|
|
|
"reverb effect is applied can be chosen. Either the left "
|
2011-06-16 20:33:48 +02:00
|
|
|
"or right input channel can be selected." );
|
|
|
|
|
|
|
|
rbtReverbSelL->setWhatsThis ( strRevChanSel );
|
2020-06-04 13:33:50 +02:00
|
|
|
rbtReverbSelL->setAccessibleName ( tr ( "Left channel selection for reverb" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
rbtReverbSelR->setWhatsThis ( strRevChanSel );
|
2020-06-04 13:33:50 +02:00
|
|
|
rbtReverbSelR->setAccessibleName ( tr ( "Right channel selection for reverb" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// delay LED
|
2020-05-06 21:33:39 +02:00
|
|
|
QString strLEDDelay = "<b>" + tr ( "Delay Status LED" ) + ":</b> " +
|
2020-06-04 15:31:19 +02:00
|
|
|
tr ( "Shows the current audio delay status:" ) +
|
2020-06-04 13:33:50 +02:00
|
|
|
"<ul>"
|
2020-06-04 15:31:19 +02:00
|
|
|
"<li>" "<b>" + tr ( "Green" ) + ":</b> " + tr ( "The delay is perfect for a jam "
|
2020-06-06 11:02:31 +02:00
|
|
|
"session." ) + "</li>"
|
2020-06-04 15:31:19 +02:00
|
|
|
"<li>" "<b>" + tr ( "Yellow" ) + ":</b> " + tr ( "A session is still possible "
|
2020-06-04 13:33:50 +02:00
|
|
|
"but it may be harder to play." ) + "</li>"
|
2020-06-04 15:31:19 +02:00
|
|
|
"<li>" "<b>" + tr ( "Red" ) + ":</b> " + tr ( "The delay is too large for "
|
2020-06-04 13:33:50 +02:00
|
|
|
"jamming." ) + "</li>"
|
|
|
|
"</ul>";
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
lblDelay->setWhatsThis ( strLEDDelay );
|
|
|
|
ledDelay->setWhatsThis ( strLEDDelay );
|
|
|
|
ledDelay->setToolTip ( tr ( "If this LED indicator turns red, "
|
2020-06-05 13:10:59 +02:00
|
|
|
"you will not have much fun using the application." ) +
|
2020-06-04 13:33:50 +02:00
|
|
|
TOOLTIP_COM_END_TEXT );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
ledDelay->setAccessibleName ( tr ( "Delay status LED indicator" ) );
|
|
|
|
|
|
|
|
// buffers LED
|
2020-05-06 21:40:39 +02:00
|
|
|
QString strLEDBuffers = "<b>" + tr ( "Buffers Status LED" ) + ":</b> " +
|
2020-06-04 13:33:50 +02:00
|
|
|
tr ( "The buffers status LED shows the current audio/streaming "
|
2020-06-04 15:31:19 +02:00
|
|
|
"status. If the light is red, the audio stream is interrupted. "
|
2020-06-04 13:33:50 +02:00
|
|
|
"This is caused by one of the following problems:" ) +
|
2011-06-16 20:33:48 +02:00
|
|
|
"<ul>"
|
2020-05-06 21:40:39 +02:00
|
|
|
"<li>" + tr ( "The network jitter buffer is not large enough for the current "
|
|
|
|
"network/audio interface jitter." ) + "</li>"
|
2020-06-04 13:33:50 +02:00
|
|
|
"<li>" + tr ( "The sound card's buffer delay (buffer size) is too small "
|
|
|
|
"(see Settings window)." ) + "</li>"
|
|
|
|
"<li>" + tr ( "The upload or download stream rate is too high for your "
|
|
|
|
"internet bandwidth." ) + "</li>"
|
2020-05-06 21:40:39 +02:00
|
|
|
"<li>" + tr ( "The CPU of the client or server is at 100%." ) + "</li>"
|
|
|
|
"</ul>";
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
lblBuffers->setWhatsThis ( strLEDBuffers );
|
|
|
|
ledBuffers->setWhatsThis ( strLEDBuffers );
|
|
|
|
|
|
|
|
ledBuffers->setAccessibleName ( tr ( "Buffers status LED indicator" ) );
|
|
|
|
|
|
|
|
// init GUI design
|
|
|
|
SetGUIDesign ( pClient->GetGUIDesign() );
|
|
|
|
|
|
|
|
// reset mixer board
|
|
|
|
MainMixerBoard->HideAll();
|
|
|
|
|
2020-03-30 22:36:25 +02:00
|
|
|
// restore channel level display preference
|
|
|
|
MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() );
|
|
|
|
|
2013-02-28 21:54:47 +01:00
|
|
|
// restore fader settings
|
2020-07-04 19:55:04 +02:00
|
|
|
MainMixerBoard->vecStoredFaderTags = pSettings->vecStoredFaderTags;
|
|
|
|
MainMixerBoard->vecStoredFaderLevels = pSettings->vecStoredFaderLevels;
|
|
|
|
MainMixerBoard->vecStoredPanValues = pSettings->vecStoredPanValues;
|
|
|
|
MainMixerBoard->vecStoredFaderIsSolo = pSettings->vecStoredFaderIsSolo;
|
|
|
|
MainMixerBoard->vecStoredFaderIsMute = pSettings->vecStoredFaderIsMute;
|
|
|
|
MainMixerBoard->vecStoredFaderGroupID = pSettings->vecStoredFaderGroupID;
|
|
|
|
MainMixerBoard->iNewClientFaderLevel = pSettings->iNewClientFaderLevel;
|
2013-02-28 21:54:47 +01:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// init status label
|
|
|
|
OnTimerStatus();
|
|
|
|
|
|
|
|
// init connection button text
|
2020-05-06 19:33:27 +02:00
|
|
|
butConnect->setText ( tr ( "C&onnect" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// init input level meter bars
|
2020-06-21 22:39:15 +02:00
|
|
|
lbrInputLevelL->SetValue ( 0 );
|
|
|
|
lbrInputLevelR->SetValue ( 0 );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// init status LEDs
|
2014-01-03 09:54:49 +01:00
|
|
|
ledBuffers->Reset();
|
2011-06-16 20:33:48 +02:00
|
|
|
ledDelay->Reset();
|
|
|
|
|
2020-04-19 10:04:19 +02:00
|
|
|
// init audio in fader
|
2011-06-16 20:33:48 +02:00
|
|
|
sldAudioPan->setRange ( AUD_FADER_IN_MIN, AUD_FADER_IN_MAX );
|
|
|
|
sldAudioPan->setTickInterval ( AUD_FADER_IN_MAX / 5 );
|
|
|
|
UpdateAudioFaderSlider();
|
|
|
|
|
2020-04-19 10:04:19 +02:00
|
|
|
// init audio reverberation
|
2011-06-16 20:33:48 +02:00
|
|
|
sldAudioReverb->setRange ( 0, AUD_REVERB_MAX );
|
|
|
|
const int iCurAudReverb = pClient->GetReverbLevel();
|
|
|
|
sldAudioReverb->setValue ( iCurAudReverb );
|
|
|
|
sldAudioReverb->setTickInterval ( AUD_REVERB_MAX / 5 );
|
|
|
|
|
|
|
|
// init reverb channel
|
|
|
|
UpdateRevSelection();
|
|
|
|
|
2020-04-19 10:04:19 +02:00
|
|
|
// init connect dialog
|
2020-07-04 19:55:04 +02:00
|
|
|
ConnectDlg.SetShowAllMusicians ( pSettings->bConnectDlgShowAllMusicians );
|
2020-04-19 10:04:19 +02:00
|
|
|
|
2013-02-17 22:26:29 +01:00
|
|
|
// set window title (with no clients connected -> "0")
|
|
|
|
SetMyWindowTitle ( 0 );
|
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// Connect on startup ------------------------------------------------------
|
2015-03-25 21:29:52 +01:00
|
|
|
if ( !strConnOnStartupAddress.isEmpty() )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2015-03-25 21:29:52 +01:00
|
|
|
// initiate connection (always show the address in the mixer board
|
|
|
|
// (no alias))
|
|
|
|
Connect ( strConnOnStartupAddress, strConnOnStartupAddress );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Mac Workaround:
|
|
|
|
// If the connect button is the default button, on Mac it is highlighted
|
2020-06-29 21:18:54 +02:00
|
|
|
// by fading in and out a blue background color. This operation consumes so
|
2011-06-16 20:33:48 +02:00
|
|
|
// much CPU that we get audio interruptions.
|
|
|
|
// Better solution: increase thread priority of worker thread (since the
|
|
|
|
// user can always highlight the button manually, too) -> TODO
|
|
|
|
#if defined ( __APPLE__ ) || defined ( __MACOSX )
|
|
|
|
butConnect->setDefault ( false );
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
// View menu --------------------------------------------------------------
|
2020-05-06 19:33:27 +02:00
|
|
|
pViewMenu = new QMenu ( tr ( "&View" ), this );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
pViewMenu->addAction ( tr ( "&Connection Setup..." ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnOpenConnectionSetupDialog() ) );
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2015-01-31 09:18:17 +01:00
|
|
|
pViewMenu->addAction ( tr ( "My &Profile..." ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnOpenMusicianProfileDialog() ) );
|
2015-01-31 09:18:17 +01:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
pViewMenu->addAction ( tr ( "C&hat..." ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnOpenChatDialog() ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2014-02-25 16:50:09 +01:00
|
|
|
pViewMenu->addAction ( tr ( "&Settings..." ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnOpenGeneralSettings() ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-03-02 20:52:13 +01:00
|
|
|
// optionally show analyzer console entry
|
|
|
|
if ( bShowAnalyzerConsole )
|
|
|
|
{
|
|
|
|
pViewMenu->addAction ( tr ( "&Analyzer Console..." ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnOpenAnalyzerConsole() ) );
|
2013-03-02 20:52:13 +01:00
|
|
|
}
|
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
pViewMenu->addSeparator();
|
|
|
|
|
|
|
|
pViewMenu->addAction ( tr ( "E&xit" ), this,
|
|
|
|
SLOT ( close() ), QKeySequence ( Qt::CTRL + Qt::Key_Q ) );
|
|
|
|
|
|
|
|
|
2020-06-08 17:34:45 +02:00
|
|
|
// Edit menu --------------------------------------------------------------
|
|
|
|
pEditMenu = new QMenu ( tr ( "&Edit" ), this );
|
|
|
|
|
2020-06-13 01:14:43 +02:00
|
|
|
pEditMenu->addAction ( tr ( "Sort Channel Users by &Name" ), this,
|
2020-06-11 10:48:44 +02:00
|
|
|
SLOT ( OnSortChannelsByName() ), QKeySequence ( Qt::CTRL + Qt::Key_N ) );
|
2020-06-08 17:34:45 +02:00
|
|
|
|
2020-06-13 01:14:43 +02:00
|
|
|
pEditMenu->addAction ( tr ( "Sort Channel Users by &Instrument" ), this,
|
|
|
|
SLOT ( OnSortChannelsByInstrument() ), QKeySequence ( Qt::CTRL + Qt::Key_I ) );
|
|
|
|
|
2020-07-04 11:52:09 +02:00
|
|
|
pEditMenu->addAction ( tr ( "Sort Channel Users by &Group" ), this,
|
|
|
|
SLOT ( OnSortChannelsByGroupID() ), QKeySequence ( Qt::CTRL + Qt::Key_G ) );
|
|
|
|
|
2020-06-08 17:34:45 +02:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// Main menu bar -----------------------------------------------------------
|
|
|
|
pMenu = new QMenuBar ( this );
|
|
|
|
|
|
|
|
pMenu->addMenu ( pViewMenu );
|
2020-06-08 17:34:45 +02:00
|
|
|
pMenu->addMenu ( pEditMenu );
|
2020-05-02 08:24:01 +02:00
|
|
|
pMenu->addMenu ( new CHelpMenu ( true, this ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// Now tell the layout about the menu
|
|
|
|
layout()->setMenuBar ( pMenu );
|
|
|
|
|
|
|
|
|
2013-02-11 16:53:52 +01:00
|
|
|
// Instrument pictures popup menu ------------------------------------------
|
|
|
|
pInstrPictPopupMenu = new QMenu ( this );
|
|
|
|
|
|
|
|
// add an entry for all known instruments
|
|
|
|
for ( int iCurInst = 0; iCurInst < CInstPictures::GetNumAvailableInst(); iCurInst++ )
|
|
|
|
{
|
|
|
|
// create a menu action with text and image
|
|
|
|
QAction* pCurAction = new QAction (
|
|
|
|
QIcon ( CInstPictures::GetResourceReference ( iCurInst ) ),
|
|
|
|
CInstPictures::GetName ( iCurInst ),
|
|
|
|
this );
|
|
|
|
|
|
|
|
// add data to identify the action data when it is triggered
|
|
|
|
pCurAction->setData ( iCurInst );
|
|
|
|
|
|
|
|
pInstrPictPopupMenu->addAction ( pCurAction );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-01-24 16:38:39 +01:00
|
|
|
// Country flag icons popup menu -------------------------------------------
|
|
|
|
pCountryFlagPopupMenu = new QMenu ( this );
|
|
|
|
|
|
|
|
// add an entry for all known country flags
|
|
|
|
for ( int iCurCntry = static_cast<int> ( QLocale::AnyCountry );
|
|
|
|
iCurCntry < static_cast<int> ( QLocale::LastCountry ); iCurCntry++ )
|
|
|
|
{
|
|
|
|
// the "Default" country gets a special icon
|
|
|
|
QIcon CurFlagIcon;
|
|
|
|
QString sCurCountryName;
|
|
|
|
|
|
|
|
if ( static_cast<QLocale::Country> ( iCurCntry ) == QLocale::AnyCountry )
|
|
|
|
{
|
|
|
|
// default icon and name for no flag selected
|
|
|
|
CurFlagIcon.addFile ( ":/png/flags/res/flags/flagnone.png" );
|
2020-05-06 19:33:27 +02:00
|
|
|
sCurCountryName = tr ( "None" );
|
2015-01-24 16:38:39 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// get current country enum
|
|
|
|
QLocale::Country eCountry =
|
|
|
|
static_cast<QLocale::Country> ( iCurCntry );
|
|
|
|
|
|
|
|
// get resource file name
|
2020-04-11 10:31:26 +02:00
|
|
|
CurFlagIcon.addFile ( CLocale::GetCountryFlagIconsResourceReference ( eCountry ) );
|
2015-01-24 16:38:39 +01:00
|
|
|
|
|
|
|
// get the country name
|
|
|
|
sCurCountryName = QLocale::countryToString ( eCountry );
|
|
|
|
}
|
|
|
|
|
|
|
|
// only add the entry if a flag is available
|
|
|
|
if ( !CurFlagIcon.isNull() )
|
|
|
|
{
|
|
|
|
// create a menu action with text and image
|
|
|
|
QAction* pCurAction =
|
|
|
|
new QAction ( CurFlagIcon, sCurCountryName, this );
|
|
|
|
|
|
|
|
// add data to identify the action data when it is triggered
|
|
|
|
pCurAction->setData ( iCurCntry );
|
|
|
|
|
|
|
|
pCountryFlagPopupMenu->addAction ( pCurAction );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-08-26 21:59:18 +02:00
|
|
|
// Window positions --------------------------------------------------------
|
|
|
|
// main window
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( !pSettings->vecWindowPosMain.isEmpty() && !pSettings->vecWindowPosMain.isNull() )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
2020-07-04 19:55:04 +02:00
|
|
|
restoreGeometry ( pSettings->vecWindowPosMain );
|
2013-08-26 21:59:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// settings window
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( !pSettings->vecWindowPosSettings.isEmpty() && !pSettings->vecWindowPosSettings.isNull() )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
2020-07-04 19:55:04 +02:00
|
|
|
ClientSettingsDlg.restoreGeometry ( pSettings->vecWindowPosSettings );
|
2013-08-26 21:59:18 +02:00
|
|
|
}
|
|
|
|
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( pSettings->bWindowWasShownSettings )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
|
|
|
ShowGeneralSettings();
|
|
|
|
}
|
|
|
|
|
|
|
|
// chat window
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( !pSettings->vecWindowPosChat.isEmpty() && !pSettings->vecWindowPosChat.isNull() )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
2020-07-04 19:55:04 +02:00
|
|
|
ChatDlg.restoreGeometry ( pSettings->vecWindowPosChat );
|
2013-08-26 21:59:18 +02:00
|
|
|
}
|
|
|
|
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( pSettings->bWindowWasShownChat )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
|
|
|
ShowChatWindow();
|
|
|
|
}
|
|
|
|
|
2015-01-31 09:18:17 +01:00
|
|
|
// musician profile window
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( !pSettings->vecWindowPosProfile.isEmpty() && !pSettings->vecWindowPosProfile.isNull() )
|
2015-01-31 09:18:17 +01:00
|
|
|
{
|
2020-07-04 19:55:04 +02:00
|
|
|
MusicianProfileDlg.restoreGeometry ( pSettings->vecWindowPosProfile );
|
2015-01-31 09:18:17 +01:00
|
|
|
}
|
|
|
|
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( pSettings->bWindowWasShownProfile )
|
2015-01-31 09:18:17 +01:00
|
|
|
{
|
|
|
|
ShowMusicianProfileDialog();
|
|
|
|
}
|
|
|
|
|
2013-08-26 21:59:18 +02:00
|
|
|
// connection setup window
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( !pSettings->vecWindowPosConnect.isEmpty() && !pSettings->vecWindowPosConnect.isNull() )
|
2013-08-26 21:59:18 +02:00
|
|
|
{
|
2020-07-04 19:55:04 +02:00
|
|
|
ConnectDlg.restoreGeometry ( pSettings->vecWindowPosConnect );
|
2013-08-26 21:59:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// Connections -------------------------------------------------------------
|
|
|
|
// push buttons
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( butConnect, &QPushButton::clicked,
|
|
|
|
this, &CClientDlg::OnConnectDisconBut );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// check boxes
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( chbSettings, &QCheckBox::stateChanged,
|
|
|
|
this, &CClientDlg::OnSettingsStateChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( chbChat, &QCheckBox::stateChanged,
|
|
|
|
this, &CClientDlg::OnChatStateChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( chbLocalMute, &QCheckBox::stateChanged,
|
|
|
|
this, &CClientDlg::OnLocalMuteStateChanged );
|
2015-01-31 11:04:15 +01:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// timers
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &TimerSigMet, &QTimer::timeout,
|
|
|
|
this, &CClientDlg::OnTimerSigMet );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &TimerBuffersLED, &QTimer::timeout,
|
|
|
|
this, &CClientDlg::OnTimerBuffersLED );
|
2014-01-03 09:54:49 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &TimerStatus, &QTimer::timeout,
|
|
|
|
this, &CClientDlg::OnTimerStatus );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &TimerPing, &QTimer::timeout,
|
|
|
|
this, &CClientDlg::OnTimerPing );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// sliders
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( sldAudioPan, &QSlider::valueChanged,
|
|
|
|
this, &CClientDlg::OnAudioPanValueChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( sldAudioReverb, &QSlider::valueChanged,
|
|
|
|
this, &CClientDlg::OnAudioReverbValueChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// radio buttons
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( rbtReverbSelL, &QRadioButton::clicked,
|
|
|
|
this, &CClientDlg::OnReverbSelLClicked );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( rbtReverbSelR, &QRadioButton::clicked,
|
|
|
|
this, &CClientDlg::OnReverbSelRClicked );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// other
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::ConClientListMesReceived,
|
|
|
|
this, &CClientDlg::OnConClientListMesReceived );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::Disconnected,
|
|
|
|
this, &CClientDlg::OnDisconnected );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CentralServerAddressTypeChanged,
|
|
|
|
this, &CClientDlg::OnCentralServerAddressTypeChanged );
|
2020-04-12 12:33:50 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::ChatTextReceived,
|
|
|
|
this, &CClientDlg::OnChatTextReceived );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::ClientIDReceived,
|
|
|
|
this, &CClientDlg::OnClientIDReceived );
|
2020-05-26 17:28:44 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::MuteStateHasChangedReceived,
|
|
|
|
this, &CClientDlg::OnMuteStateHasChangedReceived );
|
2020-05-21 11:47:39 +02:00
|
|
|
|
2020-06-14 23:02:13 +02:00
|
|
|
QObject::connect ( pClient, &CClient::RecorderStateReceived,
|
|
|
|
this, &CClientDlg::OnRecorderStateReceived );
|
|
|
|
|
2015-01-23 20:43:18 +01:00
|
|
|
// This connection is a special case. On receiving a licence required message via the
|
|
|
|
// protocol, a modal licence dialog is opened. Since this blocks the thread, we need
|
|
|
|
// a queued connection to make sure the core protocol mechanism is not blocked, too.
|
|
|
|
qRegisterMetaType<ELicenceType> ( "ELicenceType" );
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::LicenceRequired,
|
|
|
|
this, &CClientDlg::OnLicenceRequired, Qt::QueuedConnection );
|
2015-01-23 20:43:18 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::PingTimeReceived,
|
|
|
|
this, &CClientDlg::OnPingTimeResult );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CLServerListReceived,
|
|
|
|
this, &CClientDlg::OnCLServerListReceived );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CLConnClientsListMesReceived,
|
|
|
|
this, &CClientDlg::OnCLConnClientsListMesReceived );
|
2015-12-09 16:50:30 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CLPingTimeWithNumClientsReceived,
|
|
|
|
this, &CClientDlg::OnCLPingTimeWithNumClientsReceived );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::ControllerInFaderLevel,
|
|
|
|
this, &CClientDlg::OnControllerInFaderLevel );
|
2019-01-12 13:45:08 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CLChannelLevelListReceived,
|
|
|
|
this, &CClientDlg::OnCLChannelLevelListReceived );
|
2020-03-29 23:42:04 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::VersionAndOSReceived,
|
|
|
|
this, &CClientDlg::OnVersionAndOSReceived );
|
2020-05-18 21:28:49 +02:00
|
|
|
|
2014-02-23 10:46:25 +01:00
|
|
|
#ifdef ENABLE_CLIENT_VERSION_AND_OS_DEBUGGING
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( pClient, &CClient::CLVersionAndOSReceived,
|
|
|
|
this, &CClientDlg::OnCLVersionAndOSReceived );
|
2014-02-23 10:46:25 +01:00
|
|
|
#endif
|
2014-02-21 22:25:26 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( QCoreApplication::instance(), &QCoreApplication::aboutToQuit,
|
|
|
|
this, &CClientDlg::OnAboutToQuit );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::GUIDesignChanged,
|
|
|
|
this, &CClientDlg::OnGUIDesignChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::DisplayChannelLevelsChanged,
|
|
|
|
this, &CClientDlg::OnDisplayChannelLevelsChanged );
|
2020-03-30 22:36:25 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::AudioChannelsChanged,
|
|
|
|
this, &CClientDlg::OnAudioChannelsChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ClientSettingsDlg, &CClientSettingsDlg::NewClientLevelChanged,
|
|
|
|
this, &CClientDlg::OnNewClientLevelChanged );
|
2015-11-25 16:52:00 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( MainMixerBoard, &CAudioMixerBoard::ChangeChanGain,
|
|
|
|
this, &CClientDlg::OnChangeChanGain );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( MainMixerBoard, &CAudioMixerBoard::ChangeChanPan,
|
|
|
|
this, &CClientDlg::OnChangeChanPan );
|
2020-04-26 00:55:28 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( MainMixerBoard, &CAudioMixerBoard::NumClientsChanged,
|
|
|
|
this, &CClientDlg::OnNumClientsChanged );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ChatDlg, &CChatDlg::NewLocalInputText,
|
|
|
|
this, &CClientDlg::OnNewLocalInputText );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ConnectDlg, &CConnectDlg::ReqServerListQuery,
|
|
|
|
this, &CClientDlg::OnReqServerListQuery );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-04-03 21:45:36 +02:00
|
|
|
// note that this connection must be a queued connection, otherwise the server list ping
|
|
|
|
// times are not accurate and the client list may not be retrieved for all servers listed
|
|
|
|
// (it seems the sendto() function needs to be called from different threads to fire the
|
|
|
|
// packet immediately and do not collect packets before transmitting)
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ConnectDlg, &CConnectDlg::CreateCLServerListPingMes,
|
|
|
|
this, &CClientDlg::OnCreateCLServerListPingMes, Qt::QueuedConnection );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ConnectDlg, &CConnectDlg::CreateCLServerListReqVerAndOSMes,
|
|
|
|
this, &CClientDlg::OnCreateCLServerListReqVerAndOSMes );
|
2014-02-21 22:25:26 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ConnectDlg, &CConnectDlg::CreateCLServerListReqConnClientsListMes,
|
|
|
|
this, &CClientDlg::OnCreateCLServerListReqConnClientsListMes );
|
2015-12-09 16:50:30 +01:00
|
|
|
|
2020-06-06 17:19:25 +02:00
|
|
|
QObject::connect ( &ConnectDlg, &CConnectDlg::accepted,
|
|
|
|
this, &CClientDlg::OnConnectDlgAccepted );
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-05-25 21:07:25 +02:00
|
|
|
// Initializations which have to be done after the signals are connected ---
|
2011-06-16 20:33:48 +02:00
|
|
|
// start timer for status bar
|
|
|
|
TimerStatus.start ( LED_BAR_UPDATE_TIME_MS );
|
2020-05-25 21:07:25 +02:00
|
|
|
|
|
|
|
// restore connect dialog
|
2020-07-04 19:55:04 +02:00
|
|
|
if ( pSettings->bWindowWasShownConnect )
|
2020-05-25 21:07:25 +02:00
|
|
|
{
|
|
|
|
ShowConnectionSetupDialog();
|
|
|
|
}
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::closeEvent ( QCloseEvent* Event )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2013-08-26 21:59:18 +02:00
|
|
|
// store window positions
|
2020-07-04 19:55:04 +02:00
|
|
|
pSettings->vecWindowPosMain = saveGeometry();
|
|
|
|
pSettings->vecWindowPosSettings = ClientSettingsDlg.saveGeometry();
|
|
|
|
pSettings->vecWindowPosChat = ChatDlg.saveGeometry();
|
|
|
|
pSettings->vecWindowPosProfile = MusicianProfileDlg.saveGeometry();
|
|
|
|
pSettings->vecWindowPosConnect = ConnectDlg.saveGeometry();
|
2013-08-26 21:59:18 +02:00
|
|
|
|
2020-07-04 19:55:04 +02:00
|
|
|
pSettings->bWindowWasShownSettings = ClientSettingsDlg.isVisible();
|
|
|
|
pSettings->bWindowWasShownChat = ChatDlg.isVisible();
|
|
|
|
pSettings->bWindowWasShownProfile = MusicianProfileDlg.isVisible();
|
|
|
|
pSettings->bWindowWasShownConnect = ConnectDlg.isVisible();
|
2013-08-26 21:59:18 +02:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// if settings/connect dialog or chat dialog is open, close it
|
|
|
|
ClientSettingsDlg.close();
|
|
|
|
ChatDlg.close();
|
2015-01-31 09:18:17 +01:00
|
|
|
MusicianProfileDlg.close();
|
2013-08-26 21:59:18 +02:00
|
|
|
ConnectDlg.close();
|
2013-03-02 20:52:13 +01:00
|
|
|
AnalyzerConsole.close();
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
// if connected, terminate connection
|
|
|
|
if ( pClient->IsRunning() )
|
|
|
|
{
|
|
|
|
pClient->Stop();
|
|
|
|
}
|
|
|
|
|
2013-02-28 21:54:47 +01:00
|
|
|
// store mixer fader settings (we have to hide all mixer faders first to
|
|
|
|
// initiate a storage of the current mixer fader levels in case we are
|
2020-04-19 10:04:19 +02:00
|
|
|
// just in a connected state) and other settings
|
2013-02-28 21:54:47 +01:00
|
|
|
MainMixerBoard->HideAll();
|
2020-07-04 19:55:04 +02:00
|
|
|
pSettings->vecStoredFaderTags = MainMixerBoard->vecStoredFaderTags;
|
|
|
|
pSettings->vecStoredFaderLevels = MainMixerBoard->vecStoredFaderLevels;
|
|
|
|
pSettings->vecStoredPanValues = MainMixerBoard->vecStoredPanValues;
|
|
|
|
pSettings->vecStoredFaderIsSolo = MainMixerBoard->vecStoredFaderIsSolo;
|
|
|
|
pSettings->vecStoredFaderIsMute = MainMixerBoard->vecStoredFaderIsMute;
|
|
|
|
pSettings->vecStoredFaderGroupID = MainMixerBoard->vecStoredFaderGroupID;
|
|
|
|
pSettings->iNewClientFaderLevel = MainMixerBoard->iNewClientFaderLevel;
|
|
|
|
pSettings->bConnectDlgShowAllMusicians = ConnectDlg.GetShowAllMusicians();
|
2013-02-28 21:54:47 +01:00
|
|
|
|
2011-06-16 20:33:48 +02:00
|
|
|
// default implementation of this event handler routine
|
|
|
|
Event->accept();
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::UpdateAudioFaderSlider()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// update slider and label of audio fader
|
|
|
|
const int iCurAudInFader = pClient->GetAudioInFader();
|
|
|
|
sldAudioPan->setValue ( iCurAudInFader );
|
|
|
|
|
|
|
|
// show in label the center position and what channel is
|
|
|
|
// attenuated
|
|
|
|
if ( iCurAudInFader == AUD_FADER_IN_MIDDLE )
|
|
|
|
{
|
2020-05-06 19:33:27 +02:00
|
|
|
lblAudioPanValue->setText ( tr ( "Center" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( iCurAudInFader > AUD_FADER_IN_MIDDLE )
|
|
|
|
{
|
|
|
|
// attenuation on right channel
|
2020-05-06 19:33:27 +02:00
|
|
|
lblAudioPanValue->setText ( tr ( "R" ) + " -" +
|
2011-06-16 20:33:48 +02:00
|
|
|
QString().setNum ( iCurAudInFader - AUD_FADER_IN_MIDDLE ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// attenuation on left channel
|
2020-05-06 19:33:27 +02:00
|
|
|
lblAudioPanValue->setText ( tr ( "L" ) + " -" +
|
2011-06-16 20:33:48 +02:00
|
|
|
QString().setNum ( AUD_FADER_IN_MIDDLE - iCurAudInFader ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::UpdateRevSelection()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2014-02-24 20:51:57 +01:00
|
|
|
if ( pClient->GetAudioChannels() == CC_STEREO )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// for stereo make channel selection invisible since
|
|
|
|
// reverberation effect is always applied to both channels
|
|
|
|
rbtReverbSelL->setVisible ( false );
|
|
|
|
rbtReverbSelR->setVisible ( false );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// make radio buttons visible
|
|
|
|
rbtReverbSelL->setVisible ( true );
|
|
|
|
rbtReverbSelR->setVisible ( true );
|
|
|
|
|
|
|
|
// update value
|
|
|
|
if ( pClient->IsReverbOnLeftChan() )
|
|
|
|
{
|
|
|
|
rbtReverbSelL->setChecked ( true );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
rbtReverbSelR->setChecked ( true );
|
|
|
|
}
|
|
|
|
}
|
2020-05-22 20:26:04 +02:00
|
|
|
|
|
|
|
// update visibility of the pan controls in the audio mixer board (pan is not supported for mono)
|
|
|
|
MainMixerBoard->SetDisplayPans ( pClient->GetAudioChannels() != CC_MONO );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnAudioPanValueChanged ( int value )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
pClient->SetAudioInFader ( value );
|
|
|
|
UpdateAudioFaderSlider();
|
|
|
|
}
|
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
void CClientDlg::OnConnectDlgAccepted()
|
|
|
|
{
|
2020-04-13 07:46:28 +02:00
|
|
|
// We had an issue that the accepted signal was emit twice if a list item was double
|
|
|
|
// clicked in the connect dialog. To avoid this we introduced a flag which makes sure
|
|
|
|
// we process the accepted signal only once after the dialog was initially shown.
|
|
|
|
if ( bConnectDlgWasShown )
|
2013-05-03 21:11:01 +02:00
|
|
|
{
|
2020-04-13 07:46:28 +02:00
|
|
|
// get the address from the connect dialog
|
|
|
|
QString strSelectedAddress = ConnectDlg.GetSelectedAddress();
|
|
|
|
|
|
|
|
// only store new host address in our data base if the address is
|
|
|
|
// not empty and it was not a server list item (only the addresses
|
|
|
|
// typed in manually are stored by definition)
|
|
|
|
if ( !strSelectedAddress.isEmpty() &&
|
|
|
|
!ConnectDlg.GetServerListItemWasChosen() )
|
|
|
|
{
|
|
|
|
// store new address at the top of the list, if the list was already
|
|
|
|
// full, the last element is thrown out
|
|
|
|
pClient->vstrIPAddress.StringFiFoWithCompare ( strSelectedAddress );
|
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2020-04-13 07:46:28 +02:00
|
|
|
// get name to be set in audio mixer group box title
|
|
|
|
QString strMixerBoardLabel;
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2020-04-13 07:46:28 +02:00
|
|
|
if ( ConnectDlg.GetServerListItemWasChosen() )
|
2015-10-18 21:07:43 +02:00
|
|
|
{
|
2020-04-13 07:46:28 +02:00
|
|
|
// in case a server in the server list was chosen,
|
|
|
|
// display the server name of the server list
|
|
|
|
strMixerBoardLabel = ConnectDlg.GetSelectedServerName();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// an item of the server address combo box was chosen,
|
|
|
|
// just show the address string as it was entered by the
|
|
|
|
// user
|
|
|
|
strMixerBoardLabel = strSelectedAddress;
|
|
|
|
|
2020-06-29 21:18:54 +02:00
|
|
|
// special case: if the address is empty, we substitute the default
|
2020-04-13 07:46:28 +02:00
|
|
|
// central server address so that a user which just pressed the connect
|
|
|
|
// button without selecting an item in the table or manually entered an
|
|
|
|
// address gets a successful connection
|
|
|
|
if ( strSelectedAddress.isEmpty() )
|
|
|
|
{
|
|
|
|
strSelectedAddress = DEFAULT_SERVER_ADDRESS;
|
2020-05-16 11:24:50 +02:00
|
|
|
strMixerBoardLabel = tr ( "Central Server" );
|
2020-04-13 07:46:28 +02:00
|
|
|
}
|
2015-10-18 21:07:43 +02:00
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2020-04-13 07:46:28 +02:00
|
|
|
// first check if we are already connected, if this is the case we have to
|
|
|
|
// disconnect the old server first
|
|
|
|
if ( pClient->IsRunning() )
|
|
|
|
{
|
|
|
|
Disconnect();
|
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
|
2020-04-13 07:46:28 +02:00
|
|
|
// initiate connection
|
|
|
|
Connect ( strSelectedAddress, strMixerBoardLabel );
|
|
|
|
|
|
|
|
// reset flag
|
|
|
|
bConnectDlgWasShown = false;
|
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnConnectDisconBut()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// the connect/disconnect button implements a toggle functionality
|
2013-05-03 21:11:01 +02:00
|
|
|
if ( pClient->IsRunning() )
|
|
|
|
{
|
|
|
|
Disconnect();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ShowConnectionSetupDialog();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-12 12:33:50 +02:00
|
|
|
void CClientDlg::OnCentralServerAddressTypeChanged()
|
|
|
|
{
|
|
|
|
// if the server list is shown and the server type was changed, update the list
|
|
|
|
if ( ConnectDlg.isVisible() )
|
|
|
|
{
|
|
|
|
ConnectDlg.SetCentralServerAddress ( NetworkUtil::GetCentralServerAddress ( pClient->GetCentralServerAddressType(),
|
|
|
|
pClient->GetServerListCentralServerAddress() ) );
|
|
|
|
|
|
|
|
ConnectDlg.RequestServerList();
|
|
|
|
}
|
2020-05-18 21:28:49 +02:00
|
|
|
}
|
|
|
|
|
2020-05-19 18:28:52 +02:00
|
|
|
void CClientDlg::OnVersionAndOSReceived ( COSUtil::EOpSystemType ,
|
2020-05-18 21:28:49 +02:00
|
|
|
QString strVersion )
|
|
|
|
{
|
2020-05-19 18:28:52 +02:00
|
|
|
// 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
|
2020-04-12 12:33:50 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnChatTextReceived ( QString strChatText )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
ChatDlg.AddChatText ( strChatText );
|
|
|
|
|
2014-02-25 15:38:12 +01:00
|
|
|
// open window (note that we do not want to force the dialog to be upfront
|
|
|
|
// always when a new message arrives since this is annoying)
|
|
|
|
ShowChatWindow ( false );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
UpdateDisplay();
|
|
|
|
}
|
|
|
|
|
2015-01-23 20:43:18 +01:00
|
|
|
void CClientDlg::OnLicenceRequired ( ELicenceType eLicenceType )
|
|
|
|
{
|
|
|
|
// right now only the creative common licence is supported
|
|
|
|
if ( eLicenceType == LT_CREATIVECOMMONS )
|
|
|
|
{
|
|
|
|
CLicenceDlg LicenceDlg;
|
|
|
|
|
2020-04-16 17:54:45 +02:00
|
|
|
// mute the client output stream
|
|
|
|
pClient->SetMuteOutStream ( true );
|
2015-01-23 20:43:18 +01:00
|
|
|
|
|
|
|
// Open the licence dialog and check if the licence was accepted. In
|
|
|
|
// case the dialog is just closed or the decline button was pressed,
|
|
|
|
// disconnect from that server.
|
|
|
|
if ( !LicenceDlg.exec() )
|
|
|
|
{
|
|
|
|
Disconnect();
|
|
|
|
}
|
2020-04-08 14:48:33 +02:00
|
|
|
|
2020-04-16 17:54:45 +02:00
|
|
|
// unmute the client output stream if local mute button is not pressed
|
|
|
|
if ( chbLocalMute->checkState() == Qt::Unchecked )
|
|
|
|
{
|
|
|
|
pClient->SetMuteOutStream ( false );
|
|
|
|
}
|
2015-01-23 20:43:18 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnConClientListMesReceived ( CVector<CChannelInfo> vecChanInfo )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2020-06-06 15:51:54 +02:00
|
|
|
// show channel numbers if --ctrlmidich is used (#241, #95)
|
|
|
|
if ( bMIDICtrlUsed )
|
|
|
|
{
|
|
|
|
for ( int i = 0; i < vecChanInfo.Size(); i++ )
|
|
|
|
{
|
|
|
|
vecChanInfo[i].strName.prepend ( QString().setNum ( vecChanInfo[i].iChanID ) + ":" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-11 16:53:52 +01:00
|
|
|
// update mixer board with the additional client infos
|
2011-06-16 20:33:48 +02:00
|
|
|
MainMixerBoard->ApplyNewConClientList ( vecChanInfo );
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnNumClientsChanged ( int iNewNumClients )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// update window title
|
|
|
|
SetMyWindowTitle ( iNewNumClients );
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::SetMyWindowTitle ( const int iNumClients )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// show number of connected clients in window title (and therefore also in
|
|
|
|
// the task bar of the OS)
|
|
|
|
if ( iNumClients == 0 )
|
|
|
|
{
|
|
|
|
// only application name
|
2020-04-30 22:03:01 +02:00
|
|
|
setWindowTitle ( pClient->strClientName );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ( iNumClients == 1 )
|
|
|
|
{
|
2020-05-06 19:33:27 +02:00
|
|
|
setWindowTitle ( QString ( pClient->strClientName ) + " (1 " + tr ( "user" ) + ")" );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-04-30 22:03:01 +02:00
|
|
|
setWindowTitle ( QString ( pClient->strClientName ) +
|
2020-05-06 19:33:27 +02:00
|
|
|
QString ( " (%1 " + tr ( "users" ) + ")" ).arg ( iNumClients ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
}
|
2015-12-18 21:17:31 +01:00
|
|
|
|
|
|
|
#if defined ( __APPLE__ ) || defined ( __MACOSX )
|
|
|
|
// for MacOS only we show the number of connected clients as a
|
|
|
|
// badge label text if more than one user is connected
|
|
|
|
// (only available in Qt5.2)
|
|
|
|
# if QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)
|
|
|
|
if ( iNumClients > 1 )
|
|
|
|
{
|
|
|
|
// show the number of connected clients
|
|
|
|
QtMac::setBadgeLabelText ( QString ( "%1" ).arg ( iNumClients ) );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// clear the text (apply an empty string)
|
|
|
|
QtMac::setBadgeLabelText ( "" );
|
|
|
|
}
|
|
|
|
# endif
|
|
|
|
#endif
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
void CClientDlg::ShowConnectionSetupDialog()
|
|
|
|
{
|
|
|
|
// init the connect dialog
|
2020-04-12 12:33:50 +02:00
|
|
|
ConnectDlg.Init ( pClient->vstrIPAddress );
|
|
|
|
ConnectDlg.SetCentralServerAddress ( NetworkUtil::GetCentralServerAddress ( pClient->GetCentralServerAddressType(),
|
|
|
|
pClient->GetServerListCentralServerAddress() ) );
|
2013-05-03 21:11:01 +02:00
|
|
|
|
|
|
|
// show connect dialog
|
2020-04-13 07:46:28 +02:00
|
|
|
bConnectDlgWasShown = true;
|
2013-05-03 21:11:01 +02:00
|
|
|
ConnectDlg.show();
|
|
|
|
|
|
|
|
// make sure dialog is upfront and has focus
|
|
|
|
ConnectDlg.raise();
|
|
|
|
ConnectDlg.activateWindow();
|
|
|
|
}
|
|
|
|
|
2015-01-31 09:18:17 +01:00
|
|
|
void CClientDlg::ShowMusicianProfileDialog()
|
|
|
|
{
|
|
|
|
// show musician profile dialog
|
|
|
|
MusicianProfileDlg.show();
|
|
|
|
|
|
|
|
// make sure dialog is upfront and has focus
|
|
|
|
MusicianProfileDlg.raise();
|
|
|
|
MusicianProfileDlg.activateWindow();
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::ShowGeneralSettings()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// open general settings dialog
|
|
|
|
ClientSettingsDlg.show();
|
|
|
|
|
|
|
|
// make sure dialog is upfront and has focus
|
|
|
|
ClientSettingsDlg.raise();
|
|
|
|
ClientSettingsDlg.activateWindow();
|
|
|
|
}
|
|
|
|
|
2014-02-25 15:38:12 +01:00
|
|
|
void CClientDlg::ShowChatWindow ( const bool bForceRaise )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2014-02-25 15:38:12 +01:00
|
|
|
// open chat dialog if it is not visible
|
|
|
|
if ( bForceRaise || !ChatDlg.isVisible() )
|
|
|
|
{
|
|
|
|
ChatDlg.show();
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2014-02-25 15:38:12 +01:00
|
|
|
// make sure dialog is upfront and has focus
|
|
|
|
ChatDlg.raise();
|
|
|
|
ChatDlg.activateWindow();
|
|
|
|
}
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
UpdateDisplay();
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::ShowAnalyzerConsole()
|
2013-03-02 20:52:13 +01:00
|
|
|
{
|
|
|
|
// open analyzer console dialog
|
|
|
|
AnalyzerConsole.show();
|
|
|
|
|
|
|
|
// make sure dialog is upfront and has focus
|
|
|
|
AnalyzerConsole.raise();
|
|
|
|
AnalyzerConsole.activateWindow();
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnSettingsStateChanged ( int value )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
if ( value == Qt::Checked )
|
|
|
|
{
|
|
|
|
ShowGeneralSettings();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ClientSettingsDlg.hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnChatStateChanged ( int value )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
if ( value == Qt::Checked )
|
|
|
|
{
|
|
|
|
ShowChatWindow();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ChatDlg.hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-04-16 17:54:45 +02:00
|
|
|
void CClientDlg::OnLocalMuteStateChanged ( int value )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2020-04-16 17:54:45 +02:00
|
|
|
pClient->SetMuteOutStream ( value == Qt::Checked );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnTimerSigMet()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// show current level
|
2020-06-24 17:54:35 +02:00
|
|
|
lbrInputLevelL->SetValue ( pClient->GetLevelForMeterdBLeft() );
|
|
|
|
lbrInputLevelR->SetValue ( pClient->GetLevelForMeterdBRight() );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2014-01-03 09:54:49 +01:00
|
|
|
void CClientDlg::OnTimerBuffersLED()
|
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
CMultiColorLED::ELightColor eCurStatus;
|
2014-01-03 09:54:49 +01:00
|
|
|
|
|
|
|
// get and reset current buffer state and set LED from that flag
|
|
|
|
if ( pClient->GetAndResetbJitterBufferOKFlag() )
|
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
eCurStatus = CMultiColorLED::RL_GREEN;
|
2014-01-03 09:54:49 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
eCurStatus = CMultiColorLED::RL_RED;
|
2014-01-03 09:54:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// update the buffer LED and the general settings dialog, too
|
2014-01-05 19:26:38 +01:00
|
|
|
ledBuffers->SetLight ( eCurStatus );
|
|
|
|
ClientSettingsDlg.SetStatus ( eCurStatus );
|
2014-01-03 09:54:49 +01:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnTimerPing()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// send ping message to the server
|
|
|
|
pClient->CreateCLPingMes();
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnPingTimeResult ( int iPingTime )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// calculate overall delay
|
|
|
|
const int iOverallDelayMs = pClient->EstimatedOverallDelay ( iPingTime );
|
|
|
|
|
2015-03-21 12:46:25 +01:00
|
|
|
// color definition: <= 43 ms green, <= 68 ms yellow, otherwise red
|
2014-01-05 19:26:38 +01:00
|
|
|
CMultiColorLED::ELightColor eOverallDelayLEDColor;
|
|
|
|
|
2015-03-21 12:46:25 +01:00
|
|
|
if ( iOverallDelayMs <= 43 )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
eOverallDelayLEDColor = CMultiColorLED::RL_GREEN;
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-21 12:46:25 +01:00
|
|
|
if ( iOverallDelayMs <= 68 )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
eOverallDelayLEDColor = CMultiColorLED::RL_YELLOW;
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-05 19:26:38 +01:00
|
|
|
eOverallDelayLEDColor = CMultiColorLED::RL_RED;
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// only update delay information on settings dialog if it is visible to
|
|
|
|
// avoid CPU load on working thread if not necessary
|
|
|
|
if ( ClientSettingsDlg.isVisible() )
|
|
|
|
{
|
|
|
|
// set ping time result to general settings dialog
|
|
|
|
ClientSettingsDlg.SetPingTimeResult ( iPingTime,
|
|
|
|
iOverallDelayMs,
|
2014-01-05 19:26:38 +01:00
|
|
|
eOverallDelayLEDColor );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// update delay LED on the main window
|
2014-01-05 19:26:38 +01:00
|
|
|
ledDelay->SetLight ( eOverallDelayLEDColor );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::OnCLPingTimeWithNumClientsReceived ( CHostAddress InetAddr,
|
|
|
|
int iPingTime,
|
|
|
|
int iNumClients )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// update connection dialog server list
|
|
|
|
ConnectDlg.SetPingTimeAndNumClientsResult ( InetAddr,
|
|
|
|
iPingTime,
|
|
|
|
iNumClients );
|
|
|
|
}
|
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
void CClientDlg::Connect ( const QString& strSelectedAddress,
|
|
|
|
const QString& strMixerBoardLabel )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2013-05-03 21:11:01 +02:00
|
|
|
// set address and check if address is valid
|
|
|
|
if ( pClient->SetServerAddr ( strSelectedAddress ) )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2013-05-03 21:11:01 +02:00
|
|
|
// try to start client, if error occurred, do not go in
|
|
|
|
// running state but show error message
|
|
|
|
try
|
|
|
|
{
|
2015-03-25 21:29:52 +01:00
|
|
|
if ( !pClient->IsRunning() )
|
|
|
|
{
|
|
|
|
pClient->Start();
|
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
}
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2020-06-24 08:39:27 +02:00
|
|
|
catch ( const CGenErr& generr )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
2013-05-03 21:11:01 +02:00
|
|
|
// show error message and return the function
|
2019-05-17 22:55:46 +02:00
|
|
|
QMessageBox::critical ( this, APP_NAME, generr.GetErrorText(), "Close", nullptr );
|
2013-05-03 21:11:01 +02:00
|
|
|
return;
|
2013-02-09 22:23:10 +01:00
|
|
|
}
|
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// change connect button text to "disconnect"
|
2020-05-06 19:33:27 +02:00
|
|
|
butConnect->setText ( tr ( "D&isconnect" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// set server name in audio mixer group box title
|
|
|
|
MainMixerBoard->SetServerName ( strMixerBoardLabel );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// start timer for level meter bar and ping time measurement
|
|
|
|
TimerSigMet.start ( LEVELMETER_UPDATE_TIME_MS );
|
2014-01-03 09:54:49 +01:00
|
|
|
TimerBuffersLED.start ( BUFFER_LED_UPDATE_TIME_MS );
|
2013-05-03 21:11:01 +02:00
|
|
|
TimerPing.start ( PING_UPDATE_TIME_MS );
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
2013-05-03 21:11:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void CClientDlg::Disconnect()
|
|
|
|
{
|
|
|
|
// only stop client if currently running, in case we received
|
|
|
|
// the stopped message, the client is already stopped but the
|
|
|
|
// connect/disconnect button and other GUI controls must be
|
|
|
|
// updated
|
|
|
|
if ( pClient->IsRunning() )
|
|
|
|
{
|
|
|
|
pClient->Stop();
|
|
|
|
}
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// change connect button text to "connect"
|
2020-05-06 19:33:27 +02:00
|
|
|
butConnect->setText ( tr ( "C&onnect" ) );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// reset server name in audio mixer group box title
|
|
|
|
MainMixerBoard->SetServerName ( "" );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// stop timer for level meter bars and reset them
|
|
|
|
TimerSigMet.stop();
|
2020-06-21 22:39:15 +02:00
|
|
|
lbrInputLevelL->SetValue ( 0 );
|
|
|
|
lbrInputLevelR->SetValue ( 0 );
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2014-01-03 09:54:49 +01:00
|
|
|
// stop other timers
|
|
|
|
TimerBuffersLED.stop();
|
2013-05-03 21:11:01 +02:00
|
|
|
TimerPing.stop();
|
2011-06-16 20:33:48 +02:00
|
|
|
|
|
|
|
|
|
|
|
// TODO is this still required???
|
|
|
|
// immediately update status bar
|
|
|
|
OnTimerStatus();
|
|
|
|
|
|
|
|
|
2014-01-03 09:54:49 +01:00
|
|
|
// reset LEDs
|
|
|
|
ledBuffers->Reset();
|
|
|
|
ledDelay->Reset();
|
2014-01-21 22:19:51 +01:00
|
|
|
ClientSettingsDlg.ResetStatusAndPingLED();
|
2011-06-16 20:33:48 +02:00
|
|
|
|
2013-05-03 21:11:01 +02:00
|
|
|
// clear mixer board (remove all faders)
|
|
|
|
MainMixerBoard->HideAll();
|
2011-06-16 20:33:48 +02:00
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::UpdateDisplay()
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// update settings/chat buttons (do not fire signals since it is an update)
|
|
|
|
if ( chbSettings->isChecked() && !ClientSettingsDlg.isVisible() )
|
|
|
|
{
|
|
|
|
chbSettings->blockSignals ( true );
|
|
|
|
chbSettings->setChecked ( false );
|
|
|
|
chbSettings->blockSignals ( false );
|
|
|
|
}
|
|
|
|
if ( !chbSettings->isChecked() && ClientSettingsDlg.isVisible() )
|
|
|
|
{
|
|
|
|
chbSettings->blockSignals ( true );
|
|
|
|
chbSettings->setChecked ( true );
|
|
|
|
chbSettings->blockSignals ( false );
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( chbChat->isChecked() && !ChatDlg.isVisible() )
|
|
|
|
{
|
|
|
|
chbChat->blockSignals ( true );
|
|
|
|
chbChat->setChecked ( false );
|
|
|
|
chbChat->blockSignals ( false );
|
|
|
|
}
|
|
|
|
if ( !chbChat->isChecked() && ChatDlg.isVisible() )
|
|
|
|
{
|
|
|
|
chbChat->blockSignals ( true );
|
|
|
|
chbChat->setChecked ( true );
|
|
|
|
chbChat->blockSignals ( false );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-03-24 16:42:23 +01:00
|
|
|
void CClientDlg::SetGUIDesign ( const EGUIDesign eNewDesign )
|
2011-06-16 20:33:48 +02:00
|
|
|
{
|
|
|
|
// apply GUI design to current window
|
|
|
|
switch ( eNewDesign )
|
|
|
|
{
|
|
|
|
case GD_ORIGINAL:
|
|
|
|
backgroundFrame->setStyleSheet (
|
|
|
|
"QFrame#backgroundFrame { border-image: url(:/png/fader/res/mixerboardbackground.png) 34px 30px 40px 40px;"
|
|
|
|
" border-top: 34px transparent;"
|
|
|
|
" border-bottom: 40px transparent;"
|
|
|
|
" border-left: 30px transparent;"
|
|
|
|
" border-right: 40px transparent;"
|
|
|
|
" padding: -5px;"
|
|
|
|
" margin: -5px, -5px, 0px, 0px; }"
|
2020-04-13 15:35:48 +02:00
|
|
|
"QLabel { color: rgb(220, 220, 220);"
|
2011-06-16 20:33:48 +02:00
|
|
|
" font: bold; }"
|
2020-04-13 15:35:48 +02:00
|
|
|
"QRadioButton { color: rgb(220, 220, 220);"
|
2011-06-16 20:33:48 +02:00
|
|
|
" font: bold; }"
|
2020-04-01 18:41:59 +02:00
|
|
|
"QScrollArea { background: transparent; }"
|
2020-05-20 22:28:52 +02:00
|
|
|
".QWidget { background: transparent; }" // note: matches instances of QWidget, but not of its subclasses
|
2020-04-01 18:41:59 +02:00
|
|
|
"QGroupBox { background: transparent; }"
|
2020-04-13 15:35:48 +02:00
|
|
|
"QGroupBox::title { color: rgb(220, 220, 220); }"
|
2011-06-16 20:33:48 +02:00
|
|
|
"QCheckBox::indicator { width: 38px;"
|
|
|
|
" height: 21px; }"
|
|
|
|
"QCheckBox::indicator:unchecked {"
|
|
|
|
" image: url(:/png/fader/res/ledbuttonnotpressed.png); }"
|
|
|
|
"QCheckBox::indicator:checked {"
|
|
|
|
" image: url(:/png/fader/res/ledbuttonpressed.png); }"
|
2020-04-13 15:35:48 +02:00
|
|
|
"QCheckBox { color: rgb(220, 220, 220);"
|
2011-06-16 20:33:48 +02:00
|
|
|
" font: bold; }" );
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
// Workaround QT-Windows problem: This should not be necessary since in the
|
|
|
|
// background frame the style sheet for QRadioButton was already set. But it
|
|
|
|
// seems that it is only applied if the style was set to default and then back
|
|
|
|
// to GD_ORIGINAL. This seems to be a QT related issue...
|
2020-04-13 15:35:48 +02:00
|
|
|
rbtReverbSelL->setStyleSheet ( "color: rgb(220, 220, 220);"
|
2011-06-16 20:33:48 +02:00
|
|
|
"font: bold;" );
|
2020-04-13 15:35:48 +02:00
|
|
|
rbtReverbSelR->setStyleSheet ( "color: rgb(220, 220, 220);"
|
2011-06-16 20:33:48 +02:00
|
|
|
"font: bold;" );
|
|
|
|
#endif
|
|
|
|
|
2020-06-21 20:09:13 +02:00
|
|
|
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_LED );
|
|
|
|
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_LED );
|
2011-06-16 20:33:48 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-06-29 21:18:54 +02:00
|
|
|
// reset style sheet and set original parameters
|
2011-06-16 20:33:48 +02:00
|
|
|
backgroundFrame->setStyleSheet ( "" );
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
// Workaround QT-Windows problem: See above description
|
|
|
|
rbtReverbSelL->setStyleSheet ( "" );
|
|
|
|
rbtReverbSelR->setStyleSheet ( "" );
|
|
|
|
#endif
|
|
|
|
|
2020-06-21 20:09:13 +02:00
|
|
|
lbrInputLevelL->SetLevelMeterType ( CLevelMeter::MT_BAR );
|
|
|
|
lbrInputLevelR->SetLevelMeterType ( CLevelMeter::MT_BAR );
|
2011-06-16 20:33:48 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
// also apply GUI design to child GUI controls
|
|
|
|
MainMixerBoard->SetGUIDesign ( eNewDesign );
|
|
|
|
}
|