Layout parameter components manually...Add parameter for input pass through. etc

This commit is contained in:
xenakios
2017-12-22 22:35:02 +02:00
parent 0052c77bbb
commit da6afcf05f
5 changed files with 105 additions and 32 deletions

View File

@ -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<int,30> 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);

View File

@ -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
{

View File

@ -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
{

View File

@ -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: