From 8bf1f6aec8c29c58eefb7278e922616de9fba198 Mon Sep 17 00:00:00 2001 From: Brian Ferguson Date: Mon, 15 Jul 2013 11:59:58 -0600 Subject: [PATCH] Add "Paused=0/1" to measures. This is an addition to a883e9d. --- Library/Measure.cpp | 17 +++++++++++++++++ Library/Measure.h | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Library/Measure.cpp b/Library/Measure.cpp index 53e41b4c..c114943e 100644 --- a/Library/Measure.cpp +++ b/Library/Measure.cpp @@ -129,6 +129,7 @@ void Measure::ReadOptions(ConfigParser& parser, const WCHAR* section) m_Invert = 0!=parser.ReadInt(section, L"InvertMeasure", 0); m_Disabled = 0!=parser.ReadInt(section, L"Disabled", 0); + m_Paused = 0!=parser.ReadInt(section, L"Paused", 0); m_MinValue = parser.ReadFloat(section, L"MinValue", m_MinValue); m_MaxValue = parser.ReadFloat(section, L"MaxValue", m_MaxValue); @@ -188,6 +189,22 @@ void Measure::Enable() m_MeterWindow->GetParser().SetValue(m_Name, L"Disabled", L"0"); } +void Measure::Pause() +{ + m_Paused = true; + + // Change the option as well to avoid reset in ReadOptions(). + m_MeterWindow->GetParser().SetValue(m_Name, L"Paused", L"1"); +} + +void Measure::Unpause() +{ + m_Paused = false; + + // Change the option as well to avoid reset in ReadOptions(). + m_MeterWindow->GetParser().SetValue(m_Name, L"Paused", L"0"); +} + /* ** Substitues text using a straight find and replace method */ diff --git a/Library/Measure.h b/Library/Measure.h index 1ac06179..de7843c5 100644 --- a/Library/Measure.h +++ b/Library/Measure.h @@ -66,8 +66,8 @@ public: void Enable(); bool IsDisabled() { return m_Disabled; } - void Pause() { m_Paused = true; } - void Unpause() { m_Paused = false; } + void Pause(); + void Unpause(); bool IsPaused() { return m_Paused; } virtual void Command(const std::wstring& command);