Initial work to allow having some spectral module order presets

This commit is contained in:
xenakios
2018-11-11 14:46:25 +02:00
parent 605852d853
commit 93cebcdcd2
2 changed files with 20 additions and 0 deletions

View File

@ -26,6 +26,12 @@ www.gnu.org/licenses
#undef max
#endif
std::vector<SpectrumProcessType> g_specorderpresets[3] = {
{SPT_Harmonics,SPT_PitchShift,SPT_FreqShift,SPT_Spread,SPT_TonalVsNoise,SPT_Filter,SPT_FreeFilter,SPT_RatioMix,SPT_Compressor},
{SPT_PitchShift,SPT_Harmonics,SPT_FreqShift,SPT_Spread,SPT_TonalVsNoise,SPT_Filter,SPT_FreeFilter,SPT_RatioMix,SPT_Compressor},
{SPT_RatioMix,SPT_PitchShift,SPT_Harmonics,SPT_FreqShift,SPT_Spread,SPT_TonalVsNoise,SPT_Filter,SPT_FreeFilter,SPT_Compressor}
};
StretchAudioSource::StretchAudioSource(int initialnumoutchans,
AudioFormatManager* afm,
std::array<AudioParameterBool*,9>& enab_pars) : m_afm(afm)
@ -259,6 +265,18 @@ double StretchAudioSource::getDryPlayrate() const
return m_dryplayrate;
}
void StretchAudioSource::setSpectralOrderPreset(int id)
{
if (id == m_current_spec_order_preset)
return;
if (m_cs.tryEnter())
{
m_current_spec_order_preset = id;
++m_param_change_count;
m_cs.exit();
}
}
void StretchAudioSource::getNextAudioBlock(const AudioSourceChannelInfo & bufferToFill)
{
ScopedLock locker(m_cs);