| 713 | } |
| 714 | |
| 715 | void DeviceToolBar::ShowComboDialog(wxChoice *combo, const TranslatableString &title) |
| 716 | { |
| 717 | if (!combo || combo->GetCount() == 0) { |
| 718 | AudacityMessageBox( XO("Device information is not available.") ); |
| 719 | return; |
| 720 | } |
| 721 | |
| 722 | #if USE_PORTMIXER |
| 723 | wxArrayStringEx inputSources = combo->GetStrings(); |
| 724 | |
| 725 | wxDialogWrapper dlg(nullptr, wxID_ANY, title); |
| 726 | dlg.SetName(); |
| 727 | ShuttleGui S(&dlg, eIsCreating); |
| 728 | wxChoice *c; |
| 729 | |
| 730 | S.StartVerticalLay(true); |
| 731 | { |
| 732 | S.StartHorizontalLay(wxCENTER, false); |
| 733 | { |
| 734 | c = S.AddChoice( Verbatim( combo->GetName() ), |
| 735 | transform_container<TranslatableStrings>( inputSources, Verbatim ), |
| 736 | combo->GetSelection()); |
| 737 | c->SetMinSize(c->GetBestSize()); |
| 738 | } |
| 739 | S.EndHorizontalLay(); |
| 740 | } |
| 741 | S.EndVerticalLay(); |
| 742 | S.AddStandardButtons(); |
| 743 | |
| 744 | dlg.GetSizer()->SetSizeHints(&dlg); |
| 745 | dlg.Center(); |
| 746 | |
| 747 | if (dlg.ShowModal() == wxID_OK) |
| 748 | { |
| 749 | wxCommandEvent dummyEvent; |
| 750 | dummyEvent.SetEventObject(combo); |
| 751 | // SetSelection() doesn't send an event, so we call OnChoice explicitly |
| 752 | combo->SetSelection(c->GetSelection()); |
| 753 | OnChoice(dummyEvent); |
| 754 | } |
| 755 | #endif |
| 756 | } |
| 757 | |
| 758 | static RegisteredToolbarFactory factory{ |
| 759 | []( AudacityProject &project ){ |
nothing calls this directly
no test coverage detected