macOs build fixes. Plugin itself doesn't work properly...

This commit is contained in:
xenakios 2017-11-16 00:37:24 +02:00
parent c283d719d0
commit d32d855e64
4 changed files with 179 additions and 168 deletions

View File

@ -58,8 +58,13 @@ void PaulstretchpluginAudioProcessorEditor::buttonClicked(Button * but)
} }
if (but == &m_import_button) if (but == &m_import_button)
{ {
FileChooser myChooser("Please select audio file...", #ifdef WIN32
File("C:/MusicAudio/sourcesamples"), File initialloc("C:/MusicAudio/sourcesamples");
#else
File initialloc("/Users/teemu/AudioProjects/sourcesamples");
#endif
FileChooser myChooser("Please select audio file...",
initialloc,
"*.wav"); "*.wav");
if (myChooser.browseForFileToOpen()) if (myChooser.browseForFileToOpen())
{ {

View File

@ -13,6 +13,19 @@
#undef min #undef min
#undef max #undef max
template<typename F>
void callGUI(AudioProcessor* ap, F&& f, bool async)
{
auto ed = dynamic_cast<PaulstretchpluginAudioProcessorEditor*>(ap->getActiveEditor());
if (ed)
{
if (async == false)
f(ed);
else
MessageManager::callAsync([ed,f]() { f(ed); });
}
}
//============================================================================== //==============================================================================
PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor() PaulstretchpluginAudioProcessor::PaulstretchpluginAudioProcessor()
#ifndef JucePlugin_PreferredChannelConfigurations #ifndef JucePlugin_PreferredChannelConfigurations
@ -123,7 +136,7 @@ void PaulstretchpluginAudioProcessor::prepareToPlay(double sampleRate, int sampl
m_control->getStretchAudioSource()->setAudioBufferAsInputSource(&m_recbuffer, m_control->getStretchAudioSource()->setAudioBufferAsInputSource(&m_recbuffer,
getSampleRate(), getSampleRate(),
len); len);
callGUI([this,len](auto ed) { ed->setAudioBuffer(&m_recbuffer, getSampleRate(), len); },false); callGUI(this,[this,len](auto ed) { ed->setAudioBuffer(&m_recbuffer, getSampleRate(), len); },false);
} }
if (m_ready_to_play == false) if (m_ready_to_play == false)
{ {
@ -204,7 +217,7 @@ void PaulstretchpluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, M
{ {
int recbuflenframes = m_max_reclen * getSampleRate(); int recbuflenframes = m_max_reclen * getSampleRate();
copyAudioBufferWrappingPosition(buffer, m_recbuffer, m_rec_pos, recbuflenframes); copyAudioBufferWrappingPosition(buffer, m_recbuffer, m_rec_pos, recbuflenframes);
callGUI([this, &buffer](PaulstretchpluginAudioProcessorEditor*ed) callGUI(this,[this, &buffer](PaulstretchpluginAudioProcessorEditor*ed)
{ {
ed->addAudioBlock(buffer, getSampleRate(), m_rec_pos); ed->addAudioBlock(buffer, getSampleRate(), m_rec_pos);
}, false); }, false);
@ -275,7 +288,7 @@ void PaulstretchpluginAudioProcessor::setStateInformation (const void* data, int
setAudioFile(f); setAudioFile(f);
Timer::callAfterDelay(500, [this,f]() Timer::callAfterDelay(500, [this,f]()
{ {
callGUI([f,this](PaulstretchpluginAudioProcessorEditor* ed) callGUI(this,[f,this](PaulstretchpluginAudioProcessorEditor* ed)
{ {
ed->setAudioFile(f); ed->setAudioFile(f);
ed->m_wavecomponent.setTimeSelection({ *getFloatParameter(5),*getFloatParameter(6) }); ed->m_wavecomponent.setTimeSelection({ *getFloatParameter(5),*getFloatParameter(6) });
@ -297,7 +310,7 @@ void PaulstretchpluginAudioProcessor::setRecordingEnabled(bool b)
m_recbuffer.setSize(2, m_max_reclen*getSampleRate()+4096); m_recbuffer.setSize(2, m_max_reclen*getSampleRate()+4096);
m_recbuffer.clear(); m_recbuffer.clear();
m_rec_pos = 0; m_rec_pos = 0;
callGUI([this,lenbufframes](PaulstretchpluginAudioProcessorEditor* ed) callGUI(this,[this,lenbufframes](PaulstretchpluginAudioProcessorEditor* ed)
{ {
ed->beginAddingAudioBlocks(2, getSampleRate(), lenbufframes); ed->beginAddingAudioBlocks(2, getSampleRate(), lenbufframes);
},false); },false);

View File

@ -79,18 +79,7 @@ private:
int m_cur_num_out_chans = 2; int m_cur_num_out_chans = 2;
std::mutex m_mutex; std::mutex m_mutex;
File m_current_file; File m_current_file;
template<typename F>
void callGUI(F&& f, bool async)
{
auto ed = dynamic_cast<PaulstretchpluginAudioProcessorEditor*>(getActiveEditor());
if (ed)
{
if (async == false)
f(ed);
else
MessageManager::callAsync([ed,f]() { f(ed); });
}
}
//============================================================================== //==============================================================================
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor) JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (PaulstretchpluginAudioProcessor)
}; };

View File

@ -4,8 +4,8 @@
reportAppUsage="0" splashScreenColour="Dark" projectType="audioplug" reportAppUsage="0" splashScreenColour="Dark" projectType="audioplug"
version="1.0.0" bundleIdentifier="com.yourcompany.paulstretchplugin" version="1.0.0" bundleIdentifier="com.yourcompany.paulstretchplugin"
includeBinaryInAppConfig="1" cppLanguageStandard="latest" companyCopyright="" includeBinaryInAppConfig="1" cppLanguageStandard="latest" companyCopyright=""
buildVST="1" buildVST3="0" buildAU="1" buildAUv3="0" buildRTAS="0" buildVST="1" buildVST3="0" buildAU="0" buildAUv3="0" buildRTAS="0"
buildAAX="0" buildStandalone="1" enableIAA="0" pluginName="paulstretchplugin" buildAAX="0" buildStandalone="0" enableIAA="0" pluginName="paulstretchplugin"
pluginDesc="paulstretchplugin" pluginManufacturer="Xenakios" pluginDesc="paulstretchplugin" pluginManufacturer="Xenakios"
pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{4,4}, {8,8}" pluginManufacturerCode="XenS" pluginCode="Fn1r" pluginChannelConfigs="{2,2},{4,4}, {8,8}"
pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0" pluginIsSynth="0" pluginWantsMidiIn="0" pluginProducesMidiOut="0"
@ -52,12 +52,16 @@
</GROUP> </GROUP>
</MAINGROUP> </MAINGROUP>
<EXPORTFORMATS> <EXPORTFORMATS>
<XCODE_MAC targetFolder="Builds/MacOSX"> <XCODE_MAC targetFolder="Builds/MacOSX" extraLinkerFlags="/usr/local/Cellar/fftw/3.3.6-pl2/lib/libfftw3f.a&#10;">
<CONFIGURATIONS> <CONFIGURATIONS>
<CONFIGURATION name="Debug" enablePluginBinaryCopyStep="1" isDebug="1" optimisation="1" <CONFIGURATION name="Debug" enablePluginBinaryCopyStep="1" isDebug="1" optimisation="1"
linkTimeOptimisation="0" targetName="paulstretchplugin" headerPath="Source/PS_Source&#10;Source/WDL&#10;"/> linkTimeOptimisation="0" targetName="paulstretchplugin" headerPath="Source/PS_Source&#10;Source/WDL&#10;"
libraryPath="/usr/local/Cellar/fftw/3.3.6-pl2/lib" cppLibType="libc++"
osxArchitecture="64BitIntel" osxCompatibility="10.9 SDK"/>
<CONFIGURATION name="Release" enablePluginBinaryCopyStep="1" isDebug="0" optimisation="3" <CONFIGURATION name="Release" enablePluginBinaryCopyStep="1" isDebug="0" optimisation="3"
linkTimeOptimisation="1" targetName="paulstretchplugin" headerPath="Source/PS_Source&#10;Source/WDL&#10;"/> linkTimeOptimisation="1" targetName="paulstretchplugin" headerPath="Source/PS_Source&#10;Source/WDL&#10;"
osxCompatibility="10.9 SDK" osxArchitecture="64BitIntel" cppLibType="libc++"
libraryPath="/usr/local/Cellar/fftw/3.3.6-pl2/lib"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>
<MODULEPATH id="juce_core" path="../JUCE/modules"/> <MODULEPATH id="juce_core" path="../JUCE/modules"/>
@ -84,7 +88,7 @@
headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\VSTPlugins"/> headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\VSTPlugins"/>
<CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="x64" <CONFIGURATION name="Release" winWarningLevel="4" generateManifest="1" winArchitecture="x64"
debugInformationFormat="ProgramDatabase" enablePluginBinaryCopyStep="1" debugInformationFormat="ProgramDatabase" enablePluginBinaryCopyStep="1"
linkTimeOptimisation="0" isDebug="0" optimisation="3" targetName="paulstretchplugin" linkTimeOptimisation="1" isDebug="0" optimisation="3" targetName="paulstretchplugin"
headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\VSTPlugins"/> headerPath="Source/PS_Source&#10;Source/WDL&#10;" vstBinaryLocation="C:\VSTPlugins"/>
</CONFIGURATIONS> </CONFIGURATIONS>
<MODULEPATHS> <MODULEPATHS>