Some replacements of wxArrayString with auto
This commit is contained in:
parent
e46990f709
commit
da33daf197
|
@ -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++)
|
||||
{
|
||||
|
|
|
@ -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;i<defaults.size();i++){
|
||||
wxString name = defaults[i];
|
||||
|
@ -1004,7 +1004,7 @@ wxArrayString MacroCommands::GetNames()
|
|||
|
||||
bool MacroCommands::IsFixed(const wxString & name)
|
||||
{
|
||||
wxArrayString defaults = GetNamesOfDefaultMacros();
|
||||
auto defaults = GetNamesOfDefaultMacros();
|
||||
if( make_iterator_range( defaults ).contains( name ) )
|
||||
return true;
|
||||
return false;
|
||||
|
|
|
@ -170,7 +170,7 @@ void ApplyMacroDialog::PopulateOrExchange(ShuttleGui &S)
|
|||
/// a shared function.
|
||||
void ApplyMacroDialog::PopulateMacros()
|
||||
{
|
||||
wxArrayString names = mMacroCommands.GetNames();
|
||||
auto names = mMacroCommands.GetNames();
|
||||
int i;
|
||||
|
||||
int topItem = mMacros->GetTopItem();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(';'));;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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<wxMenu>();
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++)
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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++) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue