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;