Browse Source

Trying to get the Mac build working, but no luck...

tags/v100_p5
xenakios 8 years ago
parent
commit
3fd0b4ea09
6 changed files with 20 additions and 10 deletions
  1. +11
    -5
      Source/PS_Source/Input/AInputS.h
  2. +1
    -1
      Source/PS_Source/Input/InputS.h
  3. +3
    -1
      Source/PS_Source/PaulStretchControl.cpp
  4. +3
    -1
      Source/PS_Source/StretchSource.cpp
  5. +1
    -1
      Source/WDL/resample.cpp
  6. +1
    -1
      paulstretchplugin.jucer

+ 11
- 5
Source/PS_Source/Input/AInputS.h View File

@@ -22,7 +22,6 @@


#include "../JuceLibraryCode/JuceHeader.h" #include "../JuceLibraryCode/JuceHeader.h"


//#include <audiofile.h>
#include "InputS.h" #include "InputS.h"


inline double ramp(int64_t pos, int64_t totallen, int64_t rampinlen, int64_t rampoutlen) inline double ramp(int64_t pos, int64_t totallen, int64_t rampinlen, int64_t rampoutlen)
@@ -51,7 +50,8 @@ public:


void setAudioBuffer(AudioBuffer<float>* buf, int samplerate, int len) void setAudioBuffer(AudioBuffer<float>* buf, int samplerate, int len)
{ {
m_afreader = nullptr;
std::lock_guard<std::mutex> locker(m_mutex);
m_afreader = nullptr;
m_using_memory_buffer = true; m_using_memory_buffer = true;
m_readbuf = *buf; m_readbuf = *buf;
info.nchannels = buf->getNumChannels(); info.nchannels = buf->getNumChannels();
@@ -70,7 +70,8 @@ public:
AudioFormatReader* reader = m_manager->createReaderFor(file); AudioFormatReader* reader = m_manager->createReaderFor(file);
if (reader) if (reader)
{ {
m_using_memory_buffer = false;
std::lock_guard<std::mutex> locker(m_mutex);
m_using_memory_buffer = false;
m_afreader = std::unique_ptr<AudioFormatReader>(reader); m_afreader = std::unique_ptr<AudioFormatReader>(reader);
m_currentsample = 0; m_currentsample = 0;
info.samplerate = (int)m_afreader->sampleRate; info.samplerate = (int)m_afreader->sampleRate;
@@ -96,8 +97,12 @@ public:
} }
int readNextBlock(AudioBuffer<float>& abuf, int nsmps, int numchans) override int readNextBlock(AudioBuffer<float>& abuf, int nsmps, int numchans) override
{ {
if (m_afreader == nullptr && m_using_memory_buffer == false)
return 0;
std::lock_guard<std::mutex> locker(m_mutex);
if (m_afreader == nullptr && m_using_memory_buffer == false)
{
jassert(false);
return 0;
}
int inchans = 0; int inchans = 0;
if (m_afreader) if (m_afreader)
inchans = m_afreader->numChannels; inchans = m_afreader->numChannels;
@@ -292,4 +297,5 @@ private:
int64_t m_loopcount = 0; int64_t m_loopcount = 0;
bool m_using_memory_buffer = false; bool m_using_memory_buffer = false;
AudioFormatManager* m_manager = nullptr; AudioFormatManager* m_manager = nullptr;
std::mutex m_mutex;
}; };

+ 1
- 1
Source/PS_Source/Input/InputS.h View File

@@ -81,7 +81,7 @@ public:
} }
protected: protected:
int64_t m_currentsample = 0;
volatile int64_t m_currentsample = 0;
int m_silenceoutputted = 0; int m_silenceoutputted = 0;
bool m_loop_enabled = false; bool m_loop_enabled = false;
Range<double> m_activerange{ 0.0,1.0 }; Range<double> m_activerange{ 0.0,1.0 };


+ 3
- 1
Source/PS_Source/PaulStretchControl.cpp View File

@@ -65,7 +65,9 @@ Control::~Control()
} }
void Control::processAudio(AudioBuffer<float>& buf) void Control::processAudio(AudioBuffer<float>& buf)
{ {
if (m_buffering_source != nullptr)
jassert(m_buffering_source!=nullptr);
jassert(m_bufferingthread.isThreadRunning());
if (m_buffering_source != nullptr)
{ {
AudioSourceChannelInfo aif(buf); AudioSourceChannelInfo aif(buf);
m_buffering_source->getNextAudioBlock(aif); m_buffering_source->getNextAudioBlock(aif);


+ 3
- 1
Source/PS_Source/StretchSource.cpp View File

@@ -134,13 +134,15 @@ void StretchAudioSource::getNextAudioBlock(const AudioSourceChannelInfo & buffer
if (m_stretchoutringbuf.available() > 0) if (m_stretchoutringbuf.available() > 0)
m_output_has_begun = true; m_output_has_begun = true;
bool freezing = m_freezing; bool freezing = m_freezing;
if (m_stretchers[0]->isFreezing() != freezing)
/*
if (m_stretchers[0]->isFreezing() != freezing)
{ {
if (freezing == true && m_inputfile!=nullptr) if (freezing == true && m_inputfile!=nullptr)
m_freeze_pos = 1.0/m_inputfile->info.nsamples*m_inputfile->getCurrentPosition(); m_freeze_pos = 1.0/m_inputfile->info.nsamples*m_inputfile->getCurrentPosition();
for (auto& e : m_stretchers) for (auto& e : m_stretchers)
e->set_freezing(m_freezing); e->set_freezing(m_freezing);
} }
*/
double maingain = Decibels::decibelsToGain((double)val_MainVolume.getValue()); double maingain = Decibels::decibelsToGain((double)val_MainVolume.getValue());
if (m_vol_smoother.getTargetValue() != maingain) if (m_vol_smoother.getTargetValue() != maingain)
m_vol_smoother.setValue(maingain); m_vol_smoother.setValue(maingain);


+ 1
- 1
Source/WDL/resample.cpp View File

@@ -632,7 +632,7 @@ int WDL_Resampler::ResampleOut(WDL_ResampleSample *out, int nsamples_in, int nsa
m_samples_in_rsinbuf -= isrcpos; m_samples_in_rsinbuf -= isrcpos;
if (m_samples_in_rsinbuf <= 0) m_samples_in_rsinbuf=0; if (m_samples_in_rsinbuf <= 0) m_samples_in_rsinbuf=0;
else else
memcpy(localin, localin + isrcpos*nch,m_samples_in_rsinbuf*sizeof(WDL_ResampleSample)*nch);
memmove(localin, localin + isrcpos*nch,m_samples_in_rsinbuf*sizeof(WDL_ResampleSample)*nch);




return ret; return ret;


+ 1
- 1
paulstretchplugin.jucer View File

@@ -5,7 +5,7 @@
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="0" buildAUv3="0" buildRTAS="0" buildVST="1" buildVST3="0" buildAU="0" buildAUv3="0" buildRTAS="0"
buildAAX="0" buildStandalone="0" enableIAA="0" pluginName="paulstretchplugin"
buildAAX="0" buildStandalone="1" 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"


Loading…
Cancel
Save