1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-23 17:30:17 +01:00

Send event, so that DeviceManager does not depend on DeviceToolBar...

... freeing it and DevicePrefs from cycles
This commit is contained in:
Paul Licameli
2019-06-04 16:20:39 -04:00
parent ccc49f8ccf
commit 7ef5ebc97a
4 changed files with 22 additions and 7 deletions

View File

@@ -38,7 +38,8 @@
#include "AudioIOBase.h"
#include "DeviceChange.h" // for HAVE_DEVICE_CHANGE
#include "toolbars/DeviceToolBar.h"
wxDEFINE_EVENT(EVT_RESCANNED_DEVICES, wxCommandEvent);
DeviceManager DeviceManager::dm;
@@ -299,13 +300,11 @@ void DeviceManager::Rescan()
}
// If this was not an initial scan update each device toolbar.
// Hosts may have disappeared or appeared so a complete repopulate is needed.
if (m_inited) {
for ( auto pProject : AllProjects{} ) {
auto &dt = DeviceToolBar::Get( *pProject );
dt.RefillCombos();
}
if ( m_inited ) {
wxCommandEvent e{ EVT_RESCANNED_DEVICES };
wxTheApp->ProcessEvent( e );
}
m_inited = true;
mRescanTime = std::chrono::steady_clock::now();
}