From c30a9c0dc65290bbda4eb68a641e6c232d452299 Mon Sep 17 00:00:00 2001 From: Holger Wirtz Date: Sun, 22 May 2022 14:11:01 +0200 Subject: [PATCH] Merge. --- src/minidexed.cpp | 17 ++++++++++++++++- src/minidexed.h | 3 +++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index d331792..5e685e2 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -49,7 +49,8 @@ CMiniDexed::CMiniDexed (CConfig *pConfig, CInterruptSystem *pInterrupt, #endif m_GetChunkTimer ("GetChunk", 1000000U * pConfig->GetChunkSize ()/2 / pConfig->GetSampleRate ()), - m_bProfileEnabled (m_pConfig->GetProfileEnabled ()) + m_bProfileEnabled (m_pConfig->GetProfileEnabled ()), + m_bSavePerformance (false) { assert (m_pConfig); @@ -272,6 +273,13 @@ void CMiniDexed::Process (bool bPlugAndPlayUpdated) m_UI.Process (); + if (m_bSavePerformance) + { + DoSavePerformance (); + + m_bSavePerformance = false; + } + if (m_bProfileEnabled) { m_GetChunkTimer.Dump (); @@ -950,6 +958,13 @@ void CMiniDexed::ProcessSound (void) #endif bool CMiniDexed::SavePerformance (void) +{ + m_bSavePerformance = true; + + return true; +} + +bool CMiniDexed::DoSavePerformance (void) { for (unsigned nTG = 0; nTG < CConfig::ToneGenerators; nTG++) { diff --git a/src/minidexed.h b/src/minidexed.h index 14a1023..6223e5f 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -151,6 +151,7 @@ public: bool SavePerformance (void); void setMasterVolume (float32_t vol); + bool DoSavePerformance (void); private: int16_t ApplyNoteLimits (int16_t pitch, unsigned nTG); // returns < 0 to ignore note @@ -226,6 +227,8 @@ private: AudioStereoMixer* reverb_send_mixer; CSpinLock m_ReverbSpinLock; + + bool m_bSavePerformance; }; #endif