Fix Save Performance (#238)

Closes #151
Thanks @rsta2
pull/228/head
probonopd 3 years ago committed by GitHub
parent 85a4d9953b
commit 2f044b6fcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/minidexed.cpp
  2. 3
      src/minidexed.h

@ -49,7 +49,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt,
#endif #endif
m_GetChunkTimer ("GetChunk", m_GetChunkTimer ("GetChunk",
1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()), 1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()),
m_bProfileEnabled (m_pConfig->GetProfileEnabled ()) m_bProfileEnabled (m_pConfig->GetProfileEnabled ()),
m_bSavePerformance (false)
{ {
assert (m_pConfig); assert (m_pConfig);
@ -270,6 +271,13 @@ void CMiniDexed::Process (bool bPlugAndPlayUpdated)
m_UI.Process (); m_UI.Process ();
if (m_bSavePerformance)
{
DoSavePerformance ();
m_bSavePerformance = false;
}
if (m_bProfileEnabled) if (m_bProfileEnabled)
{ {
m_GetChunkTimer.Dump (); m_GetChunkTimer.Dump ();
@ -933,6 +941,13 @@ void CMiniDexed::ProcessSound (void)
#endif #endif
bool CMiniDexed::SavePerformance (void) bool CMiniDexed::SavePerformance (void)
{
m_bSavePerformance = true;
return true;
}
bool CMiniDexed::DoSavePerformance (void)
{ {
for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++) for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++)
{ {

@ -149,6 +149,7 @@ public:
std::string GetVoiceName (unsigned nTG); std::string GetVoiceName (unsigned nTG);
bool SavePerformance (void); bool SavePerformance (void);
bool DoSavePerformance (void);
private: private:
int16_t ApplyNoteLimits (int16_t pitch, unsigned nTG); // returns < 0 to ignore note int16_t ApplyNoteLimits (int16_t pitch, unsigned nTG); // returns < 0 to ignore note
@ -222,6 +223,8 @@ private:
AudioStereoMixer<CConfig::ToneGenerators>* reverb_send_mixer; AudioStereoMixer<CConfig::ToneGenerators>* reverb_send_mixer;
CSpinLock m_ReverbSpinLock; CSpinLock m_ReverbSpinLock;
bool m_bSavePerformance;
}; };
#endif #endif

Loading…
Cancel
Save