From f0b2d9ec823154115f6d693647f012d9ed6c7d62 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Thu, 13 Jan 2022 20:18:10 +0100 Subject: [PATCH] - lcd4l: fix count of records Signed-off-by: Thilo Graf --- 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 7f76a483c..d91dd80fb 100644 --- a/src/driver/lcd4l.cpp +++ b/src/driver/lcd4l.cpp @@ -286,6 +286,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; @@ -604,13 +605,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 71c187ca2..f8d1cf37c 100644 --- a/src/driver/lcd4l.h +++ b/src/driver/lcd4l.h @@ -128,6 +128,7 @@ class CLCD4l int m_Tuner; int m_Volume; int m_ModeRec; + int m_RecordCount; int m_ModeTshift; int m_ModeTimer; // int m_ModeEcm;