From da6afcf05fcb522bbd4188c98eab4f406ad21e7b Mon Sep 17 00:00:00 2001 From: xenakios Date: Fri, 22 Dec 2017 22:35:02 +0200 Subject: [PATCH] Layout parameter components manually...Add parameter for input pass through. etc --- Source/PluginEditor.cpp | 102 ++++++++++++++++++++++++++++--------- Source/PluginEditor.h | 13 +++++ Source/PluginProcessor.cpp | 8 +++ Source/PluginProcessor.h | 8 +-- readme.txt | 6 ++- 5 files changed, 105 insertions(+), 32 deletions(-) diff --git a/Source/PluginEditor.cpp b/Source/PluginEditor.cpp index eb163fd..f388e10 100644 --- a/Source/PluginEditor.cpp +++ b/Source/PluginEditor.cpp @@ -94,30 +94,84 @@ void PaulstretchpluginAudioProcessorEditor::resized() m_settings_button.changeWidthToFitText(); m_info_label.setBounds(m_settings_button.getRight() + 1, m_settings_button.getY(), getWidth()-m_settings_button.getRight()-1, 24); - std::array indexes; - indexes[cpi_main_volume] = 0; indexes[cpi_pause_enabled] = 1; - indexes[cpi_capture_enabled] = 2; indexes[cpi_max_capture_len] = 3; - indexes[cpi_freeze] = 4; indexes[cpi_num_outchans] = 5; - indexes[cpi_fftsize] = 6; indexes[cpi_stretchamount] = 7; - indexes[cpi_pitchshift] = 8; indexes[cpi_frequencyshift] = 9; - indexes[cpi_octavesm2] = 10; indexes[cpi_octavesm1] = 11; - indexes[cpi_octaves0] = 12; indexes[cpi_octaves1] = 13; - indexes[cpi_octaves15] = 14; indexes[cpi_octaves2] = 15; - indexes[cpi_numharmonics] = 16; indexes[cpi_harmonicsfreq] = 17; - indexes[cpi_harmonicsbw] = 18; indexes[cpi_harmonicsgauss] = 19; - indexes[cpi_spreadamount] = 20; indexes[cpi_compress] = 21; - indexes[cpi_tonalvsnoisebw] = 22; indexes[cpi_tonalvsnoisepreserve] = 23; - indexes[cpi_soundstart] = 24; indexes[cpi_soundend] = 25; - indexes[cpi_filter_low] = 26; indexes[cpi_filter_high] = 27; - indexes[cpi_loopxfadelen] = 28; indexes[cpi_onsetdetection] = 29; - for (int i = 0; i < indexes.size(); ++i) - { - int tempfoo = indexes[i]; - int gridx = tempfoo % 2; - int gridy = tempfoo / 2; - m_parcomps[i]->setBounds(1+gridx*(getWidth()/2), 30 + gridy * 25, getWidth()/2-2, 24); - } - int yoffs = m_parcomps[cpi_loopxfadelen]->getBottom() + 1; + int w = getWidth(); + int xoffs = 1; + int yoffs = 30; + int div = w / 4; + m_parcomps[cpi_capture_enabled]->setBounds(xoffs, yoffs, div-1, 24); + xoffs += div; + m_parcomps[cpi_passthrough]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_pause_enabled]->setBounds(xoffs, yoffs, div-1, 24); + xoffs += div; + m_parcomps[cpi_freeze]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + div = w / 2; + m_parcomps[cpi_main_volume]->setBounds(xoffs, yoffs, div-1, 24); + xoffs += div; + m_parcomps[cpi_num_outchans]->setBounds(xoffs, yoffs, div-1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_fftsize]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_stretchamount]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_pitchshift]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_frequencyshift]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_octavesm2]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_octavesm1]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_octaves0]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_octaves1]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_octaves15]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_octaves2]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_numharmonics]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_harmonicsfreq]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_harmonicsbw]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_harmonicsgauss]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_spreadamount]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_compress]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_tonalvsnoisebw]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_tonalvsnoisepreserve]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_soundstart]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_soundend]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_filter_low]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_filter_high]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs = 1; + yoffs += 25; + m_parcomps[cpi_loopxfadelen]->setBounds(xoffs, yoffs, div - 1, 24); + xoffs += div; + m_parcomps[cpi_onsetdetection]->setBounds(xoffs, yoffs, div - 1, 24); + yoffs += 25; int remain_h = getHeight() - 1 - yoffs; 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); diff --git a/Source/PluginEditor.h b/Source/PluginEditor.h index dcb2c83..3c61a99 100644 --- a/Source/PluginEditor.h +++ b/Source/PluginEditor.h @@ -317,6 +317,19 @@ public: } }; +class ParamLayoutInfo +{ +public: + ParamLayoutInfo() {} + ParamLayoutInfo(int c, int x, int y, int w, int h) : + m_comp(c), m_col(x), m_row(y), m_w(w), m_h(h) {} + int m_comp = 0; + int m_col = 0; + int m_row = 0; + int m_w = 1; + int m_h = 1; +}; + class PaulstretchpluginAudioProcessorEditor : public AudioProcessorEditor, public MultiTimer { diff --git a/Source/PluginProcessor.cpp b/Source/PluginProcessor.cpp index 92fb0fd..c2d3727 100644 --- a/Source/PluginProcessor.cpp +++ b/Source/PluginProcessor.cpp @@ -147,6 +147,7 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() addParameter(m_outchansparam); // 27 addParameter(new AudioParameterBool("pause_enabled0", "Pause", false)); // 28 addParameter(new AudioParameterFloat("maxcapturelen_0", "Max capture length", 1.0f, 120.0f, 10.0f)); // 29 + addParameter(new AudioParameterBool("passthrough0", "Pass input through", false)); // 30 setPreBufferAmount(2); startTimer(1, 50); } @@ -176,6 +177,13 @@ void PaulstretchpluginAudioProcessor::setPreBufferAmount(int x) } } +int PaulstretchpluginAudioProcessor::getPreBufferAmount() +{ + if (m_use_backgroundbuffering == false) + return -1; + return m_prebuffer_amount; +} + //============================================================================== const String PaulstretchpluginAudioProcessor::getName() const { diff --git a/Source/PluginProcessor.h b/Source/PluginProcessor.h index ba007eb..f3e447c 100644 --- a/Source/PluginProcessor.h +++ b/Source/PluginProcessor.h @@ -55,6 +55,7 @@ const int cpi_capture_enabled = 26; const int cpi_num_outchans = 27; const int cpi_pause_enabled = 28; const int cpi_max_capture_len = 29; +const int cpi_passthrough = 30; class MyPropertiesFile { @@ -141,12 +142,7 @@ public: bool m_use_backgroundbuffering = true; bool m_pass_input_through = false; void setPreBufferAmount(int x); - int getPreBufferAmount() - { - if (m_use_backgroundbuffering==false) - return -1; - return m_prebuffer_amount; - } + int getPreBufferAmount(); private: diff --git a/readme.txt b/readme.txt index f28c2e4..fd964a6 100644 --- a/readme.txt +++ b/readme.txt @@ -25,10 +25,12 @@ History : -File import dialog allows importing file formats supported by JUCE, not just .wav 12-17-2017 1.0.0 preview 2b -Fix buffer channel count issue, seems to make AU validation pass consistently -12-20-2017 1.0.0 preview 3 +12-22-2017 1.0.0 preview 3 -Added parameter to set audio input capture buffer length (up to 120 seconds) -Add button to show settings menu -Fix bug when offline rendering in host - -Allow setting background prebuffering amount in settings, including none. (None is mostly useful in case the plugin doesn't detect the host is offline rendering. For real time playback none is likely only going to work with small FFT sizes.) + -Allow setting background prebuffering amount in settings, including none. + (None is mostly useful in case the plugin doesn't detect the host is offline rendering. + For real time playback none is likely only going to work with small FFT sizes.) -Slightly better GUI layout but still just 2 columns of parameters -Remember last file import folder