From da33daf1970f5633126515e9acbebcab013caa48 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Tue, 12 Feb 2019 14:00:23 -0500 Subject: [PATCH] Some replacements of wxArrayString with auto --- include/audacity/EffectAutomationParameters.h | 2 +- src/BatchCommands.cpp | 6 +++--- src/BatchProcessDialog.cpp | 2 +- src/ModuleManager.cpp | 2 +- src/PluginManager.cpp | 4 ++-- src/Project.cpp | 2 +- src/Tags.cpp | 2 +- src/effects/Effect.cpp | 4 ++-- src/effects/nyquist/LoadNyquist.cpp | 4 ++-- src/effects/nyquist/Nyquist.cpp | 6 +++--- src/export/Export.cpp | 4 ++-- src/export/ExportPCM.cpp | 2 +- src/menus/PluginMenus.cpp | 2 +- src/prefs/DirectoriesPrefs.cpp | 2 +- src/toolbars/DeviceToolBar.cpp | 2 +- .../playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp | 4 ++-- 16 files changed, 25 insertions(+), 25 deletions(-) diff --git a/include/audacity/EffectAutomationParameters.h b/include/audacity/EffectAutomationParameters.h index f21736103..7a43ace0a 100644 --- a/include/audacity/EffectAutomationParameters.h +++ b/include/audacity/EffectAutomationParameters.h @@ -288,7 +288,7 @@ public: { wxFileConfig::SetPath(wxT("/")); - wxArrayString parsed = wxCmdLineParser::ConvertStringToArgs(parms); + auto parsed = wxCmdLineParser::ConvertStringToArgs(parms); for (size_t i = 0, cnt = parsed.size(); i < cnt; i++) { diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index c00551a83..dec8cb2e1 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -93,8 +93,8 @@ MacroCommands::MacroCommands() mMessage = ""; ResetMacro(); - wxArrayString names = GetNames(); - wxArrayString defaults = GetNamesOfDefaultMacros(); + auto names = GetNames(); + auto defaults = GetNamesOfDefaultMacros(); for( size_t i = 0;iGetTopItem(); diff --git a/src/ModuleManager.cpp b/src/ModuleManager.cpp index 919ed9a22..81e83fd3b 100755 --- a/src/ModuleManager.cpp +++ b/src/ModuleManager.cpp @@ -514,7 +514,7 @@ void ModuleManager::FindAllPlugins(PluginIDList & providers, wxArrayString & pat if (!module) continue; - wxArrayString newpaths = module->FindPluginPaths(pm); + auto newpaths = module->FindPluginPaths(pm); for (size_t j = 0, cntPaths = newpaths.size(); j < cntPaths; j++) { providers.push_back(providerID); diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index dd38b98d1..ae36df97b 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -2328,7 +2328,7 @@ void PluginManager::SaveGroup(wxFileConfig *pRegistry, PluginType type) { pRegistry->Write(KEY_IMPORTERIDENT, plug.GetImporterIdentifier()); pRegistry->Write(KEY_IMPORTERFILTER, plug.GetImporterFilterDescription()); - const wxArrayString & extensions = plug.GetImporterExtensions(); + const auto & extensions = plug.GetImporterExtensions(); wxString strExt; for (size_t i = 0, cnt = extensions.size(); i < cnt; i++) { @@ -2407,7 +2407,7 @@ void PluginManager::CheckForUpdates(bool bFast) else { // Collect plugin paths - wxArrayString paths = mm.FindPluginsForProvider(plugID, plugPath); + auto paths = mm.FindPluginsForProvider(plugID, plugPath); for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { wxString path = paths[i].BeforeFirst(wxT(';'));; diff --git a/src/Project.cpp b/src/Project.cpp index 33636dd66..57fffe277 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -2879,7 +2879,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj) * and save dialogues, for the option that only shows project files created * with Audacity. Do not include pipe symbols or .aup (this extension will * now be added automatically for the Save Projects dialogues).*/ - wxArrayString selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup")); + auto selectedFiles = ShowOpenDialog(_("Audacity projects"), wxT("*.aup")); if (selectedFiles.size() == 0) { gPrefs->Write(wxT("/LastOpenType"),wxT("")); gPrefs->Flush(); diff --git a/src/Tags.cpp b/src/Tags.cpp index 4d636c42c..cc1ea3130 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -868,7 +868,7 @@ void TagsEditor::PopulateOrExchange(ShuttleGui & S) mGrid->SetColLabelSize(mGrid->GetDefaultRowSize()); - wxArrayString cs(names()); + auto cs = names(); // Build the initial (empty) grid mGrid->CreateGrid(0, 2); diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index 2d65cd1e8..1454cfc02 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -1038,7 +1038,7 @@ bool Effect::SetAutomationParameters(const wxString & parms) else if (preset.StartsWith(kFactoryPresetIdent)) { preset.Replace(kFactoryPresetIdent, wxEmptyString, false); - wxArrayString presets = GetFactoryPresets(); + auto presets = GetFactoryPresets(); success = LoadFactoryPreset( make_iterator_range( presets ).index( preset ) ); } else if (preset.StartsWith(kCurrentSettingsIdent)) @@ -3376,7 +3376,7 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt)) menu.AppendSeparator(); - wxArrayString factory = mEffect->GetFactoryPresets(); + auto factory = mEffect->GetFactoryPresets(); { auto sub = std::make_unique(); diff --git a/src/effects/nyquist/LoadNyquist.cpp b/src/effects/nyquist/LoadNyquist.cpp index aa85cf70f..45c16bc78 100644 --- a/src/effects/nyquist/LoadNyquist.cpp +++ b/src/effects/nyquist/LoadNyquist.cpp @@ -128,7 +128,7 @@ wxString NyquistEffectsModule::GetDescription() bool NyquistEffectsModule::Initialize() { - wxArrayString audacityPathList = wxGetApp().audacityPathList; + auto audacityPathList = wxGetApp().audacityPathList; for (size_t i = 0, cnt = audacityPathList.size(); i < cnt; i++) { @@ -203,7 +203,7 @@ bool NyquistEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm) wxArrayString NyquistEffectsModule::FindPluginPaths(PluginManagerInterface & pm) { - wxArrayString pathList = NyquistEffect::GetNyquistSearchPath(); + auto pathList = NyquistEffect::GetNyquistSearchPath(); wxArrayString files; // Add the Nyquist prompt diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 8c9ce9afe..ec51b90ce 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -235,7 +235,7 @@ wxString NyquistEffect::ManualPage() wxString NyquistEffect::HelpPage() { - wxArrayString paths = NyquistEffect::GetNyquistSearchPath(); + auto paths = NyquistEffect::GetNyquistSearchPath(); wxString fileName; for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { @@ -662,7 +662,7 @@ bool NyquistEffect::Process() mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'DOCUMENTS)\n"), EscapeString(wxStandardPaths::Get().GetDocumentsDir())); mProps += wxString::Format(wxT("(putprop '*SYSTEM-DIR* \"%s\" 'HOME)\n"), EscapeString(wxGetHomeDir())); - wxArrayString paths = NyquistEffect::GetNyquistSearchPath(); + auto paths = NyquistEffect::GetNyquistSearchPath(); wxString list; for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { @@ -2343,7 +2343,7 @@ void NyquistEffect::OSCallback() wxArrayString NyquistEffect::GetNyquistSearchPath() { - wxArrayString audacityPathList = wxGetApp().audacityPathList; + auto audacityPathList = wxGetApp().audacityPathList; wxArrayString pathList; for (size_t i = 0; i < audacityPathList.size(); i++) diff --git a/src/export/Export.cpp b/src/export/Export.cpp index a5c6ced54..b50e9d293 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -178,7 +178,7 @@ wxString ExportPlugin::GetMask(int index) // Build the mask // wxString ext = GetExtension(index); - wxArrayString exts = GetExtensions(index); + auto exts = GetExtensions(index); for (size_t i = 0; i < exts.size(); i++) { mask += wxT("*.") + exts[i] + wxT(";"); } @@ -202,7 +202,7 @@ bool ExportPlugin::IsExtension(const wxString & ext, int index) for (int i = index; i < GetFormatCount(); i = GetFormatCount()) { wxString defext = GetExtension(i); - wxArrayString defexts = GetExtensions(i); + auto defexts = GetExtensions(i); int indofext = defexts.Index(ext, false); if (defext == wxT("") || (indofext != wxNOT_FOUND)) isext = true; diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 6d13c75e9..4418a8969 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -384,7 +384,7 @@ ExportPCM::ExportPCM() SetFormat(wxT("LIBSNDFILE"), format); SetCanMetaData(true, format); SetDescription(_("Other uncompressed files"), format); - wxArrayString allext = sf_get_all_extensions(); + auto allext = sf_get_all_extensions(); wxString wavext = sf_header_extension(SF_FORMAT_WAV); // get WAV ext. #if defined(wxMSW) // On Windows make sure WAV is at the beginning of the list of all possible diff --git a/src/menus/PluginMenus.cpp b/src/menus/PluginMenus.cpp index a28201f7f..ac0eb6c38 100644 --- a/src/menus/PluginMenus.cpp +++ b/src/menus/PluginMenus.cpp @@ -824,7 +824,7 @@ void AddEffectMenuItemGroup( MenuTable::BaseItemPtrs PopulateMacrosMenu( CommandFlag flags ) { MenuTable::BaseItemPtrs result; - wxArrayString names = MacroCommands::GetNames(); + auto names = MacroCommands::GetNames(); int i; for (i = 0; i < (int)names.size(); i++) { diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index e0eb5c550..ce0346061 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -162,7 +162,7 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e) #else newDirName = wxT(".audacity_temp"); #endif - wxArrayString dirsInPath = tmpDirPath.GetDirs(); + auto dirsInPath = tmpDirPath.GetDirs(); // If the default temp dir or user's pref dir don't end in '/' they cause // wxFileName's == operator to construct a wxFileName representing a file diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index 9fb1e19aa..1d5c8f581 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -810,7 +810,7 @@ void DeviceToolBar::ShowComboDialog(wxChoice *combo, const wxString &title) } #if USE_PORTMIXER - wxArrayString inputSources = combo->GetStrings(); + auto inputSources = combo->GetStrings(); wxDialogWrapper dlg(nullptr, wxID_ANY, title); dlg.SetName(dlg.GetTitle()); diff --git a/src/tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp b/src/tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp index bd7c57709..3a9bba536 100644 --- a/src/tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp +++ b/src/tracks/playabletrack/wavetrack/ui/WaveTrackVZoomHandle.cpp @@ -451,7 +451,7 @@ BEGIN_POPUP_MENU(WaveformVRulerMenuTable) #if 0 POPUP_MENU_SEPARATOR() { - const wxArrayString & names = WaveformSettings::GetScaleNames(); + const auto & names = WaveformSettings::GetScaleNames(); for (int ii = 0, nn = names.size(); ii < nn; ++ii) { POPUP_MENU_RADIO_ITEM(OnFirstWaveformScaleID + ii, names[ii], OnWaveformScaleType); @@ -520,7 +520,7 @@ void SpectrumVRulerMenuTable::InitMenu(Menu *pMenu, void *pUserData) BEGIN_POPUP_MENU(SpectrumVRulerMenuTable) { - const wxArrayString & names = SpectrogramSettings::GetScaleNames(); + const auto & names = SpectrogramSettings::GetScaleNames(); for (int ii = 0, nn = names.size(); ii < nn; ++ii) { POPUP_MENU_RADIO_ITEM(OnFirstSpectrumScaleID + ii, names[ii], OnSpectrumScaleType);