1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-09 21:22:05 +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

@@ -75,6 +75,8 @@ static int DeviceToolbarPrefsID()
DeviceToolBar::DeviceToolBar()
: ToolBar(DeviceBarID, _("Device"), wxT("Device"), true)
{
wxTheApp->Bind( EVT_RESCANNED_DEVICES,
&DeviceToolBar::OnRescannedDevices, this );
}
DeviceToolBar::~DeviceToolBar()
@@ -628,6 +630,13 @@ void DeviceToolBar::FillHostDevices()
// The setting of the Device is left up to OnChoice
}
void DeviceToolBar::OnRescannedDevices( wxCommandEvent &event )
{
event.Skip();
// Hosts may have disappeared or appeared so a complete repopulate is needed.
RefillCombos();
}
//return 1 if host changed, 0 otherwise.
int DeviceToolBar::ChangeHost()
{