show number of connected clients in window title bar
This commit is contained in:
parent
6287a70e3d
commit
ecc270036d
4 changed files with 56 additions and 4 deletions
|
@ -346,22 +346,28 @@ void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign )
|
||||||
|
|
||||||
void CAudioMixerBoard::HideAll()
|
void CAudioMixerBoard::HideAll()
|
||||||
{
|
{
|
||||||
// make old controls invisible
|
// make all controls invisible
|
||||||
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
||||||
{
|
{
|
||||||
vecpChanFader[i]->Hide();
|
vecpChanFader[i]->Hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// emit status of connected clients
|
||||||
|
emit NumClientsChanged ( 0 ); // -> no clients connected
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo )
|
void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelShortInfo>& vecChanInfo )
|
||||||
{
|
{
|
||||||
|
// get number of connected clients
|
||||||
|
const int iNumConnectedClients = vecChanInfo.Size();
|
||||||
|
|
||||||
// search for channels with are already present and preserver their gain
|
// search for channels with are already present and preserver their gain
|
||||||
// setting, for all other channels, reset gain
|
// setting, for all other channels, reset gain
|
||||||
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
for ( int i = 0; i < USED_NUM_CHANNELS; i++ )
|
||||||
{
|
{
|
||||||
bool bFaderIsUsed = false;
|
bool bFaderIsUsed = false;
|
||||||
|
|
||||||
for ( int j = 0; j < vecChanInfo.Size(); j++ )
|
for ( int j = 0; j < iNumConnectedClients; j++ )
|
||||||
{
|
{
|
||||||
// check if current fader is used
|
// check if current fader is used
|
||||||
if ( vecChanInfo[j].iChanID == i )
|
if ( vecChanInfo[j].iChanID == i )
|
||||||
|
@ -395,6 +401,9 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelShortInfo>& vecCh
|
||||||
vecpChanFader[i]->Hide();
|
vecpChanFader[i]->Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// emit status of connected clients
|
||||||
|
emit NumClientsChanged ( iNumConnectedClients );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CAudioMixerBoard::OnChSoloStateChanged ( const int iChannelIdx, const int iValue )
|
void CAudioMixerBoard::OnChSoloStateChanged ( const int iChannelIdx, const int iValue )
|
||||||
|
|
|
@ -137,6 +137,7 @@ public slots:
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void ChangeChanGain ( int iId, double dGain );
|
void ChangeChanGain ( int iId, double dGain );
|
||||||
|
void NumClientsChanged ( int iNewNumClients );
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_
|
#endif // MIXERBOARD_H__FD6B49E1606C2AC__INCLUDED_
|
||||||
|
|
|
@ -138,6 +138,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
|
||||||
// init GUI design
|
// init GUI design
|
||||||
SetGUIDesign ( pClient->GetGUIDesign() );
|
SetGUIDesign ( pClient->GetGUIDesign() );
|
||||||
|
|
||||||
|
// reset mixer board
|
||||||
|
MainMixerBoard->HideAll();
|
||||||
|
|
||||||
// init fader tag line edit
|
// init fader tag line edit
|
||||||
LineEditFaderTag->setText ( pClient->strName );
|
LineEditFaderTag->setText ( pClient->strName );
|
||||||
|
|
||||||
|
@ -294,6 +297,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP,
|
||||||
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
|
QObject::connect ( MainMixerBoard, SIGNAL ( ChangeChanGain ( int, double ) ),
|
||||||
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
this, SLOT ( OnChangeChanGain ( int, double ) ) );
|
||||||
|
|
||||||
|
QObject::connect ( MainMixerBoard, SIGNAL ( NumClientsChanged ( int ) ),
|
||||||
|
this, SLOT ( OnNumClientsChanged ( int ) ) );
|
||||||
|
|
||||||
QObject::connect ( &ChatDlg, SIGNAL ( NewLocalInputText ( QString ) ),
|
QObject::connect ( &ChatDlg, SIGNAL ( NewLocalInputText ( QString ) ),
|
||||||
this, SLOT ( OnNewLocalInputText ( QString ) ) );
|
this, SLOT ( OnNewLocalInputText ( QString ) ) );
|
||||||
|
|
||||||
|
@ -435,6 +441,41 @@ void CLlconClientDlg::OnDisconnected()
|
||||||
MainMixerBoard->HideAll();
|
MainMixerBoard->HideAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo )
|
||||||
|
{
|
||||||
|
// update mixer board
|
||||||
|
MainMixerBoard->ApplyNewConClientList ( vecChanInfo );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::OnNumClientsChanged ( int iNewNumClients )
|
||||||
|
{
|
||||||
|
// update window title
|
||||||
|
SetMyWindowTitle ( iNewNumClients );
|
||||||
|
}
|
||||||
|
|
||||||
|
void CLlconClientDlg::SetMyWindowTitle ( const int iNumClients )
|
||||||
|
{
|
||||||
|
// show number of connected clients in window title (and therefore also in
|
||||||
|
// the task bar of the OS)
|
||||||
|
if ( iNumClients == 0 )
|
||||||
|
{
|
||||||
|
// only application name
|
||||||
|
setWindowTitle ( APP_NAME );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( iNumClients == 1 )
|
||||||
|
{
|
||||||
|
setWindowTitle ( QString ( APP_NAME ) + " (1 client)" );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setWindowTitle ( QString ( APP_NAME ) +
|
||||||
|
QString ( " (%1 clients)" ).arg ( iNumClients ) );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CLlconClientDlg::ShowChatWindow()
|
void CLlconClientDlg::ShowChatWindow()
|
||||||
{
|
{
|
||||||
// open chat dialog
|
// open chat dialog
|
||||||
|
|
|
@ -72,6 +72,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
void SetGUIDesign ( const EGUIDesign eNewDesign );
|
||||||
|
void SetMyWindowTitle ( const int iNumClients );
|
||||||
void ShowChatWindow();
|
void ShowChatWindow();
|
||||||
void UpdateAudioFaderSlider();
|
void UpdateAudioFaderSlider();
|
||||||
void ConnectDisconnect ( const bool bDoStart );
|
void ConnectDisconnect ( const bool bDoStart );
|
||||||
|
@ -102,8 +103,7 @@ public slots:
|
||||||
void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
|
void OnSliderAudReverb ( int value ) { pClient->SetReverbLevel ( value ); }
|
||||||
void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
|
void OnRevSelL() { pClient->SetReverbOnLeftChan ( true ); }
|
||||||
void OnRevSelR() { pClient->SetReverbOnLeftChan ( false ); }
|
void OnRevSelR() { pClient->SetReverbOnLeftChan ( false ); }
|
||||||
void OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo )
|
void OnConClientListMesReceived ( CVector<CChannelShortInfo> vecChanInfo );
|
||||||
{ MainMixerBoard->ApplyNewConClientList ( vecChanInfo ); }
|
|
||||||
void OnChangeChanGain ( int iId, double dGain )
|
void OnChangeChanGain ( int iId, double dGain )
|
||||||
{ pClient->SetRemoteChanGain ( iId, dGain ); }
|
{ pClient->SetRemoteChanGain ( iId, dGain ); }
|
||||||
void OnFaderTagTextChanged ( const QString& strNewName );
|
void OnFaderTagTextChanged ( const QString& strNewName );
|
||||||
|
@ -115,4 +115,5 @@ public slots:
|
||||||
void OnDisconnected();
|
void OnDisconnected();
|
||||||
void OnStopped();
|
void OnStopped();
|
||||||
void OnGUIDesignChanged() { SetGUIDesign ( pClient->GetGUIDesign() ); }
|
void OnGUIDesignChanged() { SetGUIDesign ( pClient->GetGUIDesign() ); }
|
||||||
|
void OnNumClientsChanged ( int iNewNumClients );
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue