From fe338049b2e9e8cce292292c34913346d1d2d7f0 Mon Sep 17 00:00:00 2001 From: Peter L Jones Date: Thu, 11 Jun 2020 20:49:50 +0100 Subject: [PATCH] Add recorder state to console --- src/server.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index e52aa3e8..f968d979 100755 --- a/src/server.cpp +++ b/src/server.cpp @@ -240,6 +240,7 @@ CServer::CServer ( const int iNewMaxNumChan, Logging ( iMaxDaysHistory ), iFrameCount ( 0 ), JamRecorder ( strRecordingDirName ), + bEnableRecording ( false ), bWriteStatusHTMLFile ( false ), HighPrecisionTimer ( bNUseDoubleSystemFrameSize ), ServerListManager ( iPortNumber, @@ -405,7 +406,7 @@ CServer::CServer ( const int iNewMaxNumChan, if ( !strRecordingDirName.isEmpty() ) { bRecorderInitialised = JamRecorder.Init ( this, iServerFrameSizeSamples ); - bEnableRecording = bRecorderInitialised; + SetEnableRecording ( bRecorderInitialised ); } // enable all channels (for the server all channel must be enabled the @@ -665,6 +666,7 @@ void CServer::OnAboutToQuit() void CServer::OnHandledSignal ( int sigNum ) { +qDebug() << "OnHandledSignal" << sigNum; #ifdef _WIN32 // Windows does not actually get OnHandledSignal triggered QCoreApplication::instance()->exit(); @@ -705,7 +707,12 @@ void CServer::SetEnableRecording ( bool bNewEnableRecording ) { if ( bRecorderInitialised ) { + // note that this block executes regardless of whether + // what appears to be a change is being applied, to ensure + // the requested state is the result + bEnableRecording = bNewEnableRecording; + qInfo() << "Recording state" << ( bEnableRecording ? "enabled" : "disabled" ); if ( !bEnableRecording ) {