show the server name in the title of the audio mixer board

This commit is contained in:
Volker Fischer 2011-05-04 20:08:06 +00:00
parent 1b94baa9e2
commit 59c9d9e364
6 changed files with 147 additions and 105 deletions

View File

@ -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

View File

@ -101,6 +101,7 @@ public:
void HideAll();
void ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo );
void SetServerName ( const QString& strNewServerName );
void SetGUIDesign ( const EGUIDesign eNewDesign );
protected:

View File

@ -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;
}

View File

@ -1,99 +1,101 @@
/******************************************************************************\
* Copyright (c) 2004-2011
*
* 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.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qwhatsthis.h>
#include <qtimer.h>
#include <qmutex.h>
#include <qlocale.h>
#include "global.h"
#include "client.h"
#ifdef _WIN32
# include "../windows/moc/connectdlgbase.h"
#else
# ifdef _IS_QMAKE_CONFIG
# include "ui_connectdlgbase.h"
# else
# include "moc/connectdlgbase.h"
# endif
#endif
/* Definitions ****************************************************************/
// defines the time interval at which the request server list message is re-
// transmitted until it is received
#define SERV_LIST_REQ_UPDATE_TIME_MS 2000 // ms
/* Classes ********************************************************************/
class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
{
Q_OBJECT
public:
CConnectDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
/******************************************************************************\
* Copyright (c) 2004-2011
*
* 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.h>
#include <qlineedit.h>
#include <qpushbutton.h>
#include <qwhatsthis.h>
#include <qtimer.h>
#include <qmutex.h>
#include <qlocale.h>
#include "global.h"
#include "client.h"
#ifdef _WIN32
# include "../windows/moc/connectdlgbase.h"
#else
# ifdef _IS_QMAKE_CONFIG
# include "ui_connectdlgbase.h"
# else
# include "moc/connectdlgbase.h"
# endif
#endif
/* Definitions ****************************************************************/
// defines the time interval at which the request server list message is re-
// transmitted until it is received
#define SERV_LIST_REQ_UPDATE_TIME_MS 2000 // ms
/* Classes ********************************************************************/
class CConnectDlg : public QDialog, private Ui_CConnectDlgBase
{
Q_OBJECT
public:
CConnectDlg ( QWidget* parent = 0, Qt::WindowFlags f = 0 );
void Init ( const QString strNewCentralServerAddr,
const CVector<QString>& vstrIPAddresses );
void SetServerList ( const CHostAddress& InetAddr,
const CVector<CServerInfo>& vecServerInfo );
void SetPingTimeAndNumClientsResult ( CHostAddress& InetAddr,
const int iPingTime,
const int iPingTimeLEDColor,
const int iNumClients );
bool GetStateOK() const { return bStateOK; }
bool GetServerListItemWasChosen() const { return bServerListItemWasChosen; }
QString GetSelectedAddress() const { return strSelectedAddress; }
protected:
virtual void showEvent ( QShowEvent* );
virtual void hideEvent ( QHideEvent* );
QTimer TimerPing;
QTimer TimerReRequestServList;
QString strCentralServerAddress;
CHostAddress CentralServerAddress;
CVector<QString> vstrIPAddresses;
QString strSelectedAddress;
bool bServerListReceived;
bool bStateOK;
bool bServerListItemWasChosen;
public slots:
void OnServerListItemSelectionChanged();
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
void OnLineEditServerAddrEditTextChanged ( const QString& );
void OnConnectButtonClicked();
void OnTimerPing();
void OnTimerReRequestServList();
signals:
void ReqServerListQuery ( CHostAddress InetAddr );
void CreateCLPingMes ( CHostAddress InetAddr );
};
const CVector<QString>& vstrIPAddresses );
void SetServerList ( const CHostAddress& InetAddr,
const CVector<CServerInfo>& vecServerInfo );
void SetPingTimeAndNumClientsResult ( CHostAddress& InetAddr,
const int iPingTime,
const int iPingTimeLEDColor,
const int iNumClients );
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* );
virtual void hideEvent ( QHideEvent* );
QTimer TimerPing;
QTimer TimerReRequestServList;
QString strCentralServerAddress;
CHostAddress CentralServerAddress;
CVector<QString> vstrIPAddresses;
QString strSelectedAddress;
QString strSelectedServerName;
bool bServerListReceived;
bool bStateOK;
bool bServerListItemWasChosen;
public slots:
void OnServerListItemSelectionChanged();
void OnServerListItemDoubleClicked ( QTreeWidgetItem* Item, int );
void OnLineEditServerAddrEditTextChanged ( const QString& );
void OnConnectButtonClicked();
void OnTimerPing();
void OnTimerReRequestServList();
signals:
void ReqServerListQuery ( CHostAddress InetAddr );
void CreateCLPingMes ( CHostAddress InetAddr );
};

View File

@ -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 );

View File

@ -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>