diff --git a/src/minidexed.cpp b/src/minidexed.cpp index 21e79f1..3eba164 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); @@ -270,6 +271,13 @@ void CMiniDexed::Process (bool bPlugAndPlayUpdated) m_UI.Process (); + if (m_bSavePerformance) + { + DoSavePerformance (); + + m_bSavePerformance = false; + } + if (m_bProfileEnabled) { m_GetChunkTimer.Dump (); @@ -933,6 +941,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 66beb35..7acf52f 100644 --- a/src/minidexed.h +++ b/src/minidexed.h @@ -149,6 +149,7 @@ public: std::string GetVoiceName (unsigned nTG); bool SavePerformance (void); + bool DoSavePerformance (void); private: int16_t ApplyNoteLimits (int16_t pitch, unsigned nTG); // returns < 0 to ignore note @@ -222,6 +223,8 @@ private: AudioStereoMixer* reverb_send_mixer; CSpinLock m_ReverbSpinLock; + + bool m_bSavePerformance; }; #endif