Initial work to add back the free filter feature

This commit is contained in:
xenakios 2018-02-27 02:33:41 +02:00
parent 600f2d1251
commit cf9b54d19b
7 changed files with 73 additions and 10 deletions

View File

@ -28,10 +28,15 @@ extern String g_plugintitle;
PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(PaulstretchpluginAudioProcessor& p) PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(PaulstretchpluginAudioProcessor& p)
: AudioProcessorEditor(&p), : AudioProcessorEditor(&p),
m_wavecomponent(p.m_afm,p.m_thumb.get()), m_wavecomponent(p.m_afm,p.m_thumb.get()),
processor(p), m_perfmeter(&p) processor(p), m_perfmeter(&p),
m_wavefilter_tab(TabbedButtonBar::TabsAtTop)
{ {
addAndMakeVisible(&m_perfmeter); //addAndMakeVisible(&m_free_filter_component);
m_free_filter_component.set_envelope(processor.m_free_filter_envelope);
m_wavefilter_tab.setTabBarDepth(17);
addAndMakeVisible(&m_perfmeter);
addAndMakeVisible(&m_import_button); addAndMakeVisible(&m_import_button);
m_import_button.setButtonText("Import file..."); m_import_button.setButtonText("Import file...");
@ -45,8 +50,11 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
m_info_label.setJustificationType(Justification::centredRight); m_info_label.setJustificationType(Justification::centredRight);
m_wavecomponent.GetFileCallback = [this]() { return processor.getAudioFile(); }; m_wavecomponent.GetFileCallback = [this]() { return processor.getAudioFile(); };
addAndMakeVisible(&m_wavecomponent); //addAndMakeVisible(&m_wavecomponent);
const auto& pars = processor.getParameters();
const auto& pars = processor.getParameters();
for (int i=0;i<pars.size();++i) for (int i=0;i<pars.size();++i)
{ {
AudioProcessorParameterWithID* parid = dynamic_cast<AudioProcessorParameterWithID*>(pars[i]); AudioProcessorParameterWithID* parid = dynamic_cast<AudioProcessorParameterWithID*>(pars[i]);
@ -86,7 +94,7 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
processor.m_wave_view_range = r; processor.m_wave_view_range = r;
}; };
m_zs.setRange(processor.m_wave_view_range, true); m_zs.setRange(processor.m_wave_view_range, true);
setSize (1000, 30+(pars.size()/2)*25+200+15);
m_wavecomponent.TimeSelectionChangedCallback = [this](Range<double> range, int which) m_wavecomponent.TimeSelectionChangedCallback = [this](Range<double> range, int which)
{ {
*processor.getFloatParameter(cpi_soundstart) = range.getStart(); *processor.getFloatParameter(cpi_soundstart) = range.getStart();
@ -118,7 +126,12 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
{ {
processor.setDirty(); processor.setDirty();
}; };
startTimer(1, 100); m_wavefilter_tab.addTab("Waveform", Colours::white, &m_wavecomponent, false);
m_wavefilter_tab.addTab("Free filter", Colours::white, &m_free_filter_component, false);
addAndMakeVisible(&m_wavefilter_tab);
setSize (1000, 30+(pars.size()/2)*25+200+15);
startTimer(1, 100);
startTimer(2, 1000); startTimer(2, 1000);
startTimer(3, 200); startTimer(3, 200);
m_wavecomponent.startTimer(100); m_wavecomponent.startTimer(100);
@ -240,9 +253,10 @@ void PaulstretchpluginAudioProcessorEditor::resized()
yoffs += 25; yoffs += 25;
int remain_h = getHeight() - 1 - yoffs -15; int remain_h = getHeight() - 1 - yoffs -15;
m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1); m_spec_order_ed.setBounds(1, yoffs, getWidth() - 2, remain_h / 5 * 1);
m_wavecomponent.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4); //m_wavecomponent.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4);
m_zs.setBounds(1, m_wavecomponent.getBottom(), getWidth() - 2, 16);
//m_specvis.setBounds(1, yoffs, getWidth() - 2, getHeight() - 1 - yoffs); m_wavefilter_tab.setBounds(1, m_spec_order_ed.getBottom()+1, getWidth()-2, remain_h/5*4);
m_zs.setBounds(1, m_wavefilter_tab.getBottom(), getWidth() - 2, 16);
} }
void PaulstretchpluginAudioProcessorEditor::timerCallback(int id) void PaulstretchpluginAudioProcessorEditor::timerCallback(int id)

