Add looping enabled parameter

This commit is contained in:
xenakios 2018-05-09 12:33:06 +03:00
parent 8a4aee93ec
commit 28f14ddf7a
4 changed files with 13 additions and 4 deletions

View File

@ -142,6 +142,8 @@ void StretchAudioSource::setLoopingEnabled(bool b)
ScopedLock locker(m_cs);
if (m_inputfile != nullptr)
{
if (m_inputfile->isLooping() == false && b == true)
seekPercent(m_inputfile->getActiveRange().getStart());
m_inputfile->setLoopEnabled(b);
}
}

View File

@ -83,9 +83,9 @@ PaulstretchpluginAudioProcessorEditor::PaulstretchpluginAudioProcessorEditor(Pau
if (i == cpi_octavesm2 || i == cpi_octavesm1 || i == cpi_octaves0 || i == cpi_octaves1 || i == cpi_octaves15 ||
i == cpi_octaves2 || i==cpi_octaves_extra1 || i==cpi_octaves_extra2)
group_id = -2; // -2 for not included in the main parameters page
if (i >= (int)cpi_octaves_ratio0 && i <= (int)cpi_octaves_ratio7)
if (i >= cpi_octaves_ratio0 && i <= cpi_octaves_ratio7)
group_id = -2;
if (i >= (int)cpi_enable_spec_module0 && i <= (int)cpi_enable_spec_module8)
if ((i >= cpi_enable_spec_module0 && i <= cpi_enable_spec_module8))
group_id = -2;
if (i == cpi_tonalvsnoisebw || i == cpi_tonalvsnoisepreserve)
group_id = 1;
@ -276,7 +276,7 @@ void PaulstretchpluginAudioProcessorEditor::resized()
int w = getWidth();
int xoffs = 1;
yoffs = 30;
int div = w / 5;
int div = w / 6;
//std::vector<std::vector<int>> layout;
//layout.emplace_back(cpi_capture_enabled, cpi_passthrough, cpi_pause_enabled, cpi_freeze);
//layout.emplace_back(cpi_main_volume, cpi_num_inchans, cpi_num_outchans);
@ -291,6 +291,8 @@ void PaulstretchpluginAudioProcessorEditor::resized()
m_parcomps[cpi_freeze]->setBounds(xoffs, yoffs, div - 1, 24);
xoffs += div;
m_parcomps[cpi_bypass_stretch]->setBounds(xoffs, yoffs, div - 1, 24);
xoffs += div;
m_parcomps[cpi_looping_enabled]->setBounds(xoffs, yoffs, div - 1, 24);
xoffs = 1;
yoffs += 25;
div = w / 3;

View File

@ -174,6 +174,8 @@ PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
1.0));
}
addParameter(new AudioParameterBool("loop_enabled0", "Loop", true)); // 60
auto& pars = getParameters();
for (const auto& p : pars)
m_reset_pars.push_back(p->getValue());
@ -682,6 +684,9 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
//m_stretch_source->setSpectralModulesEnabled(m_sm_enab_pars);
if (m_stretch_source->isLoopEnabled() != *getBoolParameter(cpi_looping_enabled))
m_stretch_source->setLoopingEnabled(*getBoolParameter(cpi_looping_enabled));
m_stretch_source->setMainVolume(*getFloatParameter(cpi_main_volume));
m_stretch_source->setRate(*getFloatParameter(cpi_stretchamount));
m_stretch_source->setPreviewDry(*getBoolParameter(cpi_bypass_stretch));

View File

@ -87,7 +87,7 @@ const int cpi_octaves_ratio4 = 56;
const int cpi_octaves_ratio5 = 57;
const int cpi_octaves_ratio6 = 58;
const int cpi_octaves_ratio7 = 59;
const int cpi_looping_enabled = 60;
class MyPropertiesFile
{