Try handling multichannel stuff. Not going too well, looks like the plugin will need to get a setting to set the actual number of output channels that will be processed...

This commit is contained in:
xenakios 2017-11-14 03:13:32 +02:00
parent b2cdb3aa85
commit 836dad1e7d
3 changed files with 6 additions and 22 deletions

View File

@ -113,6 +113,8 @@ void PaulstretchpluginAudioProcessor::changeProgramName (int index, const String
//==============================================================================
void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int samplesPerBlock)
{
if (getNumOutputChannels() != m_cur_num_out_chans)
m_ready_to_play = false;
if (m_using_memory_buffer == true)
{
int len = jlimit(100,m_recbuffer.getNumSamples(), m_rec_pos);
@ -134,29 +136,10 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl
String err;
m_control->startplay(false, true,
{ *getFloatParameter(5),*getFloatParameter(6) },
2, err);
this->getNumOutputChannels(), err);
m_cur_num_out_chans = getNumOutputChannels();
m_ready_to_play = true;
}
return;
m_ready_to_play = false;
m_control->set_input_file(File("C:/MusicAudio/sourcesamples/sheila.wav"), [this](String cberr)
{
if (cberr.isEmpty())
{
m_ready_to_play = true;
String err;
m_control->update_player_stretch();
m_control->update_process_parameters();
m_control->startplay(false, true, { 0.0,1.0 }, 2, err);
auto ed = dynamic_cast<PaulstretchpluginAudioProcessorEditor*>(getActiveEditor());
if (ed)
{
ed->setAudioFile(m_control->getStretchAudioSource()->getAudioFile());
}
}
else m_ready_to_play = false;
});
}
void PaulstretchpluginAudioProcessor::releaseResources()

View File

@ -74,6 +74,7 @@ private:
int m_rec_pos = 0;
void finishRecording(int lenrecorded);
bool m_using_memory_buffer = true;
int m_cur_num_out_chans = 2;
std::mutex m_mutex;
//==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)

View File

@ -7,7 +7,7 @@
buildVST="1" buildVST3="0" buildAU="1" buildAUv3="0" buildRTAS="0"
buildAAX="0" buildStandalone="1" enableIAA="0" pluginName="paulstretchplugin"
pluginDesc="paulstretchplugin" pluginManufacturer="Xenakios"
pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{8,8}"
pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{4,4}, {8,8}"
pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0"
pluginIsMidiEffectPlugin="0" pluginEditorRequiresKeys="0" pluginAUExportPrefix="paulstretchpluginAU"
pluginRTASCategory="" aaxIdentifier="com.yourcompany.paulstretchplugin"