OK, it plays some crappy audio but crashes on quit and all that kind of great stuff
This commit is contained in:
@ -61,8 +61,17 @@ Control::Control(AudioFormatManager* afm) : m_afm(afm), m_bufferingthread("stret
|
||||
|
||||
Control::~Control()
|
||||
{
|
||||
|
||||
};
|
||||
m_bufferingthread.stopThread(1000);
|
||||
}
|
||||
void Control::processAudio(AudioBuffer<float>& buf)
|
||||
{
|
||||
if (m_buffering_source != nullptr)
|
||||
{
|
||||
AudioSourceChannelInfo aif(buf);
|
||||
m_buffering_source->getNextAudioBlock(aif);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Control::setStretchAmount(double rate)
|
||||
@ -274,7 +283,9 @@ void Control::startplay(bool /*bypass*/, bool /*realtime*/, Range<double> playra
|
||||
m_bufferingthread, false, bufamt, numoutchans, false);
|
||||
m_recreate_buffering_source = false;
|
||||
}
|
||||
|
||||
if (m_bufferingthread.isThreadRunning() == false)
|
||||
m_bufferingthread.startThread();
|
||||
m_buffering_source->prepareToPlay(1024, 44100.0);
|
||||
m_stretch_source->setNumOutChannels(numoutchans);
|
||||
m_stretch_source->setFFTSize(m_fft_size_to_use);
|
||||
update_process_parameters();
|
||||
@ -289,7 +300,7 @@ void Control::startplay(bool /*bypass*/, bool /*realtime*/, Range<double> playra
|
||||
void Control::stopplay()
|
||||
{
|
||||
//m_adm->removeAudioCallback(&m_test_callback);
|
||||
|
||||
m_bufferingthread.stopThread(1000);
|
||||
};
|
||||
|
||||
void Control::set_seek_pos(REALTYPE x)
|
||||
|
@ -90,7 +90,8 @@ class Control
|
||||
public:
|
||||
Control(AudioFormatManager* afm);
|
||||
~Control();
|
||||
void startplay(bool bypass, bool realtime, Range<double> playrange, int numoutchans, String& err);
|
||||
void processAudio(AudioBuffer<float>& buf);
|
||||
void startplay(bool bypass, bool realtime, Range<double> playrange, int numoutchans, String& err);
|
||||
void stopplay();
|
||||
void set_seek_pos(REALTYPE x);
|
||||
REALTYPE get_seek_pos();
|
||||
|
@ -20,8 +20,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
extern std::unique_ptr<PropertiesFile> g_propsfile;
|
||||
|
||||
FFT::FFT(int nsamples_)
|
||||
{
|
||||
nsamples=nsamples_;
|
||||
@ -39,7 +37,7 @@ FFT::FFT(int nsamples_)
|
||||
|
||||
|
||||
data.resize(nsamples,true);
|
||||
bool allow_long_planning = g_propsfile->getBoolValue("fftw_allow_long_planning",false);
|
||||
bool allow_long_planning = false; // g_propsfile->getBoolValue("fftw_allow_long_planning", false);
|
||||
//double t0 = Time::getMillisecondCounterHiRes();
|
||||
if (allow_long_planning)
|
||||
{
|
||||
|
@ -7,38 +7,18 @@
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
extern std::unique_ptr<PropertiesFile> g_propsfile;
|
||||
|
||||
StretchAudioSource::StretchAudioSource(int initialnumoutchans, AudioFormatManager* afm) : m_afm(afm)
|
||||
{
|
||||
m_resampler = std::make_unique<WDL_Resampler>();
|
||||
m_resampler_outbuf.resize(1024*1024);
|
||||
m_inputfile = std::make_unique<AInputS>(m_afm);
|
||||
m_specproc_order = { 0,1,2,3,4,5,6,7 };
|
||||
String order = g_propsfile->getValue("spectral_order", "01234567");
|
||||
if (order.isNotEmpty())
|
||||
{
|
||||
std::vector<int> temp;
|
||||
for (int i = 0; i<order.length(); ++i)
|
||||
{
|
||||
int index = order[i] - 48;
|
||||
if (index >= 0 && index<8)
|
||||
{
|
||||
temp.push_back(index);
|
||||
//Logger::writeToLog(temp.back().m_name);
|
||||
}
|
||||
}
|
||||
m_specproc_order = temp;
|
||||
}
|
||||
setNumOutChannels(initialnumoutchans);
|
||||
}
|
||||
|
||||
StretchAudioSource::~StretchAudioSource()
|
||||
{
|
||||
String temp;
|
||||
for (auto& e : m_specproc_order)
|
||||
temp.append(String(e),1);
|
||||
g_propsfile->setValue("spectral_order", temp);
|
||||
|
||||
}
|
||||
|
||||
void StretchAudioSource::prepareToPlay(int /*samplesPerBlockExpected*/, double sampleRate)
|
||||
@ -59,6 +39,7 @@ void StretchAudioSource::prepareToPlay(int /*samplesPerBlockExpected*/, double s
|
||||
|
||||
void StretchAudioSource::releaseResources()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool StretchAudioSource::isResampling()
|
||||
@ -149,7 +130,7 @@ void StretchAudioSource::getNextAudioBlock(const AudioSourceChannelInfo & buffer
|
||||
for (auto& e : m_stretchers)
|
||||
e->set_freezing(m_freezing);
|
||||
}
|
||||
double maingain = Decibels::decibelsToGain((double)val_MainVolume.getValue());
|
||||
double maingain = 0.5; // Decibels::decibelsToGain((double)val_MainVolume.getValue());
|
||||
if (m_vol_smoother.getTargetValue() != maingain)
|
||||
m_vol_smoother.setValue(maingain);
|
||||
FloatVectorOperations::disableDenormalisedNumberSupport();
|
||||
@ -532,10 +513,7 @@ MultiStretchAudioSource::MultiStretchAudioSource(int initialnumoutchans, AudioFo
|
||||
|
||||
MultiStretchAudioSource::~MultiStretchAudioSource()
|
||||
{
|
||||
String temp;
|
||||
for (auto& e : getActiveStretchSource()->getSpectrumProcessOrder())
|
||||
temp.append(String(e), 1);
|
||||
g_propsfile->setValue("spectral_order", temp);
|
||||
|
||||
}
|
||||
|
||||
void MultiStretchAudioSource::prepareToPlay(int samplesPerBlockExpected, double sampleRate)
|
||||
|
Reference in New Issue
Block a user