show the server name in the title of the audio mixer board
This commit is contained in:
parent
1b94baa9e2
commit
59c9d9e364
6 changed files with 147 additions and 105 deletions
|
@ -281,8 +281,8 @@ double CChannelFader::CalcFaderGain ( const int value )
|
|||
CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
|
||||
QGroupBox ( parent )
|
||||
{
|
||||
// set title text and title properties
|
||||
setTitle ( "Server" );
|
||||
// set title text (default: no server given)
|
||||
SetServerName ( "" );
|
||||
|
||||
// add hboxlayout
|
||||
pMainLayout = new QHBoxLayout ( this );
|
||||
|
@ -329,6 +329,19 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) :
|
|||
QObject::connect ( vecpChanFader[11], SIGNAL ( soloStateChanged ( int ) ), this, SLOT ( OnChSoloStateChangedCh11 ( int ) ) );
|
||||
}
|
||||
|
||||
void CAudioMixerBoard::SetServerName ( const QString& strNewServerName )
|
||||
{
|
||||
// set title text of the group box
|
||||
if ( strNewServerName.isEmpty() )
|
||||
{
|
||||
setTitle ( "Server" );
|
||||
}
|
||||
else
|
||||
{
|
||||
setTitle ( "Server: " + strNewServerName );
|
||||
}
|
||||
}
|
||||
|
||||
void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign )
|
||||
{
|
||||
// apply GUI design to child GUI controls
|
||||
|
|
|
@ -101,6 +101,7 @@ public:
|
|||
|
||||
void HideAll();
|
||||
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
|
||||
void SetServerName ( const QString& strNewServerName );
|
||||
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
||||
|
||||
protected:
|
||||
|
|
|
@ -30,6 +30,7 @@ CConnectDlg::CConnectDlg ( QWidget* parent, Qt::WindowFlags f )
|
|||
: QDialog ( parent, f ),
|
||||
strCentralServerAddress ( "" ),
|
||||
strSelectedAddress ( "" ),
|
||||
strSelectedServerName ( "" ),
|
||||
bServerListReceived ( false ),
|
||||
bStateOK ( false ),
|
||||
bServerListItemWasChosen ( false )
|
||||
|
@ -119,8 +120,9 @@ void CConnectDlg::showEvent ( QShowEvent* )
|
|||
bStateOK = false;
|
||||
bServerListItemWasChosen = false;
|
||||
|
||||
// clear current address
|
||||
strSelectedAddress = "";
|
||||
// clear current address and name
|
||||
strSelectedAddress = "";
|
||||
strSelectedServerName = "";
|
||||
|
||||
// clear server list view
|
||||
ListViewServers->clear();
|
||||
|
@ -154,6 +156,9 @@ void CConnectDlg::hideEvent ( QHideEvent* )
|
|||
strSelectedAddress =
|
||||
CurSelListItemList[0]->data ( 0, Qt::UserRole ).toString();
|
||||
|
||||
// store selected server name
|
||||
strSelectedServerName = CurSelListItemList[0]->text ( 0 );
|
||||
|
||||
// set flag that a server list item was chosen to connect
|
||||
bServerListItemWasChosen = true;
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ public:
|
|||
bool GetStateOK() const { return bStateOK; }
|
||||
bool GetServerListItemWasChosen() const { return bServerListItemWasChosen; }
|
||||
QString GetSelectedAddress() const { return strSelectedAddress; }
|
||||
QString GetSelectedServerName() const { return strSelectedServerName; }
|
||||
|
||||
protected:
|
||||
virtual void showEvent ( QShowEvent* );
|
||||
|
@ -81,6 +82,7 @@ protected:
|
|||
CHostAddress CentralServerAddress;
|
||||
CVector<QString> vstrIPAddresses;
|
||||
QString strSelectedAddress;
|
||||
QString strSelectedServerName;
|
||||
bool bServerListReceived;
|
||||
bool bStateOK;
|
||||
bool bServerListItemWasChosen;
|
||||
|
|
|
@ -799,8 +799,25 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
|
|||
|
||||
if ( bStartOk )
|
||||
{
|
||||
// change connect button text to "disconnect"
|
||||
PushButtonConnect->setText ( CON_BUT_DISCONNECTTEXT );
|
||||
|
||||
// set server name in audio mixer group box title
|
||||
if ( ConnectDlg.GetServerListItemWasChosen() )
|
||||
{
|
||||
// in case a server in the server list was chosen,
|
||||
// display the server name of the server list
|
||||
MainMixerBoard->SetServerName (
|
||||
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
|
||||
MainMixerBoard->SetServerName ( strSelectedAddress );
|
||||
}
|
||||
|
||||
// start timer for level meter bar and ping time measurement
|
||||
TimerSigMet.start ( LEVELMETER_UPDATE_TIME_MS );
|
||||
TimerPing.start ( PING_UPDATE_TIME_MS );
|
||||
|
@ -825,8 +842,12 @@ void CLlconClientDlg::ConnectDisconnect ( const bool bDoStart )
|
|||
pClient->Stop();
|
||||
}
|
||||
|
||||
// change connect button text to "connect"
|
||||
PushButtonConnect->setText ( CON_BUT_CONNECTTEXT );
|
||||
|
||||
// reset server name in audio mixer group box title
|
||||
MainMixerBoard->SetServerName ( "" );
|
||||
|
||||
// stop timer for level meter bars and reset them
|
||||
TimerSigMet.stop();
|
||||
MultiColorLEDBarInputLevelL->setValue ( 0 );
|
||||
|
|
|
@ -407,7 +407,7 @@
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
|
@ -445,7 +445,7 @@
|
|||
<item>
|
||||
<widget class="QLineEdit" name="LineEditFaderTag" >
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
|
||||
<sizepolicy vsizetype="Fixed" hsizetype="Minimum" >
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -470,7 +470,7 @@
|
|||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType" >
|
||||
<enum>QSizePolicy::Expanding</enum>
|
||||
<enum>QSizePolicy::Minimum</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<size>
|
||||
|
|
Loading…
Reference in a new issue