diff --git a/ChangeLog b/ChangeLog index 2c543c83..203b40e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,10 +9,12 @@ - support sorting faders by channel instrument, coded by Alberstein8 (#356) +- add server recording indicator, coded by pljones (#295) + - support for storing/recovering the server window positions (#357) -TODO Mac audio interface -> crackling -TODO try to reproduce: Quitting client when server window minimized not handled cleanly #355 + + diff --git a/mac/sound.cpp b/mac/sound.cpp index e006d247..2d69b0ae 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -907,7 +907,7 @@ OSStatus CSound::deviceNotification ( AudioDeviceID, pSound->EmitReinitRequestSignal ( RS_RELOAD_RESTART_AND_INIT ); } -/* +/* NOTE that this code does not solve the crackling sound issue if ( inAddresses->mSelector == kAudioDeviceProcessorOverload ) { // xrun handling (it is important to act on xruns under CoreAudio diff --git a/src/audiomixerboard.cpp b/src/audiomixerboard.cpp old mode 100644 new mode 100755 index 021b6e22..23279582 --- a/src/audiomixerboard.cpp +++ b/src/audiomixerboard.cpp @@ -619,7 +619,8 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) : bIsPanSupported ( false ), bNoFaderVisible ( true ), iMyChannelID ( INVALID_INDEX ), - strServerName ( "" ) + strServerName ( "" ), + eRecorderState ( RS_UNDEFINED ) { // add group box and hboxlayout QHBoxLayout* pGroupBoxLayout = new QHBoxLayout ( this ); @@ -627,6 +628,12 @@ CAudioMixerBoard::CAudioMixerBoard ( QWidget* parent, Qt::WindowFlags ) : pScrollArea = new CMixerBoardScrollArea ( this ); pMainLayout = new QHBoxLayout ( pMixerWidget ); + setAccessibleName ( "Personal Mix at the Server groupbox" ); + setWhatsThis ( "" + tr ( "Personal Mix at the Server" ) + ": " + tr ( + "When connected to a server, the controls here allow you to set your " + "local mix without affecting what others hear from you. The title shows " + "the server name and, when known, whether it is actively recording." ) ); + // set title text (default: no server given) SetServerName ( "" ); @@ -709,6 +716,16 @@ void CAudioMixerBoard::SetServerName ( const QString& strNewServerName ) void CAudioMixerBoard::SetGUIDesign ( const EGUIDesign eNewDesign ) { + // move the channels tighter together in slim fader mode + if ( eNewDesign == GD_SLIMFADER ) + { + pMainLayout->setSpacing ( 2 ); + } + else + { + pMainLayout->setSpacing ( 6 ); // Qt default spacing value + } + // apply GUI design to child GUI controls for ( int i = 0; i < MAX_NUM_CHANNELS; i++ ) { @@ -807,13 +824,32 @@ void CAudioMixerBoard::ChangeFaderOrder ( const bool bDoSort, } } +void CAudioMixerBoard::UpdateTitle() +{ + QString strTitlePrefix = ""; + + if ( eRecorderState == RS_RECORDING ) + { + strTitlePrefix = "[" + tr ( "RECORDING ACTIVE" ) + "] "; + } + + setTitle ( strTitlePrefix + tr ( "Personal Mix at: " ) + strServerName ); +} + +void CAudioMixerBoard::SetRecorderState ( const ERecorderState newRecorderState ) +{ + // store the new recorder state and update the title + eRecorderState = newRecorderState; + UpdateTitle(); +} + void CAudioMixerBoard::ApplyNewConClientList ( CVector& vecChanInfo ) { // we want to set the server name only if the very first faders appear // in the audio mixer board to show a "try to connect" before if ( bNoFaderVisible ) { - setTitle ( tr ( "Personal Mix at the Server: " ) + strServerName ); + UpdateTitle(); } // get number of connected clients diff --git a/src/audiomixerboard.h b/src/audiomixerboard.h old mode 100644 new mode 100755 index a3321a34..3d8457be --- a/src/audiomixerboard.h +++ b/src/audiomixerboard.h @@ -164,6 +164,8 @@ public: void SetChannelLevels ( const CVector& vecChannelLevel ); + void SetRecorderState ( const ERecorderState newRecorderState ); + // settings CVector vecStoredFaderTags; CVector vecStoredFaderLevels; @@ -196,6 +198,7 @@ protected: void StoreFaderSettings ( CChannelFader* pChanFader ); void UpdateSoloStates(); + void UpdateTitle(); void OnGainValueChanged ( const int iChannelIdx, const double dValue ); @@ -209,6 +212,7 @@ protected: bool bNoFaderVisible; int iMyChannelID; QString strServerName; + ERecorderState eRecorderState; virtual void UpdateGainValue ( const int iChannelIdx, const double dValue, diff --git a/src/channel.cpp b/src/channel.cpp index f5c7419d..924f74d5 100755 --- a/src/channel.cpp +++ b/src/channel.cpp @@ -108,6 +108,9 @@ qRegisterMetaType ( "CHostAddress" ); QObject::connect ( &Protocol, &CProtocol::VersionAndOSReceived, this, &CChannel::VersionAndOSReceived ); + QObject::connect ( &Protocol, &CProtocol::RecorderStateReceived, + this, &CChannel::RecorderStateReceived ); + QObject::connect ( &Protocol, &CProtocol::ReqChannelLevelList, this, &CChannel::OnReqChannelLevelList ); } diff --git a/src/channel.h b/src/channel.h index b56f93ee..723d9ad4 100755 --- a/src/channel.h +++ b/src/channel.h @@ -168,6 +168,9 @@ public: void CreateConClientListMes ( const CVector& vecChanInfo ) { Protocol.CreateConClientListMes ( vecChanInfo ); } + void CreateRecorderStateMes ( const ERecorderState eRecorderState ) + { Protocol.CreateRecorderStateMes ( eRecorderState ); } + CNetworkTransportProps GetNetworkTransportPropsFromCurrentSettings(); bool ChannelLevelsRequired() const { return bChannelLevelsRequired; } @@ -287,6 +290,7 @@ signals: void ReqNetTranspProps(); void LicenceRequired ( ELicenceType eLicenceType ); void VersionAndOSReceived ( COSUtil::EOpSystemType eOSType, QString strVersion ); + void RecorderStateReceived ( ERecorderState eRecorderState ); void Disconnected(); void DetectedCLMessage ( CVector vecbyMesBodyData, diff --git a/src/client.cpp b/src/client.cpp index 13b42cf2..35b8fea5 100755 --- a/src/client.cpp +++ b/src/client.cpp @@ -165,6 +165,9 @@ CClient::CClient ( const quint16 iPortNumber, QObject::connect ( &Channel, &CChannel::VersionAndOSReceived, this, &CClient::VersionAndOSReceived ); + QObject::connect ( &Channel, &CChannel::RecorderStateReceived, + this, &CClient::RecorderStateReceived ); + QObject::connect ( &ConnLessProtocol, &CProtocol::CLMessReadyForSending, this, &CClient::OnSendCLProtMessage ); diff --git a/src/client.h b/src/client.h index b8497bbf..0a576068 100755 --- a/src/client.h +++ b/src/client.h @@ -424,6 +424,7 @@ signals: void LicenceRequired ( ELicenceType eLicenceType ); void VersionAndOSReceived ( COSUtil::EOpSystemType eOSType, QString strVersion ); void PingTimeReceived ( int iPingTime ); + void RecorderStateReceived ( ERecorderState eRecorderState ); void CLServerListReceived ( CHostAddress InetAddr, CVector vecServerInfo ); diff --git a/src/clientdlg.cpp b/src/clientdlg.cpp index 89c3d59a..9c73e8e5 100755 --- a/src/clientdlg.cpp +++ b/src/clientdlg.cpp @@ -472,6 +472,9 @@ CClientDlg::CClientDlg ( CClient* pNCliP, QObject::connect ( pClient, &CClient::MuteStateHasChangedReceived, this, &CClientDlg::OnMuteStateHasChangedReceived ); + QObject::connect ( pClient, &CClient::RecorderStateReceived, + this, &CClientDlg::OnRecorderStateReceived ); + // This connection is a special case. On receiving a licence required message via the // protocol, a modal licence dialog is opened. Since this blocks the thread, we need // a queued connection to make sure the core protocol mechanism is not blocked, too. diff --git a/src/clientdlg.h b/src/clientdlg.h index 7b2e9dfa..4058b6de 100755 --- a/src/clientdlg.h +++ b/src/clientdlg.h @@ -221,6 +221,9 @@ public slots: void OnDisplayChannelLevelsChanged() { MainMixerBoard->SetDisplayChannelLevels ( pClient->GetDisplayChannelLevels() ); } + void OnRecorderStateReceived ( ERecorderState eRecorderState ) + { MainMixerBoard->SetRecorderState ( eRecorderState ); } + void OnAudioChannelsChanged() { UpdateRevSelection(); } void OnNumClientsChanged ( int iNewNumClients ); void OnNewClientLevelChanged() { MainMixerBoard->iNewClientFaderLevel = pClient->iNewClientFaderLevel; } diff --git a/src/protocol.cpp b/src/protocol.cpp index 3cc6dab6..61be0026 100755 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -1585,7 +1585,10 @@ bool CProtocol::EvaluateRecorderStateMes(const CVector& vecData) const int iRecorderState = static_cast ( GetValFromStream ( vecData, iPos, 1 ) ); - if ( iRecorderState != RS_UNDEFINED ) // ... to be defined ... + // note that RS_UNDEFINED is only internally used + if ( ( iRecorderState != RS_NOT_INITIALISED ) && + ( iRecorderState != RS_NOT_ENABLED ) && + ( iRecorderState != RS_RECORDING ) ) { return true; } diff --git a/src/res/translation/translation_de_DE.qm b/src/res/translation/translation_de_DE.qm index 56d35893..e697891c 100644 Binary files a/src/res/translation/translation_de_DE.qm and b/src/res/translation/translation_de_DE.qm differ diff --git a/src/res/translation/translation_de_DE.ts b/src/res/translation/translation_de_DE.ts index 6dfdae60..e277548b 100644 --- a/src/res/translation/translation_de_DE.ts +++ b/src/res/translation/translation_de_DE.ts @@ -190,18 +190,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server - + T R Y I N G T O C O N N E C T V E R B I N D U N G S A U F B A U - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: Eigener Mix am Server: @@ -715,7 +730,7 @@ - + C&onnect &Verbinden @@ -769,18 +784,18 @@ Keine - + Center Mitte - + R - + L @@ -865,22 +880,22 @@ Sortiere Kanäle nach &Instrument - + Central Server Zentralserver - + user Musiker - + users Musiker - + D&isconnect &Trennen @@ -1513,22 +1528,22 @@ Manuell - + Custom Benutzerdefiniert - + All Genres Alle Genres - + Genre Rock Genre Rock - + Genre Jazz Genre Jazz @@ -1537,12 +1552,12 @@ Genre Rock/Jazz - + Genre Classical/Folk/Choir Genre Klassik/Volksmusik/Chor - + Default Standard @@ -2643,22 +2658,22 @@ Server - + Predefined Address Vordefinierte Adresse - + Recording Aufnahme - + Not recording Keine Aufnahme - + Not enabled Nicht aktiviert @@ -2685,42 +2700,42 @@ &Fenster - + Unregistered Nicht registriert - + Bad address Ungültige Adresse - + Registration requested Registrierung angefordert - + Registration failed Registrierung fehlgeschlagen - + Check server version Überprüfe Version des Servers - + Registered Registriert - + Central Server full Zentralserver voll - + Unknown value Unbekannter Wert diff --git a/src/res/translation/translation_es_ES.qm b/src/res/translation/translation_es_ES.qm index 0d5c7ce9..cbaba548 100644 Binary files a/src/res/translation/translation_es_ES.qm and b/src/res/translation/translation_es_ES.qm differ diff --git a/src/res/translation/translation_es_ES.ts b/src/res/translation/translation_es_ES.ts index e8e494ad..46f1aa36 100644 --- a/src/res/translation/translation_es_ES.ts +++ b/src/res/translation/translation_es_ES.ts @@ -194,18 +194,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server Servidor - + T R Y I N G T O C O N N E C T I N T E N T A N D O C O N E C T A R - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: Mezcla Personal en el Servidor: @@ -727,7 +742,7 @@ - + C&onnect C&onectar @@ -777,18 +792,18 @@ Ninguno - + Center Centro - + R R - + L L @@ -873,22 +888,22 @@ Ordenar Canales por &Instrumento - + Central Server Servidor Central - + user usuario - + users usuarios - + D&isconnect D&esconectar @@ -1521,12 +1536,12 @@ Manual - + Custom Personalizado - + All Genres Todos los Géneros @@ -1535,22 +1550,22 @@ Género Rock/Jazz - + Genre Classical/Folk/Choir Género Clásica/Folk/Coro - + Genre Rock Género Rock - + Genre Jazz Género Jazz - + Default Por defecto @@ -2655,22 +2670,22 @@ - + Predefined Address Dirección Preestablecida - + Recording Grabando - + Not recording No grabando - + Not enabled No habilitado @@ -2697,42 +2712,42 @@ &Ventana - + Unregistered Sin registrar - + Bad address Dirección no válida - + Registration requested Registro solicitado - + Registration failed Error de registro - + Check server version Comprueba la versión del servidor - + Registered Registrado - + Central Server full Servidor Central lleno - + Unknown value Valor desconocido diff --git a/src/res/translation/translation_fr_FR.qm b/src/res/translation/translation_fr_FR.qm index 922678b1..7cd60017 100644 Binary files a/src/res/translation/translation_fr_FR.qm and b/src/res/translation/translation_fr_FR.qm differ diff --git a/src/res/translation/translation_fr_FR.ts b/src/res/translation/translation_fr_FR.ts index 916a7929..a6856791 100644 --- a/src/res/translation/translation_fr_FR.ts +++ b/src/res/translation/translation_fr_FR.ts @@ -202,18 +202,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server Serveur - + T R Y I N G T O C O N N E C T T E N T A T I V E D E C O N N E X I O N - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: Mixage personnel du serveur : @@ -723,7 +738,7 @@ - + C&onnect Se c&onnecter @@ -777,18 +792,18 @@ Aucun - + Center Centre - + R D - + L G @@ -873,22 +888,22 @@ - + Central Server Serveur central - + user utilisateur - + users utilisateurs - + D&isconnect Dé&connecter @@ -1525,12 +1540,12 @@ Manuel - + Custom Personnalisé - + All Genres Tous les genres @@ -1539,22 +1554,22 @@ Genre rock/jazz - + Genre Classical/Folk/Choir Genre classique/folk/choeur - + Genre Rock Genre Rock - + Genre Jazz Genre Jazz - + Default Défaut @@ -2647,22 +2662,22 @@ serveur - + Predefined Address Adresse prédéfinie - + Recording Enregistrement - + Not recording Ne pas enregistrer - + Not enabled Non activé @@ -2689,42 +2704,42 @@ &Fenêtre - + Unregistered Non inscrit - + Bad address Mauvaise adresse - + Registration requested Inscription demandée - + Registration failed Échec de l'inscription - + Check server version Vérifier la version du serveur - + Registered Inscrit - + Central Server full Serveur central rempli - + Unknown value Valeur inconnue diff --git a/src/res/translation/translation_it_IT.qm b/src/res/translation/translation_it_IT.qm index fad3e633..11929a8d 100644 Binary files a/src/res/translation/translation_it_IT.qm and b/src/res/translation/translation_it_IT.qm differ diff --git a/src/res/translation/translation_it_IT.ts b/src/res/translation/translation_it_IT.ts index 1fcc8ed6..ab4e9633 100644 --- a/src/res/translation/translation_it_IT.ts +++ b/src/res/translation/translation_it_IT.ts @@ -190,18 +190,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server Server - + T R Y I N G T O C O N N E C T I N A T T E S A D I C O N N E S S I O N E - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: Mixer personale sul Server: @@ -560,7 +575,7 @@ - + L L @@ -783,7 +798,7 @@ - + C&onnect C&onnetti @@ -847,32 +862,32 @@ Nullo - + Center Centro - + R R - + Central Server Server Centrale - + user utente - + users utenti - + D&isconnect D&isconnetti @@ -1537,32 +1552,32 @@ Ok - + Custom Personalizzato - + All Genres Tutti i Generi - + Genre Rock Genere Rock - + Genre Jazz Genere Jazz - + Genre Classical/Folk/Choir Genere Classica/Folk/Corale - + Default Default @@ -2621,62 +2636,62 @@ &Finestra - + Predefined Address Indirizzo Predefinito - + Recording Registrazione - + Not recording Registrazione Ferma - + Not enabled Non Abilitata - + Unregistered Non registrato - + Bad address Indirizzo Errato - + Registration requested Registrazione richiesta - + Registration failed Registrazione fallita - + Check server version Controlla Versione server - + Registered Registrato - + Central Server full Server Centrale Pieno - + Unknown value Valore sconosciuto diff --git a/src/res/translation/translation_nl_NL.ts b/src/res/translation/translation_nl_NL.ts index 7b289a7f..e5536f94 100644 --- a/src/res/translation/translation_nl_NL.ts +++ b/src/res/translation/translation_nl_NL.ts @@ -190,18 +190,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server Server - + T R Y I N G T O C O N N E C T A A N H E T V E R B I N D E N - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: @@ -552,7 +567,7 @@ - + L L @@ -775,7 +790,7 @@ - + C&onnect C&onnect @@ -835,32 +850,32 @@ Geen - + Center Centrum - + R R - + Central Server - + user gebruiker - + users gebruikers - + D&isconnect &Afmelden @@ -1485,32 +1500,32 @@ Handmatig - + Custom - + All Genres - + Genre Rock - + Genre Jazz - + Genre Classical/Folk/Choir - + Default Standaard @@ -2599,22 +2614,22 @@ server - + Predefined Address - + Recording - + Not recording - + Not enabled @@ -2641,42 +2656,42 @@ &Window - + Unregistered Niet geregistreerd - + Bad address Slecht adres - + Registration requested Aanmelding gevraagd - + Registration failed Registratie is mislukt - + Check server version Controleer de versie van de server - + Registered Geregistreerd - + Central Server full Centrale server vol - + Unknown value Onbekende waarde diff --git a/src/res/translation/translation_pl_PL.ts b/src/res/translation/translation_pl_PL.ts index d408dab7..8c0cb2bb 100644 --- a/src/res/translation/translation_pl_PL.ts +++ b/src/res/translation/translation_pl_PL.ts @@ -158,18 +158,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server - + T R Y I N G T O C O N N E C T - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: @@ -464,7 +479,7 @@ - + L @@ -635,7 +650,7 @@ - + C&onnect @@ -695,32 +710,32 @@ - + Center - + R - + Central Server - + user - + users - + D&isconnect @@ -1225,32 +1240,32 @@ - + Custom - + All Genres - + Genre Rock - + Genre Jazz - + Genre Classical/Folk/Choir - + Default @@ -2244,22 +2259,22 @@ - + Predefined Address - + Recording - + Not recording - + Not enabled @@ -2289,42 +2304,42 @@ - + Unregistered - + Bad address - + Registration requested - + Registration failed - + Check server version - + Registered - + Central Server full - + Unknown value diff --git a/src/res/translation/translation_pt_PT.qm b/src/res/translation/translation_pt_PT.qm index da5729ef..1fca6c2d 100644 Binary files a/src/res/translation/translation_pt_PT.qm and b/src/res/translation/translation_pt_PT.qm differ diff --git a/src/res/translation/translation_pt_PT.ts b/src/res/translation/translation_pt_PT.ts index fda43a8f..7eb3a462 100644 --- a/src/res/translation/translation_pt_PT.ts +++ b/src/res/translation/translation_pt_PT.ts @@ -202,18 +202,33 @@ CAudioMixerBoard - + + Personal Mix at the Server + + + + + When connected to a server, the controls here allow you to set your local mix without affecting what others hear from you. The title shows the server name and, when known, whether it is actively recording. + + + + Server Servidor - + T R Y I N G T O C O N N E C T T E N T A N D O L I G A R - - Personal Mix at the Server: + + RECORDING ACTIVE + + + + + Personal Mix at: Mistura Pessoal no Servidor: @@ -719,7 +734,7 @@ - + C&onnect &Ligar @@ -773,18 +788,18 @@ Nenhum - + Center Centro - + R R - + L L @@ -869,22 +884,22 @@ - + Central Server Servidor Central - + user utilizador - + users utilizadores - + D&isconnect Desl&igar @@ -1513,22 +1528,22 @@ Manual - + Custom Personalizado - + All Genres Servidor Geral - + Genre Rock Servidor Rock - + Genre Jazz Servidor Jazz @@ -1537,12 +1552,12 @@ Servidor Rock/Jazz - + Genre Classical/Folk/Choir Serv. Clássica/Folclore/Coro - + Default Servidor Padrão @@ -2631,22 +2646,22 @@ - + Predefined Address Endereço Predefinido - + Recording A gravar - + Not recording Não está a gravar - + Not enabled Desactivado @@ -2673,42 +2688,42 @@ &Janela - + Unregistered Não Registado - + Bad address Endereço incorrecto - + Registration requested Registo solicitado - + Registration failed Falha no registo - + Check server version Verifique versão do servidor - + Registered Registado - + Central Server full Servidor Central Cheio - + Unknown value Valor desconhecido diff --git a/src/server.cpp b/src/server.cpp index f9266e0b..8c449e8b 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -610,6 +610,9 @@ void CServer::OnNewConnection ( int iChID, // send version info (for, e.g., feature activation in the client) vecChannels[iChID].CreateVersionAndOSMes(); + // send recording state message on connection + vecChannels[iChID].CreateRecorderStateMes ( GetRecorderState() ); + // reset the conversion buffers DoubleFrameSizeConvBufIn[iChID].Reset(); DoubleFrameSizeConvBufOut[iChID].Reset(); @@ -721,6 +724,9 @@ void CServer::RequestNewRecording() { emit RestartRecorder(); } + + // send recording state message - doesn't hurt + CreateAndSendRecorderStateForAllConChannels(); } void CServer::SetEnableRecording ( bool bNewEnableRecording ) @@ -734,7 +740,7 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording ) #if QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) // TODO we should use the ConsoleWriterFactory() instead of qInfo() - qInfo() << "Recording state " << ( bEnableRecording ? "enabled" : "disabled" ); + qInfo() << "Recording state" << ( bEnableRecording ? "enabled" : "disabled" ); #endif if ( !bEnableRecording ) @@ -747,6 +753,9 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording ) emit StopRecorder(); } } + + // send recording state message + CreateAndSendRecorderStateForAllConChannels(); } void CServer::Start() @@ -1330,6 +1339,42 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID } } +void CServer::CreateAndSendRecorderStateForAllConChannels() +{ + // get recorder state + ERecorderState eRecorderState = GetRecorderState(); + + // now send recorder state to all connected clients + for ( int i = 0; i < iMaxNumChannels; i++ ) + { + if ( vecChannels[i].IsConnected() ) + { + // send message + vecChannels[i].CreateRecorderStateMes ( eRecorderState ); + } + } +} + +ERecorderState CServer::GetRecorderState() +{ + // return recorder state + if ( bRecorderInitialised ) + { + if ( bEnableRecording ) + { + return RS_RECORDING; + } + else + { + return RS_NOT_ENABLED; + } + } + else + { + return RS_NOT_INITIALISED; + } +} + void CServer::CreateOtherMuteStateChanged ( const int iCurChanID, const int iOtherChanID, const bool bIsMuted ) diff --git a/src/server.h b/src/server.h index 113c4e69..5add392a 100755 --- a/src/server.h +++ b/src/server.h @@ -273,6 +273,10 @@ protected: virtual void CreateAndSendChatTextForAllConChannels ( const int iCurChanID, const QString& strChatText ); + virtual void CreateAndSendRecorderStateForAllConChannels(); + + ERecorderState GetRecorderState(); + virtual void CreateOtherMuteStateChanged ( const int iCurChanID, const int iOtherChanID, const bool bIsMuted ); diff --git a/src/util.h b/src/util.h index f317aa8e..56c3aa49 100755 --- a/src/util.h +++ b/src/util.h @@ -566,8 +566,10 @@ enum ELicenceType // Server jam recorder state enum ---------------------------------------------- enum ERecorderState { - RS_UNDEFINED = 0 - // ... to be defined ... + RS_UNDEFINED = 0, + RS_NOT_INITIALISED = 1, + RS_NOT_ENABLED = 2, + RS_RECORDING = 3 };