From 61b086d89856072ae91060a52cedbe4a976d3156 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Mon, 17 Aug 2009 16:20:15 +0000 Subject: [PATCH] clear mixer board on disconnect --- src/channel.cpp | 3 +++ src/channel.h | 1 + src/client.cpp | 4 ++++ src/client.h | 1 + src/llconclientdlg.cpp | 9 +++++++++ src/llconclientdlg.h | 1 + 6 files changed, 19 insertions(+) diff --git a/src/channel.cpp b/src/channel.cpp index 192910fd..f8f17ee0 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -457,6 +457,9 @@ EGetDataStat CChannel::GetData ( CVector& vecbyData ) // channel is just disconnected eGetStatus = GS_CHAN_NOW_DISCONNECTED; iConTimeOut = 0; // make sure we do not have negative values + + // emit message + emit Disconnected(); } else { diff --git a/src/channel.h b/src/channel.h index 7ce4ef3e..174f0f34 100755 --- a/src/channel.h +++ b/src/channel.h @@ -185,6 +185,7 @@ signals: void ChatTextReceived ( QString strChatText ); void PingReceived ( int iMs ); void ReqNetTranspProps(); + void Disconnected(); }; #endif /* !defined ( CHANNEL_HOIH9345KJH98_3_4344_BB23945IUHF1912__INCLUDED_ ) */ diff --git a/src/client.cpp b/src/client.cpp index ca2a0e71..ea9a6882 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -62,6 +62,10 @@ CClient::CClient ( const quint16 iPortNumber ) : SIGNAL ( ConClientListMesReceived ( CVector ) ), SIGNAL ( ConClientListMesReceived ( CVector ) ) ); + QObject::connect ( &Channel, + SIGNAL ( Disconnected() ), + SIGNAL ( Disconnected() ) ); + QObject::connect ( &Channel, SIGNAL ( NewConnection() ), this, SLOT ( OnNewConnection() ) ); diff --git a/src/client.h b/src/client.h index 185a72b0..749d27f6 100755 --- a/src/client.h +++ b/src/client.h @@ -211,6 +211,7 @@ signals: void ConClientListMesReceived ( CVector vecChanInfo ); void ChatTextReceived ( QString strChatText ); void PingTimeReceived ( int iPingTime ); + void Disconnected(); }; #endif /* !defined ( CLIENT_HOIHGE76GEKJH98_3_43445KJIUHF1912__INCLUDED_ ) */ diff --git a/src/llconclientdlg.cpp b/src/llconclientdlg.cpp index d4129129..f6ba0b3f 100755 --- a/src/llconclientdlg.cpp +++ b/src/llconclientdlg.cpp @@ -232,6 +232,9 @@ CLlconClientDlg::CLlconClientDlg ( CClient* pNCliP, QObject::connect ( pClient, SIGNAL ( ConClientListMesReceived ( CVector ) ), this, SLOT ( OnConClientListMesReceived ( CVector ) ) ); + QObject::connect ( pClient, + SIGNAL ( Disconnected() ), + this, SLOT ( OnDisconnected() ) ); QObject::connect ( pClient, SIGNAL ( ChatTextReceived ( QString ) ), this, SLOT ( OnChatTextReceived ( QString ) ) ); @@ -410,6 +413,12 @@ void CLlconClientDlg::OnChatTextReceived ( QString strChatText ) } } +void CLlconClientDlg::OnDisconnected() +{ + // channel is now disconnected, clear mixer board (remove all faders) + MainMixerBoard->HideAll(); +} + void CLlconClientDlg::ShowChatWindow() { // open chat dialog diff --git a/src/llconclientdlg.h b/src/llconclientdlg.h index 62e04ecb..b50684ef 100755 --- a/src/llconclientdlg.h +++ b/src/llconclientdlg.h @@ -110,4 +110,5 @@ public slots: { pClient->SendTextMess ( strChatText ); } void OnLineEditServerAddrTextChanged ( const QString sNewText ); void OnLineEditServerAddrActivated ( int index ); + void OnDisconnected(); };