Remove the spectral module selection and move parameters. Initial attempt to implement the module enabled parameters. Might need to redesign this a bit...

This commit is contained in:
xenakios
2018-03-06 13:44:36 +02:00
parent 4f148a322d
commit 7fe4ea982e
5 changed files with 49 additions and 8 deletions

View File

@ -159,6 +159,35 @@ void StretchAudioSource::setMainVolume(double decibels)
}
}
void StretchAudioSource::setSpectralModulesEnabled(const std::array<AudioParameterBool*, 9>& params)
{
jassert(params.size() == m_specproc_order.size());
bool changed = false;
for (int i = 0; i < m_specproc_order.size(); ++i)
{
if (*params[i] != m_specproc_order[i].m_enabled)
{
changed = true;
break;
}
}
if (changed == false)
return;
if (m_cs.tryEnter())
{
for (int i = 0; i < m_specproc_order.size(); ++i)
{
m_specproc_order[i].m_enabled = *params[i];
}
for (int i = 0; i < m_stretchers.size(); ++i)
{
m_stretchers[i]->m_spectrum_processes = m_specproc_order;
}
++m_param_change_count;
m_cs.exit();
}
}
void StretchAudioSource::setLoopXFadeLength(double lenseconds)
{
if (lenseconds == m_loopxfadelen)

View File

@ -24,6 +24,7 @@ Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "Input/AInputS.h"
#include "ProcessedStretch.h"
#include <mutex>
#include <array>
#include "../WDL/resample.h"
class StretchAudioSource final : public PositionableAudioSource
@ -98,6 +99,7 @@ public:
void setAudioBufferAsInputSource(AudioBuffer<float>* buf, int sr, int len);
void setMainVolume(double decibels);
double getMainVolume() const { return m_main_volume; }
void setSpectralModulesEnabled(const std::array<AudioParameterBool*, 9>& params);
void setLoopXFadeLength(double lenseconds);
double getLoopXFadeLengtj() const { return m_loopxfadelen; }
void setPreviewDry(bool b);