Added config property to disable FXs

pull/795/head
Javier Nonis 1 month ago
parent 6220ce7d84
commit 2aa5256c2f
  1. 7
      src/config.cpp
  2. 5
      src/config.h
  3. 18
      src/minidexed.cpp

@ -200,6 +200,8 @@ void CConfig::Load (void)
m_bProfileEnabled = m_Properties.GetNumber ("ProfileEnabled", 0) != 0;
m_bPerformanceSelectToLoad = m_Properties.GetNumber ("PerformanceSelectToLoad", 1) != 0;
m_bPerformanceSelectChannel = m_Properties.GetNumber ("PerformanceSelectChannel", 0);
m_bFXEnabled = m_Properties.GetNumber("FXEnabled", 1) != 0;
}
unsigned CConfig::GetToneGenerators (void) const
@ -722,3 +724,8 @@ unsigned CConfig::GetPerformanceSelectChannel (void) const
{
return m_bPerformanceSelectChannel;
}
bool CConfig::GetFXEnabled (void) const
{
return m_bFXEnabled;
}

@ -241,6 +241,9 @@ public:
bool GetPerformanceSelectToLoad (void) const;
unsigned GetPerformanceSelectChannel (void) const;
// Enable/Disable FXs
bool GetFXEnabled (void) const;
private:
CPropertiesFatFsFile m_Properties;
@ -355,6 +358,8 @@ private:
bool m_bProfileEnabled;
bool m_bPerformanceSelectToLoad;
unsigned m_bPerformanceSelectChannel;
bool m_bFXEnabled;
};
#endif

@ -1521,6 +1521,8 @@ void CMiniDexed::ProcessSound (void)
m_pTG[0]->getSamples (SampleBuffer[indexL], nFrames);
if (m_pConfig->GetFXEnabled())
{
m_InsertFXSpinLock[0]->Acquire();
m_InsertFX[0]->process(SampleBuffer[indexL], SampleBuffer[indexL], SampleBuffer[indexL], SampleBuffer[indexR], nFrames);
m_InsertFXSpinLock[0]->Release();
@ -1550,7 +1552,6 @@ void CMiniDexed::ProcessSound (void)
arm_add_f32(SampleBuffer[indexR], SendFXOutputBuffer[indexR], SampleBuffer[indexR], nFrames);
// END adding send fx 1
// BEGIN adding send fx 2
m_SendFX2SpinLock.Acquire ();
send_fx2_mixer->getMix(SendFXMixBuffer[indexL], SendFXMixBuffer[indexR]);
@ -1568,6 +1569,11 @@ void CMiniDexed::ProcessSound (void)
m_MasterFXSpinLock.Acquire ();
m_MasterFX->process(SampleBuffer[indexL], SampleBuffer[indexR], SampleBuffer[indexL], SampleBuffer[indexR], nFrames);
m_MasterFXSpinLock.Release ();
}
else
{
memcpy(SampleBuffer[indexR], SampleBuffer[indexR], nFrames * sizeof(float32_t));
}
// swap stereo channels if needed prior to writing back out
if (m_bChannelsSwapped)
@ -1634,7 +1640,8 @@ void CMiniDexed::ProcessSound (void)
m_pTG[i]->getSamples (m_OutputLevel[i][0], nFrames);
if (!m_bQuadDAC8Chan) {
if (!m_bQuadDAC8Chan && m_pConfig->GetFXEnabled())
{
m_InsertFXSpinLock[i]->Acquire();
m_InsertFX[i]->process(m_OutputLevel[i][0], m_OutputLevel[i][0], m_OutputLevel[i][0], m_OutputLevel[i][1], nFrames);
m_InsertFXSpinLock[i]->Release();
@ -1710,9 +1717,13 @@ void CMiniDexed::ProcessSound (void)
for (uint8_t i = 0; i < m_nToneGenerators; i++)
{
tg_mixer->doAddMix(i, m_OutputLevel[i][indexL], m_OutputLevel[i][indexR]);
if (m_pConfig->GetFXEnabled())
{
send_fx1_mixer->doAddMix(i, m_OutputLevel[i][indexL], m_OutputLevel[i][indexR]);
send_fx2_mixer->doAddMix(i, m_OutputLevel[i][indexL], m_OutputLevel[i][indexR]);
}
}
// END TG mixing
// BEGIN create SampleBuffer for holding audio data
@ -1722,6 +1733,8 @@ void CMiniDexed::ProcessSound (void)
// get the mix of all TGs
tg_mixer->getMix(SampleBuffer[indexL], SampleBuffer[indexR]);
if (m_pConfig->GetFXEnabled())
{
// BEGIN adding send fx 1
float32_t SendFXOutputBuffer[2][nFrames];
float32_t SendFXMixBuffer[2][nFrames];
@ -1765,6 +1778,7 @@ void CMiniDexed::ProcessSound (void)
m_MasterFXSpinLock.Acquire ();
m_MasterFX->process(SampleBuffer[indexL], SampleBuffer[indexR], SampleBuffer[indexL], SampleBuffer[indexR], nFrames);
m_MasterFXSpinLock.Release ();
}
// swap stereo channels if needed prior to writing back out
if (m_bChannelsSwapped)

Loading…
Cancel
Save