Browse Source

Use parameter index constants

tags/v100_p5
xenakios 7 years ago
parent
commit
6ad663da47
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      Source/PluginProcessor.cpp

+ 6
- 6
Source/PluginProcessor.cpp View File

@@ -251,11 +251,11 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl
} }
if (m_ready_to_play == false) if (m_ready_to_play == false)
{ {
setFFTSize(*getFloatParameter(2));
setFFTSize(*getFloatParameter(cpi_fftsize));
m_stretch_source->setProcessParameters(&m_ppar); m_stretch_source->setProcessParameters(&m_ppar);
String err; String err;
startplay({ *getFloatParameter(5),*getFloatParameter(6) },
startplay({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) },
numoutchans, samplesPerBlock, err); numoutchans, samplesPerBlock, err);
m_cur_num_out_chans = numoutchans; m_cur_num_out_chans = numoutchans;
m_ready_to_play = true; m_ready_to_play = true;
@@ -335,8 +335,8 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
} }
jassert(m_buffering_source != nullptr); jassert(m_buffering_source != nullptr);
jassert(m_bufferingthread.isThreadRunning()); jassert(m_bufferingthread.isThreadRunning());
m_stretch_source->setMainVolume(*getFloatParameter(0));
m_stretch_source->setRate(*getFloatParameter(1));
m_stretch_source->setMainVolume(*getFloatParameter(cpi_main_volume));
m_stretch_source->setRate(*getFloatParameter(cpi_stretchamount));


setFFTSize(*getFloatParameter(cpi_fftsize)); setFFTSize(*getFloatParameter(cpi_fftsize));
m_ppar.pitch_shift.cents = *getFloatParameter(cpi_pitchshift) * 100.0; m_ppar.pitch_shift.cents = *getFloatParameter(cpi_pitchshift) * 100.0;
@@ -501,7 +501,7 @@ String PaulstretchpluginAudioProcessor::setAudioFile(File f)


Range<double> PaulstretchpluginAudioProcessor::getTimeSelection() Range<double> PaulstretchpluginAudioProcessor::getTimeSelection()
{ {
return { *getFloatParameter(5),*getFloatParameter(6) };
return { *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) };
} }


double PaulstretchpluginAudioProcessor::getPreBufferingPercent() double PaulstretchpluginAudioProcessor::getPreBufferingPercent()
@@ -545,7 +545,7 @@ void PaulstretchpluginAudioProcessor::finishRecording(int lenrecording)
{ {
m_is_recording = false; m_is_recording = false;
m_stretch_source->setAudioBufferAsInputSource(&m_recbuffer, getSampleRate(), lenrecording); m_stretch_source->setAudioBufferAsInputSource(&m_recbuffer, getSampleRate(), lenrecording);
m_stretch_source->setPlayRange({ *getFloatParameter(5),*getFloatParameter(6) }, true);
m_stretch_source->setPlayRange({ *getFloatParameter(cpi_soundstart),*getFloatParameter(cpi_soundend) }, true);
auto ed = dynamic_cast<PaulstretchpluginAudioProcessorEditor*>(getActiveEditor()); auto ed = dynamic_cast<PaulstretchpluginAudioProcessorEditor*>(getActiveEditor());
if (ed) if (ed)
{ {


Loading…
Cancel
Save