View File

@ -24,6 +24,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "PluginProcessor.h" #include "PluginProcessor.h"
#include <memory> #include <memory>
#include <vector> #include <vector>
#include "envelope_component.h"
class zoom_scrollbar : public Component class zoom_scrollbar : public Component
{ {
@ -229,6 +230,8 @@ private:
void showSettingsMenu(); void showSettingsMenu();
String m_last_err; String m_last_err;
zoom_scrollbar m_zs; zoom_scrollbar m_zs;
EnvelopeComponent m_free_filter_component;
TabbedComponent m_wavefilter_tab;
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessorEditor)
}; };

View File

@ -80,7 +80,10 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
g_activeprocessors.insert(this); g_activeprocessors.insert(this);
m_playposinfo.timeInSeconds = 0.0; m_playposinfo.timeInSeconds = 0.0;
m_recbuffer.setSize(2, 44100);
m_free_filter_envelope = std::make_shared<breakpoint_envelope>();
m_recbuffer.setSize(2, 44100);
m_recbuffer.clear(); m_recbuffer.clear();
if (m_afm->getNumKnownFormats()==0) if (m_afm->getNumKnownFormats()==0)
m_afm->registerBasicFormats(); m_afm->registerBasicFormats();

View File

@ -22,6 +22,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../JuceLibraryCode/JuceHeader.h" #include "../JuceLibraryCode/JuceHeader.h"
#include "PS_Source/PaulStretchControl.h" #include "PS_Source/PaulStretchControl.h"
#include "jcdp_envelope.h"
class MyThumbCache; class MyThumbCache;
@ -169,6 +170,7 @@ public:
bool m_show_technical_info = false; bool m_show_technical_info = false;
Range<double> m_wave_view_range; Range<double> m_wave_view_range;
int m_prepare_count = 0; int m_prepare_count = 0;
std::shared_ptr<breakpoint_envelope> m_free_filter_envelope;
private: private:

View File

@ -1,3 +1,23 @@
/*
Copyright (C) 2006-2011 Nasca Octavian Paul
Author: Nasca Octavian Paul
Copyright (C) 2017 Xenakios
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License (version 2) for more details.
You should have received a copy of the GNU General Public License (version 2)
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "envelope_component.h" #include "envelope_component.h"
EnvelopeComponent::EnvelopeComponent() EnvelopeComponent::EnvelopeComponent()

View File

@ -1,3 +1,23 @@
/*
Copyright (C) 2006-2011 Nasca Octavian Paul
Author: Nasca Octavian Paul
Copyright (C) 2017 Xenakios
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License (version 2) for more details.
You should have received a copy of the GNU General Public License (version 2)
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once #pragma once
#include "../JuceLibraryCode/JuceHeader.h" #include "../JuceLibraryCode/JuceHeader.h"

View File

@ -19,6 +19,7 @@
file="Source/envelope_component.cpp"/> file="Source/envelope_component.cpp"/>
<FILE id="apM6W6" name="envelope_component.h" compile="0" resource="0" <FILE id="apM6W6" name="envelope_component.h" compile="0" resource="0"
file="Source/envelope_component.h"/> file="Source/envelope_component.h"/>
<FILE id="qfCc8R" name="jcdp_envelope.h" compile="0" resource="0" file="Source/jcdp_envelope.h"/>
<FILE id="TDOHpE" name="resample.cpp" compile="1" resource="0" file="Source/WDL/resample.cpp"/> <FILE id="TDOHpE" name="resample.cpp" compile="1" resource="0" file="Source/WDL/resample.cpp"/>
<GROUP id="{3B6D1AF9-E53E-2F78-24A5-D12A34009E6A}" name="PS_Source"> <GROUP id="{3B6D1AF9-E53E-2F78-24A5-D12A34009E6A}" name="PS_Source">
<FILE id="bnWZA4" name="BinauralBeats.cpp" compile="1" resource="0" <FILE id="bnWZA4" name="BinauralBeats.cpp" compile="1" resource="0"