From 55aad37fe5f43478033e06104c4f95462d2f1be0 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Thu, 13 Jan 2022 20:18:10 +0100 Subject: [PATCH] lcd4l: fix count of records Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/fcfb236a6675f078b12387e132c83c3c067cfca3 Author: vanhofen Date: 2022-01-13 (Thu, 13 Jan 2022) Origin message was: ------------------ - lcd4l: fix count of records ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/lcd4l.cpp | 10 +++++++--- src/driver/lcd4l.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/driver/lcd4l.cpp b/src/driver/lcd4l.cpp index 8409b6938..d3acab7f5 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -283,6 +283,7 @@ void CLCD4l::Init() m_Tuner = -1; m_Volume = -1; m_ModeRec = -1; + m_RecordCount = -1; m_ModeTshift = -1; m_ModeTimer = -1; m_ModeEcm = -1; @@ -600,13 +601,16 @@ void CLCD4l::ParseInfo(uint64_t parseID, bool newID, bool firstRun) break; } - std::string _ModeRec = (ModeRec ? "on" : "off"); - _ModeRec += "\n" + to_string(CRecordManager::getInstance()->GetRecordCount()); + int RecordCount = CRecordManager::getInstance()->GetRecordCount(); - if (m_ModeRec != ModeRec) + std::string _ModeRec = (ModeRec ? "on" : "off"); + _ModeRec += "\n" + to_string(RecordCount); + + if ((m_ModeRec != ModeRec) || (m_RecordCount != RecordCount)) { WriteFile(MODE_REC, _ModeRec); m_ModeRec = ModeRec; + m_RecordCount = RecordCount; } if (m_ModeTshift != ModeTshift) diff --git a/src/driver/lcd4l.h b/src/driver/lcd4l.h index 381ef474e..2e692c9e0 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -116,6 +116,7 @@ class CLCD4l int m_Tuner; int m_Volume; int m_ModeRec; + int m_RecordCount; int m_ModeTshift; int m_ModeTimer; int m_ModeEcm;