diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp index 80e2c3c8..a4314410 100755 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -62,8 +62,8 @@ CChannelFader::CChannelFader ( QWidget* pNW, // add user controls to grid pMainGrid->addWidget( pFader, 0, Qt::AlignHCenter ); - pMainGrid->addWidget( pcbMute, 0, Qt::AlignHCenter ); - pMainGrid->addWidget( pcbSolo, 0, Qt::AlignHCenter ); + pMainGrid->addWidget( pcbMute, 0, Qt::AlignLeft ); + pMainGrid->addWidget( pcbSolo, 0, Qt::AlignLeft ); pMainGrid->addWidget( pLabel, 0, Qt::AlignHCenter ); // add fader layout to audio mixer board layout diff --git a/src/channel.cpp b/src/channel.cpp index ce030281..0e69e707 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -32,7 +32,8 @@ CChannelSet::CChannelSet ( const int iNewUploadRateLimitKbps ) : bWriteStatusHTMLFile ( false ), iUploadRateLimitKbps ( iNewUploadRateLimitKbps ) { - // enable all channels + // enable all channels (for the server all channel must be enabled the + // entire life time of the software for ( int i = 0; i < USED_NUM_CHANNELS; i++ ) { vecChannels[i].SetEnable ( true ); @@ -782,6 +783,9 @@ CChannel::CChannel ( const bool bNIsServer ) : QObject::connect ( &Protocol, SIGNAL ( ReqNetTranspProps() ), this, SLOT ( OnReqNetTranspProps() ) ); + + QObject::connect ( &Protocol, SIGNAL ( Disconnection() ), + this, SLOT ( OnDisconnection() ) ); } bool CChannel::ProtocolIsEnabled() @@ -1029,6 +1033,14 @@ void CChannel::CreateNetTranspPropsMessFromCurrentSettings() Protocol.CreateNetwTranspPropsMes ( NetworkTransportProps ); } +void CChannel::OnDisconnection() +{ + // set time out counter to a small value > 0 so that the next time a + // received audio block is queried, the disconnection is performed + // (assuming that no audio packet is received in the meantime) + iConTimeOut = 1; // a small number > 0 +} + EPutDataStat CChannel::PutData ( const CVector& vecbyData, int iNumBytes ) { diff --git a/src/channel.h b/src/channel.h index 46e37dc6..7613e21e 100755 --- a/src/channel.h +++ b/src/channel.h @@ -150,6 +150,7 @@ public: } void CreateNetTranspPropsMessFromCurrentSettings(); + void CreateDisconnectionMes() { Protocol.CreateDisconnectionMes(); } protected: void SetAudioBlockSizeAndComprIn ( const int iNewBlockSize, @@ -212,6 +213,7 @@ public slots: void OnChangeChanName ( QString strName ); void OnNetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps ); void OnReqNetTranspProps(); + void OnDisconnection(); signals: void MessReadyForSending ( CVector vecMessage ); diff --git a/src/client.cpp b/src/client.cpp index 33092b23..52190c0c 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -238,6 +238,9 @@ void CClient::Stop() // stop audio interface Sound.Stop(); + // send disconnect message to server + Channel.CreateDisconnectionMes(); + // disable channel Channel.SetEnable ( false ); diff --git a/src/llconclientdlgbase.ui b/src/llconclientdlgbase.ui index d4adaf2d..977820ab 100755 --- a/src/llconclientdlgbase.ui +++ b/src/llconclientdlgbase.ui @@ -350,21 +350,34 @@ Reverb - - 6 - - - 9 - - - 9 - - - 9 - - - 9 - + + + + Channel +Selection + + + Qt::AlignCenter + + + false + + + + + + + Left + + + + + + + Right + + + @@ -461,33 +474,6 @@ - - - - Channel - - - Qt::AlignCenter - - - false - - - - - - - Left - - - - - - - Right - - - @@ -499,6 +485,21 @@ + + + + Local +Audio +Fader + + + Qt::AlignCenter + + + false + + + @@ -582,20 +583,6 @@ - - - - Audio -Fader - - - Qt::AlignCenter - - - false - - - diff --git a/src/protocol.cpp b/src/protocol.cpp index 583a5ca3..0dd30304 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -46,10 +46,12 @@ MESSAGES | 2 bytes number of blocks | +--------------------------+ + - Request jitter buffer size: PROTMESSID_REQ_JITT_BUF_SIZE note: does not have any data -> n = 0 + - Server full message: PROTMESSID_SERVER_FULL note: does not have any data -> n = 0 @@ -63,6 +65,7 @@ MESSAGES | 2 bytes factor | +----------------+ + - Gain of channel: PROTMESSID_CHANNEL_GAIN +-------------------+--------------+ @@ -78,6 +81,7 @@ MESSAGES | 1 byte channel ID | 4 bytes IP address | 2 bytes number n | n bytes UTF-8 string | +-------------------+--------------------+------------------+----------------------+ + - Request connected clients list: PROTMESSID_REQ_CONN_CLIENTS_LIST note: does not have any data -> n = 0 @@ -98,12 +102,14 @@ MESSAGES | 2 bytes number n | n bytes UTF-8 string | +------------------+----------------------+ + - Ping message (for measuring the ping time): PROTMESSID_PING_MS +-----------------------------+ | 4 bytes transmit time in ms | +-----------------------------+ + - Properties for network transport: PROTMESSID_NETW_TRANSPORT_PROPS +-------------------+------------------+-----------------+------------------+-----------------------+----------------------+ @@ -120,11 +126,17 @@ MESSAGES - 2: MS-ADPCM - "audiocod arg": argument for the audio coder, if not used this value shall be set to 0 + - Request properties for network transport: PROTMESSID_REQ_NETW_TRANSPORT_PROPS note: does not have any data -> n = 0 +- Disconnect message: PROTMESSID_DISCONNECTION + + note: does not have any data -> n = 0 + + ****************************************************************************** * * This program is free software; you can redistribute it and/or modify it under @@ -383,6 +395,10 @@ bool CProtocol::ParseMessage ( const CVector& vecbyData, case PROTMESSID_REQ_NETW_TRANSPORT_PROPS: bRet = EvaluateReqNetwTranspPropsMes ( vecData ); break; + + case PROTMESSID_DISCONNECTION: + bRet = EvaluateDisconnectionMes ( vecData ); + break; } // send acknowledge message @@ -899,6 +915,18 @@ bool CProtocol::EvaluateReqNetwTranspPropsMes ( const CVector& vecData return false; // no error } +void CProtocol::CreateDisconnectionMes() +{ + CreateAndSendMessage ( PROTMESSID_DISCONNECTION, CVector ( 0 ) ); +} + +bool CProtocol::EvaluateDisconnectionMes ( const CVector& vecData ) +{ + // invoke message action + emit Disconnection(); + + return false; // no error +} /******************************************************************************\ diff --git a/src/protocol.h b/src/protocol.h index 6b5292dc..0ec164bf 100755 --- a/src/protocol.h +++ b/src/protocol.h @@ -51,6 +51,7 @@ #define PROTMESSID_PING_MS 20 // for measuring ping time #define PROTMESSID_NETW_TRANSPORT_PROPS 21 // properties for network transport #define PROTMESSID_REQ_NETW_TRANSPORT_PROPS 22 // request properties for network transport +#define PROTMESSID_DISCONNECTION 23 // disconnection // lengths of message as defined in protocol.cpp file #define MESS_HEADER_LENGTH_BYTE 7 // TAG (2), ID (2), cnt (1), length (2) @@ -82,6 +83,7 @@ public: void CreatePingMes ( const int iMs ); void CreateNetwTranspPropsMes ( const CNetworkTransportProps& NetTrProps ); void CreateReqNetwTranspPropsMes(); + void CreateDisconnectionMes(); void CreateAndSendAcknMess ( const int& iID, const int& iCnt ); @@ -152,6 +154,7 @@ protected: bool EvaluatePingMes ( const CVector& vecData ); bool EvaluateNetwTranspPropsMes ( const CVector& vecData ); bool EvaluateReqNetwTranspPropsMes ( const CVector& vecData ); + bool EvaluateDisconnectionMes ( const CVector& vecData ); int iOldRecID, iOldRecCnt; @@ -182,6 +185,7 @@ signals: void PingReceived ( int iMs ); void NetTranspPropsReceived ( CNetworkTransportProps NetworkTransportProps ); void ReqNetTranspProps(); + void Disconnection(); }; #endif /* !defined ( PROTOCOL_H__3B123453_4344_BB2392354455IUHF1912__INCLUDED_ ) */