From fa2564f9083496fc32cb57f8e14768e5e2e213b8 Mon Sep 17 00:00:00 2001 From: xenakios Date: Tue, 1 May 2018 18:35:00 +0300 Subject: [PATCH] Added dedicated timer for perf meter component --- Source/PluginEditor.cpp | 8 +++++++- Source/PluginEditor.h | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index 8608b20..51fcaba 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -411,7 +411,7 @@ void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) if (processor.m_offline_render_state >= 0 && processor.m_offline_render_state <= 100) infotext += String(processor.m_offline_render_state)+"%"; m_info_label.setText(infotext, dontSendNotification); - m_perfmeter.repaint(); + } if (id == 2) { @@ -1277,6 +1277,7 @@ PerfMeterComponent::PerfMeterComponent(PaulstretchpluginAudioProcessor * p) m_gradient.addColour(0.0, Colours::red); m_gradient.addColour(0.25, Colours::yellow); m_gradient.addColour(1.0, Colours::green); + startTimer(30); } void PerfMeterComponent::paint(Graphics & g) @@ -1318,6 +1319,11 @@ void PerfMeterComponent::mouseDown(const MouseEvent & ev) } } +void PerfMeterComponent::timerCallback() +{ + repaint(); +} + void zoom_scrollbar::mouseDown(const MouseEvent &e) { m_drag_start_x = e.x; diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index e2d7473..61bb6c7 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -104,12 +104,13 @@ private: Colour m_labeldefcolor; }; -class PerfMeterComponent : public Component +class PerfMeterComponent : public Component, public Timer { public: PerfMeterComponent(PaulstretchpluginAudioProcessor* p); void paint(Graphics& g) override; void mouseDown(const MouseEvent& ev) override; + void timerCallback() override; PaulstretchpluginAudioProcessor* m_proc = nullptr; private: ColourGradient m_gradient;