From 5b64b8c77990f7bd58df8aa1f0a44682b564fb6d Mon Sep 17 00:00:00 2001 From: xenakios Date: Wed, 9 May 2018 14:02:22 +0300 Subject: [PATCH] Add rewind button --- Source/PluginEditor.cpp | 11 ++++++++++- Source/PluginEditor.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index e0db0e4..fdf44f4 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -1,4 +1,4 @@ -/* +/* Copyright (C) 2006-2011 Nasca Octavian Paul Author: Nasca Octavian Paul @@ -63,6 +63,13 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau m_render_button.onClick = [this]() { showRenderDialog(); }; } + addAndMakeVisible(m_rewind_button); + m_rewind_button.setButtonText("<<"); + m_rewind_button.onClick = [this]() + { + processor.getStretchSource()->seekPercent(processor.getStretchSource()->getPlayRange().getStart()); + }; + addAndMakeVisible(&m_info_label); m_info_label.setJustificationType(Justification::centredRight); @@ -270,6 +277,8 @@ void PaulstretchpluginAudioProcessorEditor::resized() m_render_button.changeWidthToFitText(); yoffs = m_render_button.getRight() + 1; } + m_rewind_button.setBounds(yoffs, 1, 30, 24); + yoffs = m_rewind_button.getRight() + 1; m_perfmeter.setBounds(yoffs, 1, 150, 24); m_info_label.setBounds(m_perfmeter.getRight() + 1, m_settings_button.getY(), getWidth()- m_perfmeter.getRight()-1, 24); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index 80ba018..8690883 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -250,6 +250,7 @@ private: TextButton m_import_button; TextButton m_settings_button; TextButton m_render_button; + TextButton m_rewind_button; Label m_info_label; SpectralChainEditor m_spec_order_ed;