From b5230c3420638d913576f1706ae2a777c9c47d13 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Sun, 28 Jun 2020 15:03:23 +0200 Subject: [PATCH] merge fixes --- src/server.cpp | 47 +++++++++++++++++++++++------------------------ src/server.h | 2 ++ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 899a6bbe..7f1ca637 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -403,9 +403,6 @@ CServer::CServer ( const int iNewMaxNumChan, QString().number( static_cast ( iPortNumber ) ) ); } - // jam recorder needs the frame size - JamController.SetRecordingDir ( strRecordingDirName, iServerFrameSizeSamples ); - // manage welcome message: if the welcome message is a valid link to a local // file, the content of that file is used as the welcome message (#361) strWelcomeMessage = strNewWelcomeMessage; // first copy text, may be overwritten @@ -423,7 +420,9 @@ CServer::CServer ( const int iNewMaxNumChan, // restrict welcome message to maximum allowed length strWelcomeMessage = strWelcomeMessage.left ( MAX_LEN_CHAT_TEXT ); - // enable jam recording (if requested) - kicks off the thread + // enable jam recording (if requested) - kicks off the thread (note + // that jam recorder needs the frame size which is given to the jam + // recorder in the SetRecordingDir() function) SetRecordingDir ( strRecordingDirName ); // enable all channels (for the server all channel must be enabled the @@ -487,14 +486,14 @@ CServer::CServer ( const int iNewMaxNumChan, QObject::connect ( &JamController, &recorder::CJamController::EndRecorderThread, this, &CServer::EndRecorderThread ); - QObject::connect( this, &CServer::Stopped, + QObject::connect ( this, &CServer::Stopped, &JamController, &recorder::CJamController::Stopped ); - QObject::connect( this, &CServer::ClientDisconnected, + QObject::connect ( this, &CServer::ClientDisconnected, &JamController, &recorder::CJamController::ClientDisconnected ); qRegisterMetaType> ( "CVector" ); - QObject::connect( this, &CServer::AudioFrame, + QObject::connect ( this, &CServer::AudioFrame, &JamController, &recorder::CJamController::AudioFrame ); QObject::connect ( QCoreApplication::instance(), &QCoreApplication::aboutToQuit, @@ -1348,6 +1347,22 @@ void CServer::CreateAndSendChatTextForAllConChannels ( const int iCurChanID } } +void CServer::CreateAndSendRecorderStateForAllConChannels() +{ + // get recorder state + ERecorderState eRecorderState = JamController.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 ); + } + } +} + void CServer::CreateOtherMuteStateChanged ( const int iCurChanID, const int iOtherChanID, const bool bIsMuted ) @@ -1533,7 +1548,7 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording ) { JamController.SetEnableRecording ( bNewEnableRecording, IsRunning() ); - // send recording state message - doesn't hurt + // the recording state may have changed, send recording state message CreateAndSendRecorderStateForAllConChannels(); } @@ -1586,22 +1601,6 @@ void CServer::WriteHTMLChannelList() streamFileOut << "" << endl; } -void CServer::CreateAndSendRecorderStateForAllConChannels() -{ - // get recorder state - ERecorderState eRecorderState = JamController.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 ); - } - } -} - void CServer::customEvent ( QEvent* pEvent ) { if ( pEvent->type() == QEvent::User + 11 ) diff --git a/src/server.h b/src/server.h index 1cf1c40b..3eea6a82 100755 --- a/src/server.h +++ b/src/server.h @@ -198,6 +198,7 @@ public: CVector& veciJitBufNumFrames, CVector& veciNetwFrameSizeFact ); + // Jam recorder ------------------------------------------------------------ bool GetRecorderInitialised() { return JamController.GetRecorderInitialised(); } QString GetRecorderErrMsg() { return JamController.GetRecorderErrMsg(); } @@ -213,6 +214,7 @@ public: virtual void CreateAndSendRecorderStateForAllConChannels(); + // Server list management -------------------------------------------------- void UpdateServerList() { ServerListManager.Update(); }