From 2db49dc1f050cd40354ae8d26b3ca53e63c16ee6 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Mon, 11 Feb 2019 19:10:48 -0500 Subject: [PATCH] Use standard library style members of wxArrayString (and wxString) ... ... which will make it easier to change the types of those containers to std::vectors of other string-like classes for wxString, IsEmpty => empty Clear => clear Alloc => reserve for wxArrayString, Count => size GetCount => size IsEmpty => empty Add => push_back Clear => clear Empty => clear Sort => std::sort (only with default comparator) SetCount => resize Last => back Item => operator [] Alloc => reserve --- include/audacity/EffectAutomationParameters.h | 2 +- src/AudacityApp.cpp | 42 ++++---- src/AudacityException.cpp | 2 +- src/AudacityLogger.cpp | 2 +- src/AudioIO.cpp | 14 +-- src/AutoRecovery.cpp | 4 +- src/BatchCommandDialog.cpp | 6 +- src/BatchCommands.cpp | 44 ++++---- src/BatchProcessDialog.cpp | 8 +- src/Benchmark.cpp | 2 +- src/DirManager.cpp | 38 +++---- src/FFmpeg.cpp | 12 +-- src/FileFormats.cpp | 2 +- src/FileNames.cpp | 4 +- src/FreqWindow.cpp | 2 +- src/HelpText.cpp | 2 +- src/Internat.cpp | 6 +- src/LabelDialog.cpp | 12 +-- src/Languages.cpp | 26 ++--- src/Menus.cpp | 2 +- src/MixerBoard.cpp | 16 +-- src/ModuleManager.cpp | 10 +- src/PlatformCompatibility.cpp | 2 +- src/PluginManager.cpp | 66 ++++++------ src/Prefs.cpp | 2 +- src/Project.cpp | 34 +++--- src/Sequence.cpp | 2 +- src/Shuttle.cpp | 6 +- src/ShuttleGui.cpp | 22 ++-- src/Tags.cpp | 26 ++--- src/Theme.cpp | 4 +- src/TimerRecordDialog.cpp | 12 +-- src/TrackArtist.cpp | 2 +- src/TrackPanelAx.cpp | 8 +- src/UndoManager.cpp | 2 +- src/commands/AudacityCommand.cpp | 2 +- src/commands/BatchEvalCommand.cpp | 2 +- src/commands/CommandBuilder.cpp | 2 +- src/commands/CommandManager.cpp | 42 ++++---- src/commands/CommandTargets.cpp | 14 +-- src/commands/GetInfoCommand.cpp | 10 +- src/commands/HelpCommand.cpp | 2 +- src/commands/LoadCommands.cpp | 6 +- src/commands/OpenSaveCommands.cpp | 4 +- src/commands/ScreenshotCommand.cpp | 4 +- src/commands/Validators.h | 4 +- src/effects/ChangePitch.cpp | 2 +- src/effects/ChangeSpeed.cpp | 4 +- src/effects/Distortion.cpp | 2 +- src/effects/Effect.cpp | 44 ++++---- src/effects/EffectManager.cpp | 16 +-- src/effects/Equalization.cpp | 12 +-- src/effects/Equalization48x.cpp | 2 +- src/effects/LoadEffects.cpp | 6 +- src/effects/NoiseReduction.cpp | 4 +- src/effects/Reverb.cpp | 6 +- src/effects/ScienFilter.cpp | 2 +- src/effects/VST/VSTEffect.cpp | 38 +++---- src/effects/audiounits/AudioUnitEffect.cpp | 22 ++-- src/effects/ladspa/LadspaEffect.cpp | 18 ++-- src/effects/lv2/LV2Effect.cpp | 28 ++--- src/effects/lv2/LoadLV2.cpp | 4 +- src/effects/nyquist/LoadNyquist.cpp | 10 +- src/effects/nyquist/Nyquist.cpp | 36 +++---- src/effects/vamp/LoadVamp.cpp | 2 +- src/effects/vamp/VampEffect.cpp | 14 +-- src/export/Export.cpp | 20 ++-- src/export/ExportCL.cpp | 8 +- src/export/ExportFFmpeg.cpp | 4 +- src/export/ExportFFmpegDialogs.cpp | 100 +++++++++--------- src/export/ExportMP2.cpp | 2 +- src/export/ExportMP3.cpp | 18 ++-- src/export/ExportMultiple.cpp | 22 ++-- src/export/ExportPCM.cpp | 8 +- src/import/Import.cpp | 40 +++---- src/import/ImportFFmpeg.cpp | 2 +- src/import/ImportFLAC.cpp | 4 +- src/import/ImportGStreamer.cpp | 10 +- src/import/ImportMP3.cpp | 2 +- src/import/ImportOGG.cpp | 2 +- src/import/ImportPCM.cpp | 2 +- src/import/ImportQT.cpp | 2 +- src/import/ImportRaw.cpp | 4 +- src/menus/FileMenus.cpp | 8 +- src/menus/HelpMenus.cpp | 4 +- src/menus/PluginMenus.cpp | 46 ++++---- src/ondemand/ODDecodeFlacTask.cpp | 2 +- src/prefs/DevicePrefs.cpp | 10 +- src/prefs/DirectoriesPrefs.cpp | 4 +- src/prefs/ExtImportPrefs.cpp | 22 ++-- src/prefs/KeyConfigPrefs.cpp | 8 +- src/prefs/MidiIOPrefs.cpp | 22 ++-- src/prefs/ModulePrefs.cpp | 14 +-- src/prefs/QualityPrefs.cpp | 6 +- src/prefs/SpectrumPrefs.cpp | 30 +++--- src/prefs/TracksBehaviorsPrefs.cpp | 12 +-- src/prefs/WaveformSettings.cpp | 4 +- src/toolbars/ControlToolBar.cpp | 10 +- src/toolbars/DeviceToolBar.cpp | 6 +- src/toolbars/SelectionBar.cpp | 2 +- .../labeltrack/ui/LabelTrackControls.cpp | 2 +- src/widgets/AButton.cpp | 10 +- src/widgets/ASlider.cpp | 12 +-- src/widgets/FileHistory.cpp | 30 +++--- src/widgets/Grid.cpp | 18 ++-- src/widgets/HelpSystem.cpp | 8 +- src/widgets/HtmlWindow.cpp | 10 +- src/widgets/KeyView.cpp | 42 ++++---- src/widgets/Meter.cpp | 12 +-- src/widgets/NumericTextCtrl.cpp | 10 +- src/widgets/ProgressDialog.cpp | 4 +- src/widgets/Ruler.cpp | 6 +- src/widgets/numformatter.cpp | 2 +- src/xml/XMLTagHandler.cpp | 14 +-- src/xml/XMLWriter.cpp | 6 +- 115 files changed, 728 insertions(+), 728 deletions(-) diff --git a/include/audacity/EffectAutomationParameters.h b/include/audacity/EffectAutomationParameters.h index 54fb3ecca..f21736103 100644 --- a/include/audacity/EffectAutomationParameters.h +++ b/include/audacity/EffectAutomationParameters.h @@ -290,7 +290,7 @@ public: wxArrayString parsed = wxCmdLineParser::ConvertStringToArgs(parms); - for (size_t i = 0, cnt = parsed.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = parsed.size(); i < cnt; i++) { wxString key = parsed[i].BeforeFirst(wxT('=')).Trim(false).Trim(true); wxString val = parsed[i].AfterFirst(wxT('=')).Trim(false).Trim(true); diff --git a/src/AudacityApp.cpp b/src/AudacityApp.cpp index 1542d0a11..cfe91e641 100644 --- a/src/AudacityApp.cpp +++ b/src/AudacityApp.cpp @@ -282,7 +282,7 @@ void QuitAudacity(bool bForce) // BG: unless force is true // BG: Are there any projects open? - //- if (!gAudacityProjects.IsEmpty()) + //- if (!gAudacityProjects.empty()) /*start+*/ if (gAudacityProjects.empty()) { @@ -622,7 +622,7 @@ public: { // Add the filename to the queue. It will be opened by // the OnTimer() event when it is safe to do so. - ofqueue.Add(data); + ofqueue.push_back(data); return true; } @@ -696,13 +696,13 @@ IMPLEMENT_APP(AudacityApp) // in response of an open-document apple event void AudacityApp::MacOpenFile(const wxString &fileName) { - ofqueue.Add(fileName); + ofqueue.push_back(fileName); } // in response of a print-document apple event void AudacityApp::MacPrintFile(const wxString &fileName) { - ofqueue.Add(fileName); + ofqueue.push_back(fileName); } // in response of a open-application apple event @@ -771,7 +771,7 @@ bool AudacityApp::MRUOpen(const wxString &fullPathStr) { AudacityProject *proj = GetActiveProject(); - if (!fullPathStr.IsEmpty()) + if (!fullPathStr.empty()) { // verify that the file exists if (wxFile::Exists(fullPathStr)) @@ -847,15 +847,15 @@ void AudacityApp::OnTimer(wxTimerEvent& WXUNUSED(event)) // AppleEvent messages (via wxWidgets). So, open any that are // in the queue and clean the queue. if (gInited) { - if (ofqueue.GetCount()) { + if (ofqueue.size()) { // Load each file on the queue - while (ofqueue.GetCount()) { + while (ofqueue.size()) { wxString name; name.swap(ofqueue[0]); ofqueue.RemoveAt(0); // Get the user's attention if no file name was specified - if (name.IsEmpty()) { + if (name.empty()) { // Get the users attention AudacityProject *project = GetActiveProject(); if (project) { @@ -1021,7 +1021,7 @@ wxString AudacityApp::InitLang( const wxString & lang ) } mLocale = std::make_unique(info->Language); - for(unsigned int i=0; iAddCatalogLookupPathPrefix(audacityPathList[i]); // LL: Must add the wxWidgets catalog manually since the search @@ -1703,7 +1703,7 @@ void AudacityApp::OnKeyDown(wxKeyEvent &event) // We now disallow temp directory name that puts it where cleaner apps will // try to clean out the files. bool AudacityApp::IsTempDirectoryNameOK( const wxString & Name ){ - if( Name.IsEmpty() ) + if( Name.empty() ) return false; wxFileName tmpFile; @@ -1734,7 +1734,7 @@ bool AudacityApp::IsTempDirectoryNameOK( const wxString & Name ){ // result is unchanged if unsuccessful. void SetToExtantDirectory( wxString & result, const wxString & dir ){ // don't allow path of "". - if( dir.IsEmpty() ) + if( dir.empty() ) return; if( wxDirExists( dir ) ){ result = dir; @@ -1876,7 +1876,7 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir) { wxFileName filename(parser->GetParam(i)); if (filename.MakeAbsolute()) - filenames.Add(filename.GetLongPath()); + filenames.push_back(filename.GetLongPath()); } #if defined(__WXMSW__) @@ -1894,9 +1894,9 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir) if (conn) { bool ok = false; - if (filenames.GetCount() > 0) + if (filenames.size() > 0) { - for (size_t i = 0, cnt = filenames.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = filenames.size(); i < cnt; i++) { ok = conn->Execute(filenames[i]); } @@ -1935,9 +1935,9 @@ bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir) sock->Connect(addr, true); if (sock->IsConnected()) { - if (filenames.GetCount() > 0) + if (filenames.size() > 0) { - for (size_t i = 0, cnt = filenames.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = filenames.size(); i < cnt; i++) { const wxString param = filenames[i]; sock->WriteMsg((const wxChar *) param, (param.Len() + 1) * sizeof(wxChar)); @@ -2028,7 +2028,7 @@ void AudacityApp::OnSocketEvent(wxSocketEvent & evt) { // Add the filename to the queue. It will be opened by // the OnTimer() event when it is safe to do so. - ofqueue.Add(name); + ofqueue.push_back(name); } } @@ -2082,12 +2082,12 @@ void AudacityApp::AddUniquePathToPathList(const wxString &pathArg, pathNorm.Normalize(); const wxString newpath{ pathNorm.GetFullPath() }; - for(unsigned int i=0; i AudioIO::GetSupportedSampleRates(int playDevice, int recDevice result.push_back(playback[i]); // If this yields no results, use the default sample rates nevertheless -/* if (result.IsEmpty()) +/* if (result.empty()) { for (i = 0; i < NumStandardRates; i++) - result.Add(StandardRates[i]); + result.push_back(StandardRates[i]); }*/ return result; @@ -3286,7 +3286,7 @@ int AudioIO::getPlayDevIndex(const wxString &devNameArg) { wxString devName(devNameArg); // if we don't get given a device, look up the preferences - if (devName.IsEmpty()) + if (devName.empty()) { devName = gPrefs->Read(wxT("/AudioIO/PlaybackDevice"), wxT("")); } @@ -3343,7 +3343,7 @@ int AudioIO::getRecordDevIndex(const wxString &devNameArg) { wxString devName(devNameArg); // if we don't get given a device, look up the preferences - if (devName.IsEmpty()) + if (devName.empty()) { devName = gPrefs->Read(wxT("/AudioIO/RecordingDevice"), wxT("")); } diff --git a/src/AutoRecovery.cpp b/src/AutoRecovery.cpp index 1a071f941..b20a8ff0a 100644 --- a/src/AutoRecovery.cpp +++ b/src/AutoRecovery.cpp @@ -177,7 +177,7 @@ static bool RemoveAllAutoSaveFiles() wxDir::GetAllFiles(FileNames::AutoSaveDir(), &files, wxT("*.autosave"), wxDIR_FILES); - for (unsigned int i = 0; i < files.GetCount(); i++) + for (unsigned int i = 0; i < files.size(); i++) { if (!wxRemoveFile(files[i])) { @@ -209,7 +209,7 @@ static bool RecoverAllProjects(AudacityProject** pproj) wxDir::GetAllFiles(FileNames::AutoSaveDir(), &files, wxT("*.autosave"), wxDIR_FILES); - for (unsigned int i = 0; i < files.GetCount(); i++) + for (unsigned int i = 0; i < files.size(); i++) { AudacityProject* proj{}; if (*pproj) diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index 3818ddd24..c6ccb89d6 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -174,7 +174,7 @@ void MacroCommandDialog::OnItemSelected(wxListEvent &event) // If ID is empty, then the effect wasn't found, in which case, the user must have // selected one of the "special" commands. - mEditParams->Enable(!ID.IsEmpty()); + mEditParams->Enable(!ID.empty()); mUsePreset->Enable(em.HasPresets(ID)); if ( command.name.Translated() == mCommand->GetValue() ) @@ -185,7 +185,7 @@ void MacroCommandDialog::OnItemSelected(wxListEvent &event) mInternalCommandName = command.name.Internal(); wxString params = MacroCommands::GetCurrentParamsFor(mInternalCommandName); - if (params.IsEmpty()) + if (params.empty()) { params = em.GetDefaultPreset(ID); } @@ -240,7 +240,7 @@ void MacroCommandDialog::SetCommandAndParams(const wxString &Command, const wxSt // If ID is empty, then the effect wasn't found, in which case, the user must have // selected one of the "special" commands. - mEditParams->Enable(!ID.IsEmpty()); + mEditParams->Enable(!ID.empty()); mUsePreset->Enable(em.HasPresets(ID)); } } diff --git a/src/BatchCommands.cpp b/src/BatchCommands.cpp index 3e6a5b961..d1b04aad6 100644 --- a/src/BatchCommands.cpp +++ b/src/BatchCommands.cpp @@ -96,7 +96,7 @@ MacroCommands::MacroCommands() wxArrayString names = GetNames(); wxArrayString defaults = GetNamesOfDefaultMacros(); - for( size_t i = 0;i= (int)mCommandMacro.GetCount()) { + if (index < 0 || index >= (int)mCommandMacro.size()) { return wxT(""); } @@ -152,7 +152,7 @@ wxString MacroCommands::GetCommand(int index) wxString MacroCommands::GetParams(int index) { - if (index < 0 || index >= (int)mParamsMacro.GetCount()) { + if (index < 0 || index >= (int)mParamsMacro.size()) { return wxT(""); } @@ -161,7 +161,7 @@ wxString MacroCommands::GetParams(int index) int MacroCommands::GetCount() { - return (int)mCommandMacro.GetCount(); + return (int)mCommandMacro.size(); } bool MacroCommands::ReadMacro(const wxString & macro) @@ -198,8 +198,8 @@ bool MacroCommands::ReadMacro(const wxString & macro) wxString parm = tf[i].Mid(splitAt + 1).Strip(wxString::trailing); // Add to lists - mCommandMacro.Add(cmd); - mParamsMacro.Add(parm); + mCommandMacro.push_back(cmd); + mParamsMacro.push_back(parm); } } @@ -235,7 +235,7 @@ bool MacroCommands::WriteMacro(const wxString & macro) tf.Clear(); // Copy over the commands - int lines = mCommandMacro.GetCount(); + int lines = mCommandMacro.size(); for (int i = 0; i < lines; i++) { tf.AddLine(mCommandMacro[i] + wxT(":") + mParamsMacro[ i ]); } @@ -309,7 +309,7 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) while (plug) { auto command = em.GetCommandIdentifier(plug->GetID()); - if (!command.IsEmpty()) + if (!command.empty()) commands.push_back( { { command, plug->GetSymbol().Translation() }, plug->GetPluginType() == PluginTypeEffect ? @@ -323,14 +323,14 @@ MacroCommandsCatalog::MacroCommandsCatalog( const AudacityProject *project ) wxArrayString mLabels; wxArrayString mNames; std::vector vHasDialog; - mLabels.Clear(); - mNames.Clear(); + mLabels.clear(); + mNames.clear(); mManager->GetAllCommandLabels(mLabels, vHasDialog, true); mManager->GetAllCommandNames(mNames, true); const bool english = wxGetLocale()->GetCanonicalName().StartsWith(wxT("en")); - for(size_t i=0; iGetFileName(), extension); } else { @@ -642,7 +642,7 @@ bool MacroCommands::ApplySpecialCommand( // FIXME: TRAP_ERR No error reporting on write file failure in batch mode. if (command == wxT("NoAction")) { return true; - } else if (!mFileName.IsEmpty() && command == wxT("Import")) { + } else if (!mFileName.empty() && command == wxT("Import")) { // historically this was in use, now ignored if there return true; } else if (command == wxT("ExportMP3_56k_before")) { @@ -868,7 +868,7 @@ bool MacroCommands::ApplyMacro( // Macro was successfully applied; save the NEW project state wxString longDesc, shortDesc; wxString name = gPrefs->Read(wxT("/Batch/ActiveMacro"), wxEmptyString); - if (name.IsEmpty()) + if (name.empty()) { /* i18n-hint: active verb in past tense */ longDesc = _("Applied Macro"); @@ -902,7 +902,7 @@ void MacroCommands::AddToMacro(const wxString &command, int before) void MacroCommands::AddToMacro(const wxString &command, const wxString ¶ms, int before) { if (before == -1) { - before = (int)mCommandMacro.GetCount(); + before = (int)mCommandMacro.size(); } mCommandMacro.Insert(command, before); @@ -911,7 +911,7 @@ void MacroCommands::AddToMacro(const wxString &command, const wxString ¶ms, void MacroCommands::DeleteFromMacro(int index) { - if (index < 0 || index >= (int)mCommandMacro.GetCount()) { + if (index < 0 || index >= (int)mCommandMacro.size()) { return; } @@ -921,8 +921,8 @@ void MacroCommands::DeleteFromMacro(int index) void MacroCommands::ResetMacro() { - mCommandMacro.Clear(); - mParamsMacro.Clear(); + mCommandMacro.clear(); + mParamsMacro.clear(); } // ReportAndSkip() is a diagnostic function that avoids actually @@ -992,9 +992,9 @@ wxArrayString MacroCommands::GetNames() size_t i; wxFileName ff; - for (i = 0; i < files.GetCount(); i++) { + for (i = 0; i < files.size(); i++) { ff = (files[i]); - names.Add(ff.GetName()); + names.push_back(ff.GetName()); } std::sort( names.begin(), names.end() ); @@ -1017,7 +1017,7 @@ void MacroCommands::Split(const wxString & str, wxString & command, wxString & p command.Empty(); param.Empty(); - if (str.IsEmpty()) { + if (str.empty()) { return; } diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index cd9fc8009..c25e5e68c 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -175,7 +175,7 @@ void ApplyMacroDialog::PopulateMacros() int topItem = mMacros->GetTopItem(); mMacros->DeleteAllItems(); - for (i = 0; i < (int)names.GetCount(); i++) { + for (i = 0; i < (int)names.size(); i++) { mMacros->InsertItem(i, names[i]); } @@ -246,7 +246,7 @@ void ApplyMacroDialog::ApplyMacroToProject( const wxString & MacroID, bool bHasG void ApplyMacroDialog::ApplyMacroToProject( int iMacro, bool bHasGui ) { wxString name = mMacros->GetItemText(iMacro); - if( name.IsEmpty() ) + if( name.empty() ) return; #ifdef OPTIONAL_ACTIVITY_WINDOW @@ -420,7 +420,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) S.EndVerticalLay(); int i; - for (i = 0; i < (int)files.GetCount(); i++ ) { + for (i = 0; i < (int)files.size(); i++ ) { fileList->InsertItem(i, files[i], i == 0); } @@ -450,7 +450,7 @@ void ApplyMacroDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) Hide(); mMacroCommands.ReadMacro(name); - for (i = 0; i < (int)files.GetCount(); i++) { + for (i = 0; i < (int)files.size(); i++) { wxWindowDisabler wd(&activityWin); if (i > 0) { //Clear the arrow in previous item. diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index 54b263f76..dfda77d30 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -491,7 +491,7 @@ void BenchmarkDialog::OnRun( wxCommandEvent & WXUNUSED(event)) #if 0 Printf(_("Checking file pointer leaks:\n")); - Printf(_("Track # blocks: %d\n"), t->GetBlockArray()->Count()); + Printf(_("Track # blocks: %d\n"), t->GetBlockArray()->size()); Printf(_("Disk # blocks: \n")); system("ls .audacity_temp/* | wc --lines"); #endif diff --git a/src/DirManager.cpp b/src/DirManager.cpp index 5c31f92ae..e2612438e 100644 --- a/src/DirManager.cpp +++ b/src/DirManager.cpp @@ -177,13 +177,13 @@ static int RecursivelyEnumerate(wxString dirPath, // Don't DELETE files from a selective top level, e.g. if handed "projects*" as the // directory specifier. - if (bFiles && dirspec.IsEmpty() ){ + if (bFiles && dirspec.empty() ){ cont= dir.GetFirst(&name, filespec, wxDIR_FILES | wxDIR_HIDDEN | wxDIR_NO_FOLLOW); while ( cont ){ wxString filepath = dirPath + wxFILE_SEP_PATH + name; count++; - filePathArray.Add(filepath); + filePathArray.push_back(filepath); cont = dir.GetNext(&name); @@ -206,7 +206,7 @@ static int RecursivelyEnumerate(wxString dirPath, } if (bDirs) { - filePathArray.Add(dirPath); + filePathArray.push_back(dirPath); count++; } @@ -423,7 +423,7 @@ DirManager::~DirManager() if (numDirManagers == 0) { CleanTempDir(); //::wxRmdir(temp); - } else if( projFull.IsEmpty() && !mytemp.IsEmpty()) { + } else if( projFull.empty() && !mytemp.empty()) { CleanDir(mytemp, wxEmptyString, ".DS_Store", _("Cleaning project temporary files"), kCleanTopDirToo | kCleanDirsOnlyIfEmpty ); } } @@ -797,7 +797,7 @@ wxLongLong DirManager::GetFreeDiskSpace() wxLongLong freeSpace = -1; wxFileName path; - path.SetPath(projPath.IsEmpty() ? mytemp : projPath); + path.SetPath(projPath.empty() ? mytemp : projPath); // Use the parent directory if the project directory hasn't yet been created if (!path.DirExists()) @@ -1208,7 +1208,7 @@ BlockFilePtr DirManager::NewAliasBlockFile( aliasStart, aliasLen, aliasChannel); mBlockFileHash[fileName]=newBlockFile; - aliasList.Add(aliasedFile); + aliasList.push_back(aliasedFile); return newBlockFile; } @@ -1225,7 +1225,7 @@ BlockFilePtr DirManager::NewODAliasBlockFile( aliasStart, aliasLen, aliasChannel); mBlockFileHash[fileName]=newBlockFile; - aliasList.Add(aliasedFile); + aliasList.push_back(aliasedFile); return newBlockFile; } @@ -1242,7 +1242,7 @@ BlockFilePtr DirManager::NewODDecodeBlockFile( aliasStart, aliasLen, aliasChannel, decodeType); mBlockFileHash[fileName]=newBlockFile; - aliasList.Add(aliasedFile); //OD TODO: check to see if we need to remove this when done decoding. + aliasList.push_back(aliasedFile); //OD TODO: check to see if we need to remove this when done decoding. //I don't immediately see a place where aliased files remove when a file is closed. return newBlockFile; @@ -1324,7 +1324,7 @@ BlockFilePtr DirManager::CopyBlockFile(const BlockFilePtr &b) b2 = b->Copy(std::move(newFile)); mBlockFileHash[newName] = b2; - aliasList.Add(newPath); + aliasList.push_back(newPath); } if (!b2) @@ -1445,7 +1445,7 @@ std::pair DirManager::LinkOrCopyToNewProjectDirectory( // Check that this BlockFile corresponds to a file on disk //ANSWER-ME: Is this checking only for SilentBlockFiles, in which case // (!oldFileName.IsOk()) is a more correct check? - if (oldFileNameRef.GetName().IsEmpty()) { + if (oldFileNameRef.GetName().empty()) { return { true, newPath }; } @@ -1643,7 +1643,7 @@ bool DirManager::EnsureSafeFilename(const wxFileName &fName) } aliasList.Remove(fullPath); - aliasList.Add(renamedFullPath); + aliasList.push_back(renamedFullPath); } // Success!!! Either we successfully renamed the file, @@ -1938,7 +1938,7 @@ _("Project check of \"%s\" folder \ wxArrayString orphanFilePathArray; // orphan .au and .auf files this->FindOrphanBlockFiles(filePathArray, orphanFilePathArray); - if ((nResult != FSCKstatus_CLOSE_REQ) && !orphanFilePathArray.IsEmpty()) + if ((nResult != FSCKstatus_CLOSE_REQ) && !orphanFilePathArray.empty()) { // In auto-recover mode, leave orphan blockfiles alone. // They will be deleted when project is saved the first time. @@ -1956,7 +1956,7 @@ _("Project check of \"%s\" folder \ other projects. \ \nThey are doing no harm and are small."); wxString msg; - msg.Printf(msgA, this->projName, (int)orphanFilePathArray.GetCount()); + msg.Printf(msgA, this->projName, (int)orphanFilePathArray.size()); const wxChar *buttons[] = {_("Continue without deleting; ignore the extra files this session"), @@ -1977,7 +1977,7 @@ other projects. \ // Plus they affect none of the valid tracks, so incorrect to mark them changed, // and no need for refresh. // nResult |= FSCKstatus_CHANGED; - for (size_t i = 0; i < orphanFilePathArray.GetCount(); i++) + for (size_t i = 0; i < orphanFilePathArray.size(); i++) wxRemoveFile(orphanFilePathArray[i]); } } @@ -1998,7 +1998,7 @@ other projects. \ !missingAliasedFileAUFHash.empty() || !missingAUFHash.empty() || !missingAUHash.empty() || - !orphanFilePathArray.IsEmpty()) + !orphanFilePathArray.empty()) { wxLogWarning(_("Project check found file inconsistencies inspecting the loaded project data.")); wxLog::FlushActive(); // Flush is modal and will clear the log (both desired). @@ -2116,7 +2116,7 @@ void DirManager::FindOrphanBlockFiles( { DirManager *clipboardDM = NULL; - for (size_t i = 0; i < filePathArray.GetCount(); i++) + for (size_t i = 0; i < filePathArray.size(); i++) { const wxFileName &fullname = filePathArray[i]; wxString basename = fullname.GetName(); @@ -2139,10 +2139,10 @@ void DirManager::FindOrphanBlockFiles( // Ignore it if it exists in the clipboard (from a previously closed project) if (!(clipboardDM && clipboardDM->ContainsBlockFile(basename))) - orphanFilePathArray.Add(fullname.GetFullPath()); + orphanFilePathArray.push_back(fullname.GetFullPath()); } } - for (size_t i = 0; i < orphanFilePathArray.GetCount(); i++) + for (size_t i = 0; i < orphanFilePathArray.size(); i++) wxLogWarning(_("Orphan block file: '%s'"), orphanFilePathArray[i]); } @@ -2166,7 +2166,7 @@ void DirManager::RemoveOrphanBlockfiles() orphanFilePathArray); // output: orphan files // Remove all orphan blockfiles. - for (size_t i = 0; i < orphanFilePathArray.GetCount(); i++) + for (size_t i = 0; i < orphanFilePathArray.size(); i++) wxRemoveFile(orphanFilePathArray[i]); } diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index b03e8c914..c3f623f88 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -482,7 +482,7 @@ public: S.StartMultiColumn(2, wxEXPAND); S.SetStretchyCol(0); { - if (mLibPath.GetFullPath().IsEmpty()) { + if (mLibPath.GetFullPath().empty()) { text.Printf(_("To find '%s', click here -->"), mName); mPathText = S.AddTextBox( {}, text, 0); } @@ -523,7 +523,7 @@ public: mType, wxFD_OPEN | wxRESIZE_BORDER, this); - if (!path.IsEmpty()) { + if (!path.empty()) { mLibPath = path; mPathText->SetValue(path); } @@ -595,7 +595,7 @@ bool FFmpegLibs::FindLibs(wxWindow *parent) // configured name is not found. name = GetLibAVFormatName(); wxLogMessage(wxT("Looking for FFmpeg libraries...")); - if (!mLibAVFormatPath.IsEmpty()) { + if (!mLibAVFormatPath.empty()) { wxLogMessage(wxT("mLibAVFormatPath ('%s') is not empty."), mLibAVFormatPath); const wxFileName fn{ mLibAVFormatPath }; path = fn.GetPath(); @@ -645,13 +645,13 @@ bool FFmpegLibs::LoadLibs(wxWindow * WXUNUSED(parent), bool showerr) } // First try loading it from a previously located path - if (!mLibAVFormatPath.IsEmpty()) { + if (!mLibAVFormatPath.empty()) { wxLogMessage(wxT("mLibAVFormatPath ('%s') is not empty. Loading from it."),mLibAVFormatPath); mLibsLoaded = InitLibs(mLibAVFormatPath,showerr); } // If not successful, try loading it from default path - if (!mLibsLoaded && !GetLibAVFormatPath().IsEmpty()) { + if (!mLibsLoaded && !GetLibAVFormatPath().empty()) { const wxFileName fn{ GetLibAVFormatPath(), GetLibAVFormatName() }; wxString path = fn.GetFullPath(); wxLogMessage(wxT("Trying to load FFmpeg libraries from default path, '%s'."), path); @@ -663,7 +663,7 @@ bool FFmpegLibs::LoadLibs(wxWindow * WXUNUSED(parent), bool showerr) #if defined(__WXMAC__) // If not successful, try loading it from legacy path - if (!mLibsLoaded && !GetLibAVFormatPath().IsEmpty()) { + if (!mLibsLoaded && !GetLibAVFormatPath().empty()) { const wxFileName fn{wxT("/usr/local/lib/audacity"), GetLibAVFormatName()}; wxString path = fn.GetFullPath(); wxLogMessage(wxT("Trying to load FFmpeg libraries from legacy path, '%s'."), path); diff --git a/src/FileFormats.cpp b/src/FileFormats.cpp index badfb5fd1..8ca315384 100644 --- a/src/FileFormats.cpp +++ b/src/FileFormats.cpp @@ -220,7 +220,7 @@ wxArrayString sf_get_all_extensions() sf_command(NULL, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; - exts.Add(LAT1CTOWX(format_info.extension)); + exts.push_back(LAT1CTOWX(format_info.extension)); } // Some other extensions that are often sound files diff --git a/src/FileNames.cpp b/src/FileNames.cpp index 87c79adce..7f39872c0 100644 --- a/src/FileNames.cpp +++ b/src/FileNames.cpp @@ -116,7 +116,7 @@ void FileNames::MakeNameUnique(wxArrayString &otherNames, wxFileName &newName) i++; } while (otherNames.Index(newName.GetFullName(), false) >= 0); } - otherNames.Add(newName.GetFullName()); + otherNames.push_back(newName.GetFullName()); } @@ -150,7 +150,7 @@ wxString FileNames::DataDir() // between wxStandardPaths and wxConfig under Linux. The latter // creates a normal file as "$HOME/.audacity", while the former // expects the ".audacity" portion to be a directory. - if (gDataDir.IsEmpty()) + if (gDataDir.empty()) { // If there is a directory "Portable Settings" relative to the // executable's EXE file, the prefs are stored in there, otherwise diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index 43ef0aae4..c8cab1f22 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -239,7 +239,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id, /* i18n-hint: This refers to a "window function", * such as Hann or Rectangular, used in the * Frequency analyze dialog box. */ - funcChoices.Add(wxString::Format("%s window", WindowFuncName(i) ) ); + funcChoices.push_back(wxString::Format("%s window", WindowFuncName(i) ) ); } wxArrayString axisChoices; diff --git a/src/HelpText.cpp b/src/HelpText.cpp index 4aefcdb7e..d69341c7e 100644 --- a/src/HelpText.cpp +++ b/src/HelpText.cpp @@ -307,7 +307,7 @@ wxString HelpText( const wxString & Key ) wxString Text; Text = HelpTextBuiltIn( Key ); - if( !Text.IsEmpty()) + if( !Text.empty()) return LinkExpand( Text ); // Perhaps useful for debugging - we'll return key that we didn't find. diff --git a/src/Internat.cpp b/src/Internat.cpp index fcc398623..f79c3439a 100644 --- a/src/Internat.cpp +++ b/src/Internat.cpp @@ -103,14 +103,14 @@ void Internat::Init() auto forbid = wxFileName::GetForbiddenChars(format); for(auto cc: forbid) - exclude.Add(wxString{ cc }); + exclude.push_back(wxString{ cc }); // The path separators may not be forbidden, so add them auto separators = wxFileName::GetPathSeparators(format); for(auto cc: separators) { if (forbid.Find(cc) == wxNOT_FOUND) - exclude.Add(wxString{ cc }); + exclude.push_back(wxString{ cc }); } } @@ -290,7 +290,7 @@ bool Internat::SanitiseFilename(wxString &name, const wxString &sub) wxString Internat::StripAccelerators(const wxString &s) { wxString result; - result.Alloc(s.Length()); + result.reserve(s.Length()); for(size_t i = 0; i < s.Length(); i++) { if (s[i] == '\t') break; diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 6f4207131..aab5f69bb 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -155,7 +155,7 @@ void LabelDialog::PopulateLabels() wxGridCellAttr *attr; mGrid->SetColAttr(Col_Track, (attr = safenew wxGridCellAttr)); attr->SetEditor(mChoiceEditor); - mTrackNames.Add(_("New...")); + mTrackNames.push_back(_("New...")); // Initialize and set the time column attributes mGrid->SetColAttr(Col_Stime, (attr = safenew wxGridCellAttr)); @@ -384,7 +384,7 @@ bool LabelDialog::TransferDataFromWindow() } // Create any added tracks - while (tndx < (int)mTrackNames.GetCount() - 1) { + while (tndx < (int)mTrackNames.size() - 1) { // Extract the name wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1); @@ -434,9 +434,9 @@ bool LabelDialog::Validate() wxString LabelDialog::TrackName(int & index, const wxString &dflt) { // Generate a NEW track name if the passed index is out of range - if (index < 1 || index >= (int)mTrackNames.GetCount()) { - index = mTrackNames.GetCount(); - mTrackNames.Add(wxString::Format(wxT("%d - %s"), index, dflt)); + if (index < 1 || index >= (int)mTrackNames.size()) { + index = mTrackNames.size(); + mTrackNames.push_back(wxString::Format(wxT("%d - %s"), index, dflt)); } // Return the track name @@ -665,7 +665,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event)) } // Extract the actual name. - wxString fName = mTrackNames[mTrackNames.GetCount() - 1].AfterFirst(wxT('-')).Mid(1); + wxString fName = mTrackNames[mTrackNames.size() - 1].AfterFirst(wxT('-')).Mid(1); fName = FileNames::SelectFile(FileNames::Operation::Export, _("Export Labels As:"), diff --git a/src/Languages.cpp b/src/Languages.cpp index ba8891aac..1f65a33d4 100644 --- a/src/Languages.cpp +++ b/src/Languages.cpp @@ -65,7 +65,7 @@ static bool TranslationExists(wxArrayString &audacityPathList, wxString code) audacityPathList, results); - return (results.GetCount() > 0); + return (results.size() > 0); } #ifdef __WXMAC__ @@ -115,7 +115,7 @@ wxString GetSystemLanguageCode() wxString code = fullCode.Left(2); unsigned int i; - for(i=0; i %s"), @@ -274,8 +274,8 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames) code = wxT("en-simple"); name = wxT("Simplified"); if (TranslationExists(audacityPathList, code) ) { - tempCodes.Add(code); - tempNames.Add(name); + tempCodes.push_back(code); + tempNames.push_back(name); tempHash[code] = name; } } @@ -283,18 +283,18 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames) // Sort unsigned int j; - for(j=0; j &&pBitmap, const while ((nUnderscoreIndex = strFilename.Find(wxT('_'))) != -1) { strKeyword = strFilename.Left(nUnderscoreIndex); - mKeywords.Add(strKeyword); + mKeywords.push_back(strKeyword); strFilename = strFilename.Mid(nUnderscoreIndex + 1); } - if (!strFilename.IsEmpty()) // Skip trailing underscores. - mKeywords.Add(strFilename); // Add the last one. + if (!strFilename.empty()) // Skip trailing underscores. + mKeywords.push_back(strFilename); // Add the last one. } MusicalInstrument::~MusicalInstrument() { - mKeywords.Clear(); + mKeywords.clear(); } @@ -899,7 +899,7 @@ MixerBoard::MixerBoard(AudacityProject* pProject, /* This doesn't work to make the mScrolledWindow automatically resize, so do it explicitly in OnSize. auto pBoxSizer = std::make_unique(wxVERTICAL); - pBoxSizer->Add(mScrolledWindow, 0, wxExpand, 0); + pBoxSizer->push_back(mScrolledWindow, 0, wxExpand, 0); this->SetAutoLayout(true); this->SetSizer(pBoxSizer); pBoxSizer->Fit(this); @@ -964,7 +964,7 @@ void MixerBoard::UpdatePrefs() mImageSoloDown.reset(); mImageSoloDisabled.reset(); } - for (unsigned int nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.GetCount(); nClusterIndex++) + for (unsigned int nClusterIndex = 0; nClusterIndex < mMixerTrackClusters.size(); nClusterIndex++) mMixerTrackClusters[nClusterIndex]->UpdatePrefs(); Refresh(); #endif @@ -1072,7 +1072,7 @@ wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(const Track* pTrack) if (mMusicalInstruments.empty()) return NULL; - // random choice: return mMusicalInstruments[(int)pTrack % mMusicalInstruments.GetCount()].mBitmap; + // random choice: return mMusicalInstruments[(int)pTrack % mMusicalInstruments.size()].mBitmap; const wxString strTrackName(pTrack->GetName().MakeLower()); size_t nBestItemIndex = 0; @@ -1086,7 +1086,7 @@ wxBitmap* MixerBoard::GetMusicalInstrumentBitmap(const Track* pTrack) { nScore = 0; - nNumKeywords = mMusicalInstruments[nInstrIndex]->mKeywords.GetCount(); + nNumKeywords = mMusicalInstruments[nInstrIndex]->mKeywords.size(); if (nNumKeywords > 0) { nPointsPerMatch = 10 / nNumKeywords; diff --git a/src/ModuleManager.cpp b/src/ModuleManager.cpp index 6c5e900f6..d87887536 100755 --- a/src/ModuleManager.cpp +++ b/src/ModuleManager.cpp @@ -223,7 +223,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler) if (pathVar != wxT("")) wxGetApp().AddMultiPathsToPathList(pathVar, pathList); - for (i = 0; i < audacityPathList.GetCount(); i++) { + for (i = 0; i < audacityPathList.size(); i++) { wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH; wxGetApp().AddUniquePathToPathList(prefix + wxT("modules"), pathList); @@ -236,7 +236,7 @@ void ModuleManager::Initialize(CommandHandler &cmdHandler) #endif wxString saveOldCWD = ::wxGetCwd(); - for (i = 0; i < files.GetCount(); i++) { + for (i = 0; i < files.size(); i++) { // As a courtesy to some modules that might be bridges to // open other modules, we set the current working // directory to be the module's directory. @@ -374,7 +374,7 @@ bool ModuleManager::DiscoverProviders() PluginManager & pm = PluginManager::Get(); - for (int i = 0, cnt = provList.GetCount(); i < cnt; i++) + for (int i = 0, cnt = provList.size(); i < cnt; i++) { ModuleInterface *module = LoadModule(provList[i]); if (module) @@ -555,7 +555,7 @@ bool ModuleManager::RegisterEffectPlugin(const PluginID & providerID, const wxSt ComponentInterface *ModuleManager::CreateProviderInstance(const PluginID & providerID, const wxString & path) { - if (path.IsEmpty() && mDynModules.find(providerID) != mDynModules.end()) + if (path.empty() && mDynModules.find(providerID) != mDynModules.end()) { return mDynModules[providerID].get(); } @@ -589,7 +589,7 @@ bool ModuleManager::IsProviderValid(const PluginID & WXUNUSED(providerID), const wxString & path) { // Builtin modules do not have a path - if (path.IsEmpty()) + if (path.empty()) { return true; } diff --git a/src/PlatformCompatibility.cpp b/src/PlatformCompatibility.cpp index 067679405..17f6afea6 100644 --- a/src/PlatformCompatibility.cpp +++ b/src/PlatformCompatibility.cpp @@ -51,7 +51,7 @@ wxString PlatformCompatibility::ConvertSlashInFileName(const wxString& filePath) wxString filename; wxString newPath = filePath; // int pathLen = 1; - while (!wxDirExists(wxPathOnly(newPath)) && ! path.IsEmpty()) { + while (!wxDirExists(wxPathOnly(newPath)) && ! path.empty()) { path = newPath.BeforeLast('/'); filename = newPath.AfterLast('/'); newPath = path; diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index a3aa4a6c0..15769e4f6 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -211,7 +211,7 @@ wxAccStatus CheckListAx::GetChildCount( int *childCount ) // a document has a default action of "Press" rather than "Prints the current document." wxAccStatus CheckListAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionName ) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -219,7 +219,7 @@ wxAccStatus CheckListAx::GetDefaultAction( int WXUNUSED(childId), wxString *acti // Returns the description for this object or a child. wxAccStatus CheckListAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -239,7 +239,7 @@ wxAccStatus CheckListAx::GetFocus( int *childId, wxAccessible **child ) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus CheckListAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -248,7 +248,7 @@ wxAccStatus CheckListAx::GetHelpText( int WXUNUSED(childId), wxString *helpText // Return e.g. ALT+K wxAccStatus CheckListAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -490,7 +490,7 @@ PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType mEffects = NULL; SetName(GetTitle()); - mStates.SetCount(STATE_COUNT); + mStates.resize(STATE_COUNT); mStates[STATE_Enabled] = _("Enabled"); mStates[STATE_Disabled] = _("Disabled"); mStates[STATE_New] = _("New"); @@ -612,7 +612,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S) colWidths.push_back(0); } - for (int i = 0, cnt = mStates.GetCount(); i < cnt; i++) + for (int i = 0, cnt = mStates.size(); i < cnt; i++) { int x; mEffects->GetTextExtent(mStates[i], &x, NULL); @@ -1477,7 +1477,7 @@ void PluginManager::FindFilesInPathList(const wxString & pattern, wxLogNull nolog; // Why bother... - if (pattern.IsEmpty()) + if (pattern.empty()) { return; } @@ -1489,7 +1489,7 @@ void PluginManager::FindFilesInPathList(const wxString & pattern, // Add the "per-user" plug-ins directory { const wxFileName &ff = FileNames::PlugInDir(); - paths.Add(ff.GetFullPath()); + paths.push_back(ff.GetFullPath()); } // Add the "Audacity" plug-ins directory @@ -1502,7 +1502,7 @@ void PluginManager::FindFilesInPathList(const wxString & pattern, ff.RemoveLastDir(); #endif ff.AppendDir(wxT("plug-ins")); - paths.Add(ff.GetPath()); + paths.push_back(ff.GetPath()); // Weed out duplicates for (size_t i = 0, cnt = pathList.size(); i < cnt; i++) @@ -1511,12 +1511,12 @@ void PluginManager::FindFilesInPathList(const wxString & pattern, const wxString path{ ff.GetFullPath() }; if (paths.Index(path, wxFileName::IsCaseSensitive()) == wxNOT_FOUND) { - paths.Add(path); + paths.push_back(path); } } // Find all matching files in each path - for (size_t i = 0, cnt = paths.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { ff = paths[i] + wxFILE_SEP_PATH + pattern; wxDir::GetAllFiles(ff.GetPath(), &files, ff.GetFullName(), directories ? wxDIR_DEFAULT : wxDIR_FILES); @@ -1945,7 +1945,7 @@ void PluginManager::Load() } // Doing the deletion within the search loop risked skipping some items, // hence the delayed delete. - for (unsigned int i = 0; i < groupsToDelete.Count(); i++) { + for (unsigned int i = 0; i < groupsToDelete.size(); i++) { registry.DeleteGroup(groupsToDelete[i]); } registry.SetPath(""); @@ -1981,7 +1981,7 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type) wxFileName exeFn{ fullExePath }; exeFn.SetEmptyExt(); exeFn.SetName(wxString{}); - while(exeFn.GetDirCount() && !exeFn.GetDirs().Last().EndsWith(".app")) + while(exeFn.GetDirCount() && !exeFn.GetDirs().back().EndsWith(".app")) exeFn.RemoveLastDir(); const auto goodPath = exeFn.GetPath(); @@ -2038,7 +2038,7 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type) if (!pRegistry->Read(KEY_PROVIDERID, &strVal, wxEmptyString)) { // Bypass group if the provider isn't valid - if (!strVal.IsEmpty() && mPlugins.find(strVal) == mPlugins.end()) + if (!strVal.empty() && mPlugins.find(strVal) == mPlugins.end()) { continue; } @@ -2201,7 +2201,7 @@ void PluginManager::LoadGroup(wxFileConfig *pRegistry, PluginType type) wxStringTokenizer tkr(strVal, wxT(":")); while (tkr.HasMoreTokens()) { - extensions.Add(tkr.GetNextToken()); + extensions.push_back(tkr.GetNextToken()); } plug.SetImporterExtensions(extensions); } @@ -2364,7 +2364,7 @@ void PluginManager::CheckForUpdates(bool bFast) continue; } - pathIndex.Add(plug.GetPath().BeforeFirst(wxT(';'))); + pathIndex.push_back(plug.GetPath().BeforeFirst(wxT(';'))); } // Check all known plugins to ensure they are still valid and scan for NEW ones. @@ -2406,7 +2406,7 @@ void PluginManager::CheckForUpdates(bool bFast) { // Collect plugin paths wxArrayString paths = mm.FindPluginsForProvider(plugID, plugPath); - for (size_t i = 0, cnt = paths.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { wxString path = paths[i].BeforeFirst(wxT(';'));; if (pathIndex.Index(path) == wxNOT_FOUND) @@ -2789,7 +2789,7 @@ bool PluginManager::HasGroup(const wxString & group) bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgroups) { - if (group.IsEmpty() || !HasGroup(group)) + if (group.empty() || !HasGroup(group)) { return false; } @@ -2803,7 +2803,7 @@ bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgrou { do { - subgroups.Add(name); + subgroups.push_back(name); } while (GetSettings()->GetNextGroup(name, index)); } @@ -2816,7 +2816,7 @@ bool PluginManager::GetConfig(const wxString & key, int & value, int defval) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Read(key, &value, defval); } @@ -2828,7 +2828,7 @@ bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxSt { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { wxString wxval = wxEmptyString; @@ -2844,7 +2844,7 @@ bool PluginManager::GetConfig(const wxString & key, bool & value, bool defval) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Read(key, &value, defval); } @@ -2856,7 +2856,7 @@ bool PluginManager::GetConfig(const wxString & key, float & value, float defval) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { double dval = 0.0; @@ -2872,7 +2872,7 @@ bool PluginManager::GetConfig(const wxString & key, double & value, double defva { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Read(key, &value, defval); } @@ -2884,7 +2884,7 @@ bool PluginManager::SetConfig(const wxString & key, const wxString & value) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { wxString wxval = value; result = GetSettings()->Write(key, wxval); @@ -2901,7 +2901,7 @@ bool PluginManager::SetConfig(const wxString & key, const int & value) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Write(key, value); if (result) @@ -2917,7 +2917,7 @@ bool PluginManager::SetConfig(const wxString & key, const bool & value) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Write(key, value); if (result) @@ -2933,7 +2933,7 @@ bool PluginManager::SetConfig(const wxString & key, const float & value) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Write(key, value); if (result) @@ -2949,7 +2949,7 @@ bool PluginManager::SetConfig(const wxString & key, const double & value) { bool result = false; - if (!key.IsEmpty()) + if (!key.empty()) { result = GetSettings()->Write(key, value); if (result) @@ -2997,7 +2997,7 @@ wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group) wxString path = SettingsPath(ID, true); wxFileName ff(group); - if (!ff.GetName().IsEmpty()) + if (!ff.GetName().empty()) { path += ff.GetFullPath(wxPATH_UNIX) + wxCONFIG_PATH_SEPARATOR; } @@ -3009,7 +3009,7 @@ wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group) wxString PluginManager::SharedKey(const PluginID & ID, const wxString & group, const wxString & key) { wxString path = SharedGroup(ID, group); - if (path.IsEmpty()) + if (path.empty()) { return path; } @@ -3023,7 +3023,7 @@ wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group wxString path = SettingsPath(ID, false); wxFileName ff(group); - if (!ff.GetName().IsEmpty()) + if (!ff.GetName().empty()) { path += ff.GetFullPath(wxPATH_UNIX) + wxCONFIG_PATH_SEPARATOR; } @@ -3035,7 +3035,7 @@ wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group wxString PluginManager::PrivateKey(const PluginID & ID, const wxString & group, const wxString & key) { wxString path = PrivateGroup(ID, group); - if (path.IsEmpty()) + if (path.empty()) { return path; } diff --git a/src/Prefs.cpp b/src/Prefs.cpp index 9de9e9456..e0cd4cc82 100755 --- a/src/Prefs.cpp +++ b/src/Prefs.cpp @@ -219,7 +219,7 @@ void InitPreferences() } // Use the system default language if one wasn't specified or if the user selected System. - if (langCode.IsEmpty()) + if (langCode.empty()) { langCode = GetSystemLanguageCode(); } diff --git a/src/Project.cpp b/src/Project.cpp index b0ac03682..913fd87de 100644 --- a/src/Project.cpp +++ b/src/Project.cpp @@ -1568,10 +1568,10 @@ void AudacityProject::SetProjectTitle( int number) if( number >= 0 ){ /* i18n-hint: The %02i is the project number, the %s is the project name.*/ name = wxString::Format( _TS("[Project %02i] Audacity \"%s\""), number+1 , - name.IsEmpty() ? "" : (const char *)name ); + name.empty() ? "" : (const char *)name ); } // If we are not showing numbers, then shows as 'Audacity'. - else if( name.IsEmpty() ) + else if( name.empty() ) { mbLoadedFromAup = false; name = _TS("Audacity"); @@ -2172,7 +2172,7 @@ int AudacityProject::CountUnnamed() int j = 0; for ( size_t i = 0; i < gAudacityProjects.size(); i++) { if ( gAudacityProjects[i] ) - if ( gAudacityProjects[i]->GetName().IsEmpty() ) + if ( gAudacityProjects[i]->GetName().empty() ) j++; } return j; @@ -2469,7 +2469,7 @@ public: // Construct this projects name and number. sProjNumber = ""; sProjName = p->GetName(); - if (sProjName.IsEmpty()){ + if (sProjName.empty()){ sProjName = _(""); UnnamedCount=AudacityProject::CountUnnamed(); if( UnnamedCount > 1 ){ @@ -2740,7 +2740,7 @@ void AudacityProject::OnOpenAudioFile(wxCommandEvent & event) { const wxString &cmd = event.GetString(); - if (!cmd.IsEmpty()) { + if (!cmd.empty()) { OpenFile(cmd); } @@ -2880,7 +2880,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj) * 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")); - if (selectedFiles.GetCount() == 0) { + if (selectedFiles.size() == 0) { gPrefs->Write(wxT("/LastOpenType"),wxT("")); gPrefs->Flush(); return; @@ -2897,7 +2897,7 @@ void AudacityProject::OpenFiles(AudacityProject *proj) gPrefs->Flush(); } ); - for (size_t ff = 0; ff < selectedFiles.GetCount(); ff++) { + for (size_t ff = 0; ff < selectedFiles.size(); ff++) { const wxString &fileName = selectedFiles[ff]; // Make sure it isn't already open. @@ -3478,7 +3478,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs) realFileName = realFileName.Left(realFileName.Length() - 5); } - if (realFileName.IsEmpty()) + if (realFileName.empty()) { // A previously unsaved project has been recovered, so fake // an unsaved project. The data files just stay in the temp @@ -3502,7 +3502,7 @@ bool AudacityProject::HandleXMLTag(const wxChar *tag, const wxChar **attrs) projPath = wxPathOnly(mFileName); } - if (!projName.IsEmpty()) + if (!projName.empty()) { // First try to load the data files based on the _data dir given in the .aup file // If this fails then try to use the filename of the .aup as the base directory @@ -4321,7 +4321,7 @@ bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArr mTags.get(), errorMessage); - if (!errorMessage.IsEmpty()) { + if (!errorMessage.empty()) { // Error message derived from Importer::Import // Additional help via a Help button links to the manual. ShowErrorDialog(this, _("Error Importing"), @@ -4433,7 +4433,7 @@ bool AudacityProject::SaveAs(bool bWantSaveCopy /*= false*/, bool bLossless /*= bWantSaveCopy = true; // Bug 1304: Set a default file path if none was given. For Save/SaveAs - if( filename.GetFullPath().IsEmpty() ){ + if( filename.GetFullPath().empty() ){ bHasPath = false; filename = FileNames::DefaultToDocumentsFolder(wxT("/SaveAs/Path")); } @@ -4478,7 +4478,7 @@ For an audio file that will open in other apps, use 'Export'.\n"); return false; } - bool bPrompt = (mBatchMode == 0) || (mFileName.IsEmpty()); + bool bPrompt = (mBatchMode == 0) || (mFileName.empty()); wxString fName = ""; if (bPrompt) { @@ -5123,7 +5123,7 @@ void AudacityProject::AutoSave() // file with the extension ".tmp", then rename the file to .autosave wxString projName; - if (mFileName.IsEmpty()) + if (mFileName.empty()) projName = wxT("New Project"); else projName = wxFileName(mFileName).GetName(); @@ -5140,7 +5140,7 @@ void AudacityProject::AutoSave() AutoSaveFile buffer; WriteXMLHeader(buffer); WriteXML(buffer, false); - mStrOtherNamesArray.Clear(); + mStrOtherNamesArray.clear(); wxFFile saveFile; saveFile.Open(fn + wxT(".tmp"), wxT("wb")); @@ -5153,7 +5153,7 @@ void AudacityProject::AutoSave() // Now that we have a NEW auto-save file, DELETE the old one DeleteCurrentAutoSaveFile(); - if (!mAutoSaveFileName.IsEmpty()) + if (!mAutoSaveFileName.empty()) return; // could not remove auto-save file if (!wxRenameFile(fn + wxT(".tmp"), fn + wxT(".autosave"))) @@ -5173,7 +5173,7 @@ void AudacityProject::AutoSave() void AudacityProject::DeleteCurrentAutoSaveFile() { - if (!mAutoSaveFileName.IsEmpty()) + if (!mAutoSaveFileName.empty()) { if (wxFileExists(mAutoSaveFileName)) { @@ -5293,7 +5293,7 @@ You are saving directly to a slow external storage device\n\ void AudacityProject::OnAudioIONewBlockFiles(const AutoSaveFile & blockFileLog) { // New blockfiles have been created, so add them to the auto-save file - if (!mAutoSaveFileName.IsEmpty()) + if (!mAutoSaveFileName.empty()) { wxFFile f(mAutoSaveFileName, wxT("ab")); if (!f.IsOpened()) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 01f0ee133..ba73ed162 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -993,7 +993,7 @@ void Sequence::HandleXMLEndTag(const wxChar *tag) SeqBlock &block = mBlock[b]; if (block.start != numSamples) { wxString sFileAndExtension = block.f->GetFileName().name.GetFullName(); - if (sFileAndExtension.IsEmpty()) + if (sFileAndExtension.empty()) sFileAndExtension = wxT("(replaced with silence)"); else sFileAndExtension = wxT("\"") + sFileAndExtension + wxT("\""); diff --git a/src/Shuttle.cpp b/src/Shuttle.cpp index 155370a59..a207a06bf 100644 --- a/src/Shuttle.cpp +++ b/src/Shuttle.cpp @@ -83,7 +83,7 @@ bool Shuttle::TransferBool( const wxString & Name, bool & bValue, const bool & b bValue = bDefault; if( ExchangeWithMaster( Name )) { - if( !mValueString.IsEmpty() ) + if( !mValueString.empty() ) bValue = mValueString.GetChar(0) == wxT('y'); } } @@ -102,7 +102,7 @@ bool Shuttle::TransferFloat( const wxString & Name, float & fValue, const float fValue = fDefault; if( ExchangeWithMaster( Name )) { - if( !mValueString.IsEmpty() ) + if( !mValueString.empty() ) fValue = wxAtof( mValueString ); } } @@ -121,7 +121,7 @@ bool Shuttle::TransferDouble( const wxString & Name, double & dValue, const doub dValue = dDefault; if( ExchangeWithMaster( Name )) { - if( !mValueString.IsEmpty() ) + if( !mValueString.empty() ) dValue = wxAtof( mValueString ); } } diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index ee9aee284..6f7da1837 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -247,7 +247,7 @@ void ShuttleGuiBase::AddPrompt(const wxString &Prompt) TieCheckBox( "", *pVar); //return; } - if( Prompt.IsEmpty() ) + if( Prompt.empty() ) return; miProp=1; mpWind = safenew wxStaticText(GetParent(), -1, Prompt, wxDefaultPosition, wxDefaultSize, @@ -259,7 +259,7 @@ void ShuttleGuiBase::AddPrompt(const wxString &Prompt) /// Left aligned text string. void ShuttleGuiBase::AddUnits(const wxString &Prompt) { - if( Prompt.IsEmpty() ) + if( Prompt.empty() ) return; if( mShuttleMode != eIsCreating ) return; @@ -273,7 +273,7 @@ void ShuttleGuiBase::AddUnits(const wxString &Prompt) /// Centred text string. void ShuttleGuiBase::AddTitle(const wxString &Prompt) { - if( Prompt.IsEmpty() ) + if( Prompt.empty() ) return; if( mShuttleMode != eIsCreating ) return; @@ -313,7 +313,7 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, const wxString mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize, Style( 0 )); pCheckBox->SetValue(Selected == wxT("true")); - if (realPrompt.IsEmpty()) { + if (realPrompt.empty()) { // NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have // an accessibility name which is empty. Bug 1980. #if wxUSE_ACCESSIBILITY @@ -455,7 +455,7 @@ wxComboBox * ShuttleGuiBase::AddCombo( const wxString &Prompt, const wxString &S wxComboBox * pCombo; miProp=0; - int n = pChoices->GetCount(); + int n = pChoices->size(); if( n>50 ) n=50; int i; wxString Choices[50]; @@ -1379,7 +1379,7 @@ wxChoice * ShuttleGuiBase::TieChoice( else { wxString Temp; - if( pChoices && ( WrappedRef.ReadAsInt() < (int)pChoices->GetCount() ) ) + if( pChoices && ( WrappedRef.ReadAsInt() < (int)pChoices->size() ) ) { Temp = (*pChoices)[WrappedRef.ReadAsInt()]; } @@ -1624,7 +1624,7 @@ wxString ShuttleGuiBase::TranslateFromIndex( const int nIn, const wxArrayString if( n== wxNOT_FOUND ) n=miNoMatchSelector; miNoMatchSelector = 0; - if( n < (int)Choices.GetCount() ) + if( n < (int)Choices.size() ) { return Choices[n]; } @@ -2332,7 +2332,7 @@ std::unique_ptr CreateStdButtonSizer(wxWindow *parent, long buttons, wx size_t lastLastSpacer = 0; size_t lastSpacer = 0; wxSizerItemList & list = bs->GetChildren(); - for( size_t i = 0, cnt = list.GetCount(); i < cnt; i++ ) + for( size_t i = 0, cnt = list.size(); i < cnt; i++ ) { if( list[i]->IsSpacer() ) { @@ -2382,7 +2382,7 @@ void ShuttleGuiBase::SetSizeHints( wxWindow *window, const wxArrayString & items { int maxw = 0; - for( size_t i = 0; i < items.GetCount(); i++ ) + for( size_t i = 0; i < items.size(); i++ ) { int x; int y; @@ -2470,7 +2470,7 @@ wxChoice * ShuttleGuiGetDefinition::TieChoice( AddItem( Default, "default" ); StartField( "enum" ); StartArray(); - for( size_t i=0;iGetCellValue(i, 0); wxString v = mGrid->GetCellValue(i, 1); - if (n.IsEmpty()) { + if (n.empty()) { continue; } @@ -1100,7 +1100,7 @@ void TagsEditor::OnEdit(wxCommandEvent & WXUNUSED(event)) wxArrayString g; int cnt = mLocal.GetNumUserGenres(); for (int i = 0; i < cnt; i++) { - g.Add(mLocal.GetUserGenre(i)); + g.push_back(mLocal.GetUserGenre(i)); } std::sort( g.begin(), g.end() ); @@ -1187,7 +1187,7 @@ void TagsEditor::OnLoad(wxCommandEvent & WXUNUSED(event)) this); // User canceled... - if (fn.IsEmpty()) { + if (fn.empty()) { return; } @@ -1242,7 +1242,7 @@ void TagsEditor::OnSave(wxCommandEvent & WXUNUSED(event)) this); // User canceled... - if (fn.IsEmpty()) { + if (fn.empty()) { return; } @@ -1431,7 +1431,7 @@ void TagsEditor::PopulateGenres() wxArrayString g; for (i = 0; i < cnt; i++) { - g.Add(mLocal.GetUserGenre(i)); + g.push_back(mLocal.GetUserGenre(i)); } std::sort( g.begin(), g.end() ); diff --git a/src/Theme.cpp b/src/Theme.cpp index d11c4f702..035ebd6b7 100644 --- a/src/Theme.cpp +++ b/src/Theme.cpp @@ -486,7 +486,7 @@ void ThemeBase::RegisterImage( int &iIndex, const wxImage &Image, const wxString mBitmaps.push_back( wxBitmap( Image ) ); #endif - mBitmapNames.Add( Name ); + mBitmapNames.push_back( Name ); mBitmapFlags.push_back( mFlow.mFlags ); mFlow.mFlags &= ~resFlagSkip; iIndex = mBitmaps.size() - 1; @@ -496,7 +496,7 @@ void ThemeBase::RegisterColour( int &iIndex, const wxColour &Clr, const wxString { wxASSERT( iIndex == -1 ); // Don't initialise same colour twice! mColours.push_back( Clr ); - mColourNames.Add( Name ); + mColourNames.push_back( Name ); iIndex = mColours.size() - 1; } diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index b95781c09..d7bac7f89 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -497,7 +497,7 @@ bool TimerRecordDialog::RemoveAllAutoSaveFiles() wxDir::GetAllFiles(FileNames::AutoSaveDir(), &files, wxT("*.autosave"), wxDIR_FILES); - for (unsigned int i = 0; i < files.GetCount(); i++) + for (unsigned int i = 0; i < files.size(); i++) { if (!wxRemoveFile(files[i])) { @@ -934,13 +934,13 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S) arrayOptions.Add(_("Restart system")); arrayOptions.Add(_("Shutdown system")); - m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(0)); - m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(1)); + m_sTimerAfterCompleteOptionsArray.push_back(arrayOptions[0]); + m_sTimerAfterCompleteOptionsArray.push_back(arrayOptions[1]); #ifdef __WINDOWS__ - m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(2)); - m_sTimerAfterCompleteOptionsArray.Add(arrayOptions.Item(3)); + m_sTimerAfterCompleteOptionsArray.push_back(arrayOptions[2]); + m_sTimerAfterCompleteOptionsArray.push_back(arrayOptions[3]); #endif - m_sTimerAfterCompleteOption = arrayOptions.Item(iPostTimerRecordAction); + m_sTimerAfterCompleteOption = arrayOptions[iPostTimerRecordAction]; m_pTimerAfterCompleteChoiceCtrl = S.AddChoice(_("After Recording completes:"), m_sTimerAfterCompleteOption, diff --git a/src/TrackArtist.cpp b/src/TrackArtist.cpp index 08ebbd9f8..63db748e3 100644 --- a/src/TrackArtist.cpp +++ b/src/TrackArtist.cpp @@ -328,7 +328,7 @@ void TrackArt::DrawTrack(TrackPanelDrawingContext &context, if (bShowTrackNameInWaveform && wt->IsLeader() && // Exclude empty name. - !wt->GetName().IsEmpty()) { + !wt->GetName().empty()) { wxBrush Brush; wxCoord x,y; wxFont labelFont(12, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); diff --git a/src/TrackPanelAx.cpp b/src/TrackPanelAx.cpp index 859979847..a9c9d3697 100644 --- a/src/TrackPanelAx.cpp +++ b/src/TrackPanelAx.cpp @@ -255,7 +255,7 @@ wxAccStatus TrackPanelAx::GetChildCount( int* childCount ) // a document has a default action of "Press" rather than "Prints the current document." wxAccStatus TrackPanelAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionName ) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -263,7 +263,7 @@ wxAccStatus TrackPanelAx::GetDefaultAction( int WXUNUSED(childId), wxString *act // Returns the description for this object or a child. wxAccStatus TrackPanelAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -271,7 +271,7 @@ wxAccStatus TrackPanelAx::GetDescription( int WXUNUSED(childId), wxString *descr // Returns help text for this object or a child, similar to tooltip text. wxAccStatus TrackPanelAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -280,7 +280,7 @@ wxAccStatus TrackPanelAx::GetHelpText( int WXUNUSED(childId), wxString *helpText // Return e.g. ALT+K wxAccStatus TrackPanelAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } diff --git a/src/UndoManager.cpp b/src/UndoManager.cpp index 4877a58e8..1a5b6e977 100644 --- a/src/UndoManager.cpp +++ b/src/UndoManager.cpp @@ -384,7 +384,7 @@ void UndoManager::StateSaved() // currently unused //void UndoManager::Debug() //{ -// for (unsigned int i = 0; i < stack.Count(); i++) { +// for (unsigned int i = 0; i < stack.size(); i++) { // for (auto t : stack[i]->tracks->Any()) // wxPrintf(wxT("*%d* %s %f\n"), // i, (i == (unsigned int)current) ? wxT("-->") : wxT(" "), diff --git a/src/commands/AudacityCommand.cpp b/src/commands/AudacityCommand.cpp index b2f2f68cd..feb03aa5b 100644 --- a/src/commands/AudacityCommand.cpp +++ b/src/commands/AudacityCommand.cpp @@ -272,7 +272,7 @@ AudacityCommandDialog::AudacityCommandDialog(wxWindow * parent, wxASSERT( pCommand ); mpCommand = pCommand; mAdditionalButtons = additionalButtons |eCancelButton; - if( !pCommand->ManualPage().IsEmpty() ) + if( !pCommand->ManualPage().empty() ) mAdditionalButtons |= eHelpButton; } diff --git a/src/commands/BatchEvalCommand.cpp b/src/commands/BatchEvalCommand.cpp index 188ce0354..d39c4556e 100644 --- a/src/commands/BatchEvalCommand.cpp +++ b/src/commands/BatchEvalCommand.cpp @@ -64,7 +64,7 @@ bool BatchEvalCommand::Apply(const CommandContext & context) bool bResult = Batch.ApplyCommandInBatchMode(friendly, cmdName, cmdParams, &context); // Relay messages, if any. wxString Message = Batch.GetMessage(); - if( !Message.IsEmpty() ) + if( !Message.empty() ) context.Status( Message ); return bResult; } diff --git a/src/commands/CommandBuilder.cpp b/src/commands/CommandBuilder.cpp index 2e5633f35..2140e7fec 100644 --- a/src/commands/CommandBuilder.cpp +++ b/src/commands/CommandBuilder.cpp @@ -159,7 +159,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName, // You start and end with a " or a '. // There is no escaping in the string. cmdParams = cmdParams.Mid(splitAt+1); - if( cmdParams.IsEmpty() ) + if( cmdParams.empty() ) splitAt =-1; else if( cmdParams[0] == '\"' ){ cmdParams = cmdParams.Mid(1); diff --git a/src/commands/CommandManager.cpp b/src/commands/CommandManager.cpp index 7e6e5a6e2..eb5454881 100644 --- a/src/commands/CommandManager.cpp +++ b/src/commands/CommandManager.cpp @@ -994,7 +994,7 @@ CommandListEntry *CommandManager::NewIdentifier(const wxString & nameIn, entry->name = name; entry->label = label; - entry->longLabel = longLabel.IsEmpty() ? label : longLabel; + entry->longLabel = longLabel.empty() ? label : longLabel; entry->hasDialog = hasDialog; entry->key = NormalizedKeyString{ accel.BeforeFirst(wxT('\t')) }; entry->defaultKey = entry->key; @@ -1549,7 +1549,7 @@ bool CommandManager::HandleMenuID(int id, CommandFlag flags, CommandMask mask) /// code to run. bool CommandManager::HandleTextualCommand(const wxString & Str, const CommandContext & context, CommandFlag flags, CommandMask mask) { - if( Str.IsEmpty() ) + if( Str.empty() ) return false; // Linear search for now... for (const auto &entry : mCommandList) @@ -1599,18 +1599,18 @@ bool CommandManager::HandleTextualCommand(const wxString & Str, const CommandCon void CommandManager::GetCategories(wxArrayString &cats) { - cats.Clear(); + cats.clear(); for (const auto &entry : mCommandList) { wxString cat = entry->labelTop; if (cats.Index(cat) == wxNOT_FOUND) { - cats.Add(cat); + cats.push_back(cat); } } #if 0 - mCommandList.GetCount(); i++) { + mCommandList.size(); i++) { if (includeMultis || !mCommandList[i]->multi) - names.Add(mCommandList[i]->name); + names.push_back(mCommandList[i]->name); } AudacityProject *p = GetActiveProject(); @@ -1621,10 +1621,10 @@ void CommandManager::GetCategories(wxArrayString &cats) wxMenuBar *bar = p->GetMenuBar(); size_t cnt = bar->GetMenuCount(); for (size_t i = 0; i < cnt; i++) { - cats.Add(bar->GetMenuLabelText(i)); + cats.push_back(bar->GetMenuLabelText(i)); } - cats.Add(COMMAND); + cats.push_back(COMMAND); #endif } @@ -1635,9 +1635,9 @@ void CommandManager::GetAllCommandNames(wxArrayString &names, if ( entry->isEffect ) continue; if (!entry->multi) - names.Add(entry->name); + names.push_back(entry->name); else if( includeMultis ) - names.Add(entry->name );// + wxT(":")/*+ mCommandList[i]->label*/); + names.push_back(entry->name );// + wxT(":")/*+ mCommandList[i]->label*/); } } @@ -1654,9 +1654,9 @@ void CommandManager::GetAllCommandLabels(wxArrayString &names, if ( entry->isEffect ) continue; if (!entry->multi) - names.Add(entry->longLabel), vHasDialog.push_back(entry->hasDialog); + names.push_back(entry->longLabel), vHasDialog.push_back(entry->hasDialog); else if( includeMultis ) - names.Add(entry->longLabel), vHasDialog.push_back(entry->hasDialog); + names.push_back(entry->longLabel), vHasDialog.push_back(entry->hasDialog); } } @@ -1678,24 +1678,24 @@ void CommandManager::GetAllCommandData( // continue; if (!entry->multi) { - names.Add(entry->name); + names.push_back(entry->name); keys.push_back(entry->key); default_keys.push_back(entry->defaultKey); - labels.Add(entry->label); - categories.Add(entry->labelTop); + labels.push_back(entry->label); + categories.push_back(entry->labelTop); #if defined(EXPERIMENTAL_KEY_VIEW) - prefixes.Add(entry->labelPrefix); + prefixes.push_back(entry->labelPrefix); #endif } else if( includeMultis ) { - names.Add(entry->name); + names.push_back(entry->name); keys.push_back(entry->key); default_keys.push_back(entry->defaultKey); - labels.Add(entry->label); - categories.Add(entry->labelTop); + labels.push_back(entry->label); + categories.push_back(entry->labelTop); #if defined(EXPERIMENTAL_KEY_VIEW) - prefixes.Add(entry->labelPrefix); + prefixes.push_back(entry->labelPrefix); #endif } } @@ -1726,7 +1726,7 @@ wxString CommandManager::GetPrefixedLabelFromName(const wxString &name) #if defined(EXPERIMENTAL_KEY_VIEW) wxString prefix; - if (!entry->labelPrefix.IsEmpty()) { + if (!entry->labelPrefix.empty()) { prefix = entry->labelPrefix + wxT(" - "); } return wxMenuItem::GetLabelText(prefix + entry->label); diff --git a/src/commands/CommandTargets.cpp b/src/commands/CommandTargets.cpp index 719973856..49e0fa162 100644 --- a/src/commands/CommandTargets.cpp +++ b/src/commands/CommandTargets.cpp @@ -59,7 +59,7 @@ void CommandMessageTarget::AddItem(const wxString &value, const wxString &name){ wxString Padding; Padding.Pad( mCounts.size() *2 -2); Padding = (( value.length() < 15 ) || (mCounts.back()<=0)) ? "" : wxString("\n") + Padding; - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?", ":"", Padding, Escaped(value))); else Update( wxString::Format( "%s%s\"%s\":\"%s\"", (mCounts.back()>0)?", ":"", Padding, name, Escaped(value))); @@ -67,14 +67,14 @@ void CommandMessageTarget::AddItem(const wxString &value, const wxString &name){ } void CommandMessageTarget::AddBool(const bool value, const wxString &name){ - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s\"%s\"", (mCounts.back()>0)?", ":"", value?"true":"false")); else Update( wxString::Format( "%s\"%s\":\"%s\"", (mCounts.back()>0)?", ":"", name,value?"true":"false")); mCounts.back() += 1; } void CommandMessageTarget::AddItem(const double value, const wxString &name){ - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s%g", (mCounts.back()>0)?", ":"", value)); else Update( wxString::Format( "%s\"%s\":%g", (mCounts.back()>0)?", ":"", name,value)); @@ -82,7 +82,7 @@ void CommandMessageTarget::AddItem(const double value, const wxString &name){ } void CommandMessageTarget::StartField(const wxString &name){ - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s", (mCounts.back()>0)? ", " : "")); else Update( wxString::Format( "%s\"%s\":", (mCounts.back()>0) ?", ":"", name)); @@ -137,21 +137,21 @@ void LispyCommandMessageTarget::EndStruct(){ } void LispyCommandMessageTarget::AddItem(const wxString &value, const wxString &name){ wxString Padding = ""; - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s%s\"%s\"", (mCounts.back()>0)?" ":"", Padding, Escaped(value))); else Update( wxString::Format( "%s%s(%s \"%s\")", (mCounts.back()>0)?" ":"", Padding, name, Escaped(value))); mCounts.back() += 1; } void LispyCommandMessageTarget::AddBool(const bool value, const wxString &name){ - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s%s", (mCounts.back()>0)?" ":"",value?"True":"False")); else Update( wxString::Format( "%s(%s %s)", (mCounts.back()>0)?" ":"", name,value?"True":"False")); mCounts.back() += 1; } void LispyCommandMessageTarget::AddItem(const double value, const wxString &name){ - if( name.IsEmpty() ) + if( name.empty() ) Update( wxString::Format( "%s%g", (mCounts.back()>0)?" ":"", value)); else Update( wxString::Format( "%s(%s %g)", (mCounts.back()>0)?" ":"", name,value)); diff --git a/src/commands/GetInfoCommand.cpp b/src/commands/GetInfoCommand.cpp index 67c867d8f..01831d7a0 100644 --- a/src/commands/GetInfoCommand.cpp +++ b/src/commands/GetInfoCommand.cpp @@ -205,7 +205,7 @@ bool GetInfoCommand::SendCommands(const CommandContext &context, int flags ) while (plug) { auto command = em.GetCommandIdentifier(plug->GetID()); - if (!command.IsEmpty()){ + if (!command.empty()){ em.GetCommandDefinition( plug->GetID(), context, flags ); } plug = pm.GetNextPlugin(PluginTypeEffect | PluginTypeAudacityCommand ); @@ -407,7 +407,7 @@ void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, CommandManager * pMan = context.GetProject()->GetCommandManager(); wxMenuItemList list = pMenu->GetMenuItems(); - size_t lcnt = list.GetCount(); + size_t lcnt = list.size(); wxMenuItem * item; wxString Label; wxString Accel; @@ -435,7 +435,7 @@ void GetInfoCommand::ExploreMenu( const CommandContext &context, wxMenu * pMenu, context.AddItem( flags, "flags" ); context.AddItem( Label, "label" ); context.AddItem( Accel, "accel" ); - if( !Name.IsEmpty() ) + if( !Name.empty() ) context.AddItem( Name, "id" );// It is called Scripting ID outside Audacity. context.EndStruct(); @@ -572,7 +572,7 @@ void GetInfoCommand::ExploreWindows( const CommandContext &context, return; } wxWindowList list = pWin->GetChildren(); - size_t lcnt = list.GetCount(); + size_t lcnt = list.size(); for (size_t lndx = 0; lndx < lcnt; lndx++) { wxWindow * item = list[lndx]; @@ -587,7 +587,7 @@ void GetInfoCommand::ExploreWindows( const CommandContext &context, // Ignore anonymous panels. if( Name == "panel" ) continue; - if( Name.IsEmpty() ) + if( Name.empty() ) Name = wxString("*") + item->GetToolTipText(); context.StartStruct(); diff --git a/src/commands/HelpCommand.cpp b/src/commands/HelpCommand.cpp index 1d408adc8..030f22eab 100644 --- a/src/commands/HelpCommand.cpp +++ b/src/commands/HelpCommand.cpp @@ -39,7 +39,7 @@ void HelpCommand::PopulateOrExchange(ShuttleGui & S) bool HelpCommand::Apply(const CommandContext & context){ EffectManager & em = EffectManager::Get(); PluginID ID = em.GetEffectByIdentifier( mCommandName ); - if( ID.IsEmpty() ) + if( ID.empty() ) context.Status( "Command not found" ); else em.GetCommandDefinition( ID, context, 1); diff --git a/src/commands/LoadCommands.cpp b/src/commands/LoadCommands.cpp index aee7e9801..fb7abd5a9 100644 --- a/src/commands/LoadCommands.cpp +++ b/src/commands/LoadCommands.cpp @@ -166,7 +166,7 @@ BuiltinCommandsModule::BuiltinCommandsModule(ModuleManagerInterface *moduleManag BuiltinCommandsModule::~BuiltinCommandsModule() { - mPath.Clear(); + mPath.clear(); } // ============================================================================ @@ -209,13 +209,13 @@ bool BuiltinCommandsModule::Initialize() for (const auto &name : names) { //wxLogDebug("Adding %s", name ); - mNames.Add(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + name); + mNames.push_back(wxString(BUILTIN_GENERIC_COMMAND_PREFIX) + name); } /* for (size_t i = 0; i < WXSIZEOF(kExcludedNames); i++) { - mNames.Add(wxString(BUILTIN_COMMAND_PREFIX) + kExcludedNames[i]); + mNames.push_back(wxString(BUILTIN_COMMAND_PREFIX) + kExcludedNames[i]); } */ diff --git a/src/commands/OpenSaveCommands.cpp b/src/commands/OpenSaveCommands.cpp index 93069d161..11e9e7ced 100644 --- a/src/commands/OpenSaveCommands.cpp +++ b/src/commands/OpenSaveCommands.cpp @@ -44,7 +44,7 @@ void OpenProjectCommand::PopulateOrExchange(ShuttleGui & S) bool OpenProjectCommand::Apply(const CommandContext & context){ wxString oldFileName = context.GetProject()->GetFileName(); - if(mFileName.IsEmpty()) + if(mFileName.empty()) { auto project = context.GetProject(); AudacityProject::OpenFiles(project); @@ -83,7 +83,7 @@ void SaveProjectCommand::PopulateOrExchange(ShuttleGui & S) bool SaveProjectCommand::Apply(const CommandContext &context) { - if(mFileName.IsEmpty()) + if(mFileName.empty()) return context.GetProject()->SaveAs(mbCompress); else return context.GetProject()->SaveAs(mFileName,mbCompress,mbAddToHistory); diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 70025bcef..29bcbcd87 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -348,7 +348,7 @@ void ExploreMenu( return; wxMenuItemList list = pMenu->GetMenuItems(); - size_t lcnt = list.GetCount(); + size_t lcnt = list.size(); wxMenuItem * item; wxString Label; wxString Accel; @@ -603,7 +603,7 @@ void ScreenshotCommand::CaptureCommands( #endif mpShooter = this; - for( size_t i=0;if1(); wxArrayString Names; if( mF0 != SelectedRegion::UndefinedFrequency ) - Names.Add(wxT("control-f0")); + Names.push_back(wxT("control-f0")); if( mF1 != SelectedRegion::UndefinedFrequency ) - Names.Add(wxT("control-f1")); + Names.push_back(wxT("control-f1")); SetPresetParameters( &Names, NULL ); #endif @@ -3125,7 +3125,7 @@ bool EffectUIHost::Initialize() } long buttons; - if ( mEffect && mEffect->ManualPage().IsEmpty() && mEffect->HelpPage().IsEmpty()) { + if ( mEffect && mEffect->ManualPage().empty() && mEffect->HelpPage().empty()) { buttons = eApplyButton + eCloseButton; this->SetAcceleratorTable(wxNullAcceleratorTable); } @@ -3317,7 +3317,7 @@ void EffectUIHost::OnCancel(wxCommandEvent & WXUNUSED(evt)) void EffectUIHost::OnHelp(wxCommandEvent & WXUNUSED(event)) { - if (mEffect && mEffect->GetFamilyId() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().IsEmpty())) { + if (mEffect && mEffect->GetFamilyId() == NYQUISTEFFECTS_FAMILY && (mEffect->ManualPage().empty())) { // Old ShowHelp required when there is no on-line manual. // Always use default web browser to allow full-featured HTML pages. HelpSystem::ShowHelp(FindWindow(wxID_HELP), mEffect->HelpPage(), wxEmptyString, true, true); @@ -3344,14 +3344,14 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt)) LoadUserPresets(); - if (mUserPresets.GetCount() == 0) + if (mUserPresets.size() == 0) { menu.Append(kUserPresetsDummyID, _("User Presets"))->Enable(false); } else { auto sub = std::make_unique(); - for (size_t i = 0, cnt = mUserPresets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++) { sub->Append(kUserPresetsID + i, mUserPresets[i]); } @@ -3360,14 +3360,14 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt)) menu.Append(kSaveAsID, _("Save Preset...")); - if (mUserPresets.GetCount() == 0) + if (mUserPresets.size() == 0) { menu.Append(kDeletePresetDummyID, _("Delete Preset"))->Enable(false); } else { auto sub = std::make_unique(); - for (size_t i = 0, cnt = mUserPresets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = mUserPresets.size(); i < cnt; i++) { sub->Append(kDeletePresetID + i, mUserPresets[i]); } @@ -3381,13 +3381,13 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt)) { auto sub = std::make_unique(); sub->Append(kDefaultsID, _("Defaults")); - if (factory.GetCount() > 0) + if (factory.size() > 0) { sub->AppendSeparator(); - for (size_t i = 0, cnt = factory.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = factory.size(); i < cnt; i++) { wxString label = factory[i]; - if (label.IsEmpty()) + if (label.empty()) { label = _("None"); } @@ -3669,7 +3669,7 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt)) } name = text->GetValue(); - if (name.IsEmpty()) + if (name.empty()) { AudacityMessageDialog md(this, _("You must specify a name"), @@ -3852,12 +3852,12 @@ void EffectUIHost::UpdateControls() void EffectUIHost::LoadUserPresets() { - mUserPresets.Clear(); + mUserPresets.clear(); if( mEffect ) mEffect->GetPrivateConfigSubgroups(mEffect->GetUserPresetsGroup(wxEmptyString), mUserPresets); - mUserPresets.Sort(); + std::sort( mUserPresets.begin(), mUserPresets.end() ); return; } @@ -3935,12 +3935,12 @@ EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect) mUserPresets = effect->GetUserPresets(); mFactoryPresets = effect->GetFactoryPresets(); - if (mUserPresets.GetCount() > 0) + if (mUserPresets.size() > 0) { mType->Append(_("User Presets")); } - if (mFactoryPresets.GetCount() > 0) + if (mFactoryPresets.size() > 0) { mType->Append(_("Factory Presets")); } @@ -4009,10 +4009,10 @@ void EffectPresetsDialog::SetPrefix(const wxString & type, const wxString & pref else if (type.IsSameAs(_("Factory Presets"))) { mPresets->Clear(); - for (size_t i = 0, cnt = mFactoryPresets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++) { wxString label = mFactoryPresets[i]; - if (label.IsEmpty()) + if (label.empty()) { label = _("None"); } @@ -4073,10 +4073,10 @@ void EffectPresetsDialog::UpdateUI() } mPresets->Clear(); - for (size_t i = 0, cnt = mFactoryPresets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++) { wxString label = mFactoryPresets[i]; - if (label.IsEmpty()) + if (label.empty()) { label = _("None"); } diff --git a/src/effects/EffectManager.cpp b/src/effects/EffectManager.cpp index 1d3222a99..1619ca3dd 100644 --- a/src/effects/EffectManager.cpp +++ b/src/effects/EffectManager.cpp @@ -308,7 +308,7 @@ wxString EffectManager::GetEffectParameters(const PluginID & ID) // Some effects don't have automatable parameters and will not return // anything, so try to get the active preset (current or factory). - if (parms.IsEmpty()) + if (parms.empty()) { parms = GetDefaultPreset(ID); } @@ -326,7 +326,7 @@ wxString EffectManager::GetEffectParameters(const PluginID & ID) // Some effects don't have automatable parameters and will not return // anything, so try to get the active preset (current or factory). - if (parms.IsEmpty()) + if (parms.empty()) { parms = GetDefaultPreset(ID); } @@ -400,8 +400,8 @@ bool EffectManager::HasPresets(const PluginID & ID) return false; } - return effect->GetUserPresets().GetCount() > 0 || - effect->GetFactoryPresets().GetCount() > 0 || + return effect->GetUserPresets().size() > 0 || + effect->GetFactoryPresets().size() > 0 || effect->HasCurrentSettings() || effect->HasFactoryDefaults(); } @@ -424,7 +424,7 @@ wxString EffectManager::GetPreset(const PluginID & ID, const wxString & params, } preset = effect->GetPreset(parent, preset); - if (preset.IsEmpty()) + if (preset.empty()) { return preset; } @@ -456,7 +456,7 @@ wxString EffectManager::GetDefaultPreset(const PluginID & ID) preset = Effect::kFactoryDefaultsIdent; } - if (!preset.IsEmpty()) + if (!preset.empty()) { CommandParameters eap; @@ -838,7 +838,7 @@ int EffectManager::GetRealtimeLatency() Effect *EffectManager::GetEffect(const PluginID & ID) { // Must have a "valid" ID - if (ID.IsEmpty()) + if (ID.empty()) { return NULL; } @@ -890,7 +890,7 @@ Effect *EffectManager::GetEffect(const PluginID & ID) AudacityCommand *EffectManager::GetAudacityCommand(const PluginID & ID) { // Must have a "valid" ID - if (ID.IsEmpty()) + if (ID.empty()) { return NULL; } diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index 7e9310c78..8874190aa 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -833,7 +833,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S) wxArrayString curves; for (size_t i = 0, cnt = mCurves.size(); i < cnt; i++) { - curves.Add(mCurves[ i ].Name); + curves.push_back(mCurves[ i ].Name); } mCurve = S.Id(ID_Curve).AddChoice( {}, wxT(""), &curves); @@ -3444,7 +3444,7 @@ void EditCurvesDialog::OnDelete(wxCommandEvent & WXUNUSED(event)) } if(highlight == -1) - PopulateList(mEditCurves.GetCount()-1); // set 'unnamed' as the selected curve + PopulateList(mEditCurves.size()-1); // set 'unnamed' as the selected curve else PopulateList(highlight); // user said 'No' to deletion #else // 'DELETE all N' code @@ -3656,7 +3656,7 @@ wxAccStatus SliderAx::GetChildCount(int* childCount) // a document has a default action of "Press" rather than "Prints the current document." wxAccStatus SliderAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionName ) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -3664,7 +3664,7 @@ wxAccStatus SliderAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionN // Returns the description for this object or a child. wxAccStatus SliderAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -3684,7 +3684,7 @@ wxAccStatus SliderAx::GetFocus(int* childId, wxAccessible** child) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus SliderAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -3693,7 +3693,7 @@ wxAccStatus SliderAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) // Return e.g. ALT+K wxAccStatus SliderAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } diff --git a/src/effects/Equalization48x.cpp b/src/effects/Equalization48x.cpp index 85ca8f6a4..ee7ac2fe7 100644 --- a/src/effects/Equalization48x.cpp +++ b/src/effects/Equalization48x.cpp @@ -348,7 +348,7 @@ bool EffectEqualization48x::TrackCompare() auto o = aTrack->Duplicate(); SecondIMap.push_back(aTrack); SecondIMap.push_back(o.get()); - SecondOutputTracks.Add(std::move(o)); + SecondOutputTracks.push_back(std::move(o)); } } diff --git a/src/effects/LoadEffects.cpp b/src/effects/LoadEffects.cpp index 2a5ab3677..03144ffbf 100644 --- a/src/effects/LoadEffects.cpp +++ b/src/effects/LoadEffects.cpp @@ -229,7 +229,7 @@ BuiltinEffectsModule::BuiltinEffectsModule(ModuleManagerInterface *moduleManager BuiltinEffectsModule::~BuiltinEffectsModule() { - mPath.Clear(); + mPath.clear(); } // ============================================================================ @@ -271,13 +271,13 @@ bool BuiltinEffectsModule::Initialize() const auto &names = kEffectNames(); for (const auto &name : names) { - mNames.Add(wxString(BUILTIN_EFFECT_PREFIX) + name); + mNames.push_back(wxString(BUILTIN_EFFECT_PREFIX) + name); } const auto &excluded = kExcludedNames(); for (const auto &name : excluded) { - mNames.Add(wxString(BUILTIN_EFFECT_PREFIX) + name); + mNames.push_back(wxString(BUILTIN_EFFECT_PREFIX) + name); } return true; diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index 96c726a78..1b9c7672a 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1751,7 +1751,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) { wxArrayString windowTypeChoices; for (int ii = 0; ii < WT_N_WINDOW_TYPES; ++ii) - windowTypeChoices.Add(windowTypesInfo[ii].name); + windowTypeChoices.push_back(windowTypesInfo[ii].name); S.TieChoice(_("&Window types") + wxString(wxT(":")), mTempSettings.mWindowTypes, &windowTypeChoices); @@ -1797,7 +1797,7 @@ void EffectNoiseReduction::Dialog::PopulateOrExchange(ShuttleGui & S) --nn; #endif for (int ii = 0; ii < nn; ++ii) - methodChoices.Add(discriminationMethodInfo[ii].name); + methodChoices.push_back(discriminationMethodInfo[ii].name); S.TieChoice(_("Discrimination &method") + wxString(wxT(":")), mTempSettings.mMethod, &methodChoices); diff --git a/src/effects/Reverb.cpp b/src/effects/Reverb.cpp index 8e743f1d4..627cb1ebc 100644 --- a/src/effects/Reverb.cpp +++ b/src/effects/Reverb.cpp @@ -332,7 +332,7 @@ wxArrayString EffectReverb::GetFactoryPresets() for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++) { - names.Add(wxGetTranslation(FactoryPresets[i].name)); + names.push_back(wxGetTranslation(FactoryPresets[i].name)); } return names; @@ -410,7 +410,7 @@ bool EffectReverb::Startup() gPrefs->Read(path + wxT("WetOnly"), &mParams.mWetOnly, DEF_WetOnly); gPrefs->Read(path + wxT("name"), &name, wxEmptyString); - if (!name.IsEmpty()) + if (!name.empty()) { name.Prepend(wxT(" - ")); } @@ -541,7 +541,7 @@ void EffectReverb::SetTitle(const wxString & name) { wxString title(_("Reverb")); - if (!name.IsEmpty()) + if (!name.empty()) { title += wxT(": ") + name; } diff --git a/src/effects/ScienFilter.cpp b/src/effects/ScienFilter.cpp index 33a4746a0..a6c05a63a 100644 --- a/src/effects/ScienFilter.cpp +++ b/src/effects/ScienFilter.cpp @@ -469,7 +469,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S) wxArrayString orders; for (int i = 1; i <= 10; i++) { - orders.Add(wxString::Format(wxT("%d"), i)); + orders.push_back(wxString::Format(wxT("%d"), i)); } /*i18n-hint: 'Order' means the complexity of the filter, and is a number between 1 and 10.*/ mFilterOrderCtl = S.Id(ID_Order).AddChoice(_("O&rder:"), wxT(""), &orders); diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index be2e39433..84f007840 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -396,7 +396,7 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) wxStringTokenizer tok(vstpath); while (tok.HasMoreTokens()) { - pathList.Add(tok.GetNextToken()); + pathList.push_back(tok.GetNextToken()); } } @@ -404,15 +404,15 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) #define VSTPATH wxT("/Library/Audio/Plug-Ins/VST") // Look in ~/Library/Audio/Plug-Ins/VST and /Library/Audio/Plug-Ins/VST - pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + VSTPATH); - pathList.Add(VSTPATH); + pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + VSTPATH); + pathList.push_back(VSTPATH); // Recursively search all paths for Info.plist files. This will identify all // bundles. pm.FindFilesInPathList(wxT("Info.plist"), pathList, files, true); // Remove the 'Contents/Info.plist' portion of the names - for (size_t i = 0; i < files.GetCount(); i++) + for (size_t i = 0; i < files.size(); i++) { files[i] = wxPathOnly(wxPathOnly(files[i])); if (!files[i].EndsWith(wxT(".vst"))) @@ -441,7 +441,7 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) tpath[len] = 0; dpath[0] = 0; ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath)); - pathList.Add(dpath); + pathList.push_back(dpath); } // Then try HKEY_LOCAL_MACHINE registry key @@ -458,7 +458,7 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) tpath[len] = 0; dpath[0] = 0; ExpandEnvironmentStrings(tpath, dpath, WXSIZEOF(dpath)); - pathList.Add(dpath); + pathList.push_back(dpath); } // Add the default path last @@ -466,7 +466,7 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) ExpandEnvironmentStrings(wxT("%ProgramFiles%\\Steinberg\\VSTPlugins"), dpath, WXSIZEOF(dpath)); - pathList.Add(dpath); + pathList.push_back(dpath); // Recursively scan for all DLLs pm.FindFilesInPathList(wxT("*.dll"), pathList, files, true); @@ -474,15 +474,15 @@ wxArrayString VSTEffectsModule::FindPluginPaths(PluginManagerInterface & pm) #else // Nothing specified in the VST_PATH environment variable...provide defaults - if (vstpath.IsEmpty()) + if (vstpath.empty()) { // We add this "non-default" one - pathList.Add(wxT(LIBDIR) wxT("/vst")); + pathList.push_back(wxT(LIBDIR) wxT("/vst")); // These are the defaults used by other hosts - pathList.Add(wxT("/usr/lib/vst")); - pathList.Add(wxT("/usr/local/lib/vst")); - pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".vst")); + pathList.push_back(wxT("/usr/lib/vst")); + pathList.push_back(wxT("/usr/local/lib/vst")); + pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".vst")); } // Recursively scan for all shared objects @@ -1633,7 +1633,7 @@ bool VSTEffect::GetAutomationParameters(CommandParameters & parms) for (int i = 0; i < mAEffect->numParams; i++) { wxString name = GetString(effGetParamName, i); - if (name.IsEmpty()) + if (name.empty()) { name.Printf(wxT("parm_%d"), i); } @@ -1654,7 +1654,7 @@ bool VSTEffect::SetAutomationParameters(CommandParameters & parms) for (int i = 0; i < mAEffect->numParams; i++) { wxString name = GetString(effGetParamName, i); - if (name.IsEmpty()) + if (name.empty()) { name.Printf(wxT("parm_%d"), i); } @@ -1706,7 +1706,7 @@ wxArrayString VSTEffect::GetFactoryPresets() { for (int i = 0; i < mAEffect->numPrograms; i++) { - progs.Add(GetString(effGetProgramNameIndexed, i)); + progs.push_back(GetString(effGetProgramNameIndexed, i)); } } @@ -1854,7 +1854,7 @@ void VSTEffect::ExportPresets() NULL); // User canceled... - if (path.IsEmpty()) + if (path.empty()) { return; } @@ -1906,7 +1906,7 @@ void VSTEffect::ImportPresets() mParent); // User canceled... - if (path.IsEmpty()) + if (path.empty()) { return; } @@ -2976,7 +2976,7 @@ void VSTEffect::RefreshParameters(int skip) name = text; text = GetString(effGetParamDisplay, i); - if (text.IsEmpty()) + if (text.empty()) { text.Printf(wxT("%.5g"),callGetParameter(i)); } @@ -2984,7 +2984,7 @@ void VSTEffect::RefreshParameters(int skip) name += wxT(' ') + text; text = GetString(effGetParamDisplay, i); - if (!text.IsEmpty()) + if (!text.empty()) { text.Printf(wxT("%-8s"), GetString(effGetParamLabel, i)); mLabels[i]->SetLabel(wxString::Format(wxT("%8s"), text)); diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index 04971758b..aa1455467 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -99,7 +99,7 @@ AudioUnitEffectsModule::AudioUnitEffectsModule(ModuleManagerInterface *moduleMan AudioUnitEffectsModule::~AudioUnitEffectsModule() { - mPath.Clear(); + mPath.clear(); } // ============================================================================ @@ -266,7 +266,7 @@ void AudioUnitEffectsModule::LoadAudioUnitsOfType(OSType inAUType, { wxString name = wxCFStringRef::AsString(cfName); - effects.Add(wxString::Format(wxT("%-4.4s/%-4.4s/%-4.4s/%s"), + effects.push_back(wxString::Format(wxT("%-4.4s/%-4.4s/%-4.4s/%s"), FromOSType(found.componentManufacturer), FromOSType(found.componentType), FromOSType(found.componentSubType), @@ -354,9 +354,9 @@ AudioUnitEffectOptionsDialog::AudioUnitEffectOptionsDialog(wxWindow * parent, Ef { mHost = host; - mUITypes.Add(_("Full")); - mUITypes.Add(_("Generic")); - mUITypes.Add(_("Basic")); + mUITypes.push_back(_("Full")); + mUITypes.push_back(_("Generic")); + mUITypes.push_back(_("Basic")); mHost->GetSharedConfig(wxT("Options"), wxT("UseLatency"), mUseLatency, true); mHost->GetSharedConfig(wxT("Options"), wxT("UIType"), mUIType, wxT("Full")); @@ -526,9 +526,9 @@ void AudioUnitEffectExportDialog::PopulateOrExchange(ShuttleGui & S) mEffect->mHost->GetPrivateConfigSubgroups(mEffect->mHost->GetUserPresetsGroup(wxEmptyString), presets); - presets.Sort(); + std::sort( presets.begin(), presets.end() ); - for (size_t i = 0, cnt = presets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = presets.size(); i < cnt; i++) { mList->InsertItem(i, presets[i]); } @@ -722,7 +722,7 @@ void AudioUnitEffectImportDialog::PopulateOrExchange(ShuttleGui & S) presets.Sort(); - for (size_t i = 0, cnt = presets.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = presets.size(); i < cnt; i++) { fn = presets[i]; mList->InsertItem(i, fn.GetName()); @@ -1515,7 +1515,7 @@ bool AudioUnitEffect::GetAutomationParameters(CommandParameters & parms) name = wxCFStringRef::AsString(info.cfNameString); } - if (name.IsEmpty()) + if (name.empty()) { continue; } @@ -1588,7 +1588,7 @@ bool AudioUnitEffect::SetAutomationParameters(CommandParameters & parms) name = wxCFStringRef::AsString(info.cfNameString); } - if (name.IsEmpty()) + if (name.empty()) { continue; } @@ -1703,7 +1703,7 @@ wxArrayString AudioUnitEffect::GetFactoryPresets() for (CFIndex i = 0, cnt = CFArrayGetCount(array); i < cnt; i++) { AUPreset *preset = (AUPreset *) CFArrayGetValueAtIndex(array, i); - presets.Add(wxCFStringRef::AsString(preset->presetName)); + presets.push_back(wxCFStringRef::AsString(preset->presetName)); } } diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 4fb647aea..fbacc4a26 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -196,9 +196,9 @@ bool LadspaEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm) for (int i = 0; i < (int)WXSIZEOF(kShippedEffects); i++) { - files.Clear(); + files.clear(); pm.FindFilesInPathList(kShippedEffects[i], pathList, files); - for (size_t j = 0, cnt = files.GetCount(); j < cnt; j++) + for (size_t j = 0, cnt = files.size(); j < cnt; j++) { if (!pm.IsPluginRegistered(files[j])) { @@ -342,7 +342,7 @@ wxArrayString LadspaEffectsModule::GetSearchPaths() wxStringTokenizer tok(pathVar); while (tok.HasMoreTokens()) { - pathList.Add(tok.GetNextToken()); + pathList.push_back(tok.GetNextToken()); } } @@ -350,8 +350,8 @@ wxArrayString LadspaEffectsModule::GetSearchPaths() #define LADSPAPATH wxT("/Library/Audio/Plug-Ins/LADSPA") // Look in ~/Library/Audio/Plug-Ins/LADSPA and /Library/Audio/Plug-Ins/LADSPA - pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + LADSPAPATH); - pathList.Add(LADSPAPATH); + pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + LADSPAPATH); + pathList.push_back(LADSPAPATH); #elif defined(__WXMSW__) @@ -359,10 +359,10 @@ wxArrayString LadspaEffectsModule::GetSearchPaths() #else - pathList.Add(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".ladspa")); - pathList.Add(wxT("/usr/local/lib/ladspa")); - pathList.Add(wxT("/usr/lib/ladspa")); - pathList.Add(wxT(LIBDIR) wxT("/ladspa")); + pathList.push_back(wxGetHomeDir() + wxFILE_SEP_PATH + wxT(".ladspa")); + pathList.push_back(wxT("/usr/local/lib/ladspa")); + pathList.push_back(wxT("/usr/lib/ladspa")); + pathList.push_back(wxT(LIBDIR) wxT("/ladspa")); #endif diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index c500e9d79..ab3f43994 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -339,7 +339,7 @@ ComponentInterfaceSymbol LV2Effect::GetVendor() { wxString vendor = LilvString(lilv_plugin_get_author_name(mPlug), true); - if (vendor.IsEmpty()) + if (vendor.empty()) { vendor = XO("n/a"); } @@ -493,12 +493,12 @@ bool LV2Effect::SetHost(EffectHostInterface *host) if (group) { ctrl.mGroup = LilvString(lilv_world_get(gWorld, group, gLabel, NULL)); - if (ctrl.mGroup.IsEmpty()) + if (ctrl.mGroup.empty()) { ctrl.mGroup = LilvString(lilv_world_get(gWorld, group, gName, NULL)); } - if (ctrl.mGroup.IsEmpty()) + if (ctrl.mGroup.empty()) { ctrl.mGroup = LilvString(group); } @@ -507,7 +507,7 @@ bool LV2Effect::SetHost(EffectHostInterface *host) // Add it if not previously done if (mGroups.Index(ctrl.mGroup) == wxNOT_FOUND) { - mGroups.Add(ctrl.mGroup); + mGroups.push_back(ctrl.mGroup); } // Get the scale points @@ -517,7 +517,7 @@ bool LV2Effect::SetHost(EffectHostInterface *host) const LilvScalePoint *point = lilv_scale_points_get(points, j); ctrl.mScaleValues.push_back(lilv_node_as_float(lilv_scale_point_get_value(point))); - ctrl.mScaleLabels.Add(LilvString(lilv_scale_point_get_label(point))); + ctrl.mScaleLabels.push_back(LilvString(lilv_scale_point_get_label(point))); } lilv_scale_points_free(points); @@ -1147,7 +1147,7 @@ wxArrayString LV2Effect::GetFactoryPresets() { const LilvNode *preset = lilv_nodes_get(presets, i); - mFactoryPresetUris.Add(LilvString(preset)); + mFactoryPresetUris.push_back(LilvString(preset)); lilv_world_load_resource(gWorld, preset); @@ -1156,13 +1156,13 @@ wxArrayString LV2Effect::GetFactoryPresets() { const LilvNode *label = lilv_nodes_get_first(labels); - mFactoryPresetNames.Add(LilvString(label)); + mFactoryPresetNames.push_back(LilvString(label)); lilv_nodes_free(labels); } else { - mFactoryPresetNames.Add(LilvString(preset).AfterLast(wxT('#'))); + mFactoryPresetNames.push_back(LilvString(preset).AfterLast(wxT('#'))); } } @@ -1176,7 +1176,7 @@ wxArrayString LV2Effect::GetFactoryPresets() bool LV2Effect::LoadFactoryPreset(int id) { - if (id < 0 || id >= (int) mFactoryPresetUris.GetCount()) + if (id < 0 || id >= (int) mFactoryPresetUris.size()) { return false; } @@ -1570,12 +1570,12 @@ bool LV2Effect::BuildPlain() innerSizer->Add(groupSizer.release(), 0, wxEXPAND | wxALL, 5); } - mGroups.Sort(); + std::sort( mGroups.begin(), mGroups.end() ); - for (size_t i = 0, groupCount = mGroups.GetCount(); i < groupCount; i++) + for (size_t i = 0, groupCount = mGroups.size(); i < groupCount; i++) { wxString label = mGroups[i]; - if (label.IsEmpty()) + if (label.empty()) { label = _("Effect Settings"); } @@ -1590,7 +1590,7 @@ bool LV2Effect::BuildPlain() int p = params[pi]; LV2Port & ctrl = mControls[p]; wxString labelText = ctrl.mName; - if (!ctrl.mUnits.IsEmpty()) + if (!ctrl.mUnits.empty()) { labelText += wxT(" (") + ctrl.mUnits + wxT(")"); } @@ -1838,7 +1838,7 @@ bool LV2Effect::TransferDataToWindow() return true; } - for (size_t i = 0, groupCount = mGroups.GetCount(); i < groupCount; i++) + for (size_t i = 0, groupCount = mGroups.size(); i < groupCount; i++) { const auto & params = mGroupMap[mGroups[i]]; for (size_t pi = 0, ParamCount = params.size(); pi < ParamCount; pi++) diff --git a/src/effects/lv2/LoadLV2.cpp b/src/effects/lv2/LoadLV2.cpp index f95e805a5..63421de35 100644 --- a/src/effects/lv2/LoadLV2.cpp +++ b/src/effects/lv2/LoadLV2.cpp @@ -181,7 +181,7 @@ bool LV2EffectsModule::Initialize() wxString pathVar; wxGetEnv(wxT("LV2_PATH"), &pathVar); - if (pathVar.IsEmpty()) + if (pathVar.empty()) { pathVar = newVar.Mid(1); } @@ -233,7 +233,7 @@ wxArrayString LV2EffectsModule::FindPluginPaths(PluginManagerInterface & WXUNUSE continue; } - plugins.Add(LilvString(lilv_plugin_get_uri(plug))); + plugins.push_back(LilvString(lilv_plugin_get_uri(plug))); } return plugins; diff --git a/src/effects/nyquist/LoadNyquist.cpp b/src/effects/nyquist/LoadNyquist.cpp index ce7b027f2..aa85cf70f 100644 --- a/src/effects/nyquist/LoadNyquist.cpp +++ b/src/effects/nyquist/LoadNyquist.cpp @@ -89,7 +89,7 @@ NyquistEffectsModule::NyquistEffectsModule(ModuleManagerInterface *moduleManager NyquistEffectsModule::~NyquistEffectsModule() { - mPath.Clear(); + mPath.clear(); } // ============================================================================ @@ -130,7 +130,7 @@ bool NyquistEffectsModule::Initialize() { wxArrayString audacityPathList = wxGetApp().audacityPathList; - for (size_t i = 0, cnt = audacityPathList.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = audacityPathList.size(); i < cnt; i++) { wxFileName name(audacityPathList[i], wxT("")); name.AppendDir(wxT("nyquist")); @@ -184,9 +184,9 @@ bool NyquistEffectsModule::AutoRegisterPlugins(PluginManagerInterface & pm) for (size_t i = 0; i < WXSIZEOF(kShippedEffects); i++) { - files.Clear(); + files.clear(); pm.FindFilesInPathList(kShippedEffects[i], pathList, files); - for (size_t j = 0, cnt = files.GetCount(); j < cnt; j++) + for (size_t j = 0, cnt = files.size(); j < cnt; j++) { if (!pm.IsPluginRegistered(files[j])) { @@ -207,7 +207,7 @@ wxArrayString NyquistEffectsModule::FindPluginPaths(PluginManagerInterface & pm) wxArrayString files; // Add the Nyquist prompt - files.Add(NYQUIST_PROMPT_ID); + files.push_back(NYQUIST_PROMPT_ID); // Load .ny plug-ins pm.FindFilesInPathList(wxT("*.ny"), pathList, files); diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 9218c8d36..1cc20299a 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -238,7 +238,7 @@ wxString NyquistEffect::HelpPage() wxArrayString paths = NyquistEffect::GetNyquistSearchPath(); wxString fileName; - for (size_t i = 0, cnt = paths.GetCount(); i < cnt; i++) { + for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { fileName = wxFileName(paths[i] + wxT("/") + mHelpFile).GetFullPath(); if (wxFileExists(fileName)) { mHelpFileExists = true; @@ -636,8 +636,8 @@ bool NyquistEffect::Process() ? 0 : mOutputTracks->Selected< const WaveTrack >().size(); - mDebugOutput.Clear(); - if (!mHelpFile.IsEmpty() && !mHelpFileExists) { + mDebugOutput.clear(); + if (!mHelpFile.empty() && !mHelpFileExists) { mDebugOutput = wxString::Format(_("error: File \"%s\" specified in header but not found in plug-in path.\n"), mHelpFile); } @@ -664,7 +664,7 @@ bool NyquistEffect::Process() wxArrayString paths = NyquistEffect::GetNyquistSearchPath(); wxString list; - for (size_t i = 0, cnt = paths.GetCount(); i < cnt; i++) + for (size_t i = 0, cnt = paths.size(); i < cnt; i++) { list += wxT("\"") + EscapeString(paths[i]) + wxT("\" "); } @@ -905,7 +905,7 @@ bool NyquistEffect::Process() finish: // Show debug window if trace set in plug-in header and something to show. - mDebug = (mTrace && !mDebugOutput.IsEmpty())? true : mDebug; + mDebug = (mTrace && !mDebugOutput.empty())? true : mDebug; if (mDebug && !mRedirectOutput) { NyquistOutputDialog dlog(mUIParent, -1, @@ -1302,7 +1302,7 @@ bool NyquistEffect::ProcessOne() rval = nyx_eval_expression(cmd.mb_str(wxConvUTF8)); // If we're not showing debug window, log errors and warnings: - if (!mDebugOutput.IsEmpty() && !mDebug && !mTrace) { + if (!mDebugOutput.empty() && !mDebug && !mTrace) { /* i18n-hint: An effect "returned" a message.*/ wxLogMessage(_("\'%s\' returned:\n%s"), mName, mDebugOutput); } @@ -1340,7 +1340,7 @@ bool NyquistEffect::ProcessOne() if (mTrace) { /* i18n-hint: "%s" is replaced by name of plug-in.*/ mDebugOutput = wxString::Format(_("nyx_error returned from %s.\n"), - mName.IsEmpty()? _("plug-in") : mName) + mDebugOutput; + mName.empty()? _("plug-in") : mName) + mDebugOutput; mDebug = true; } else { @@ -1351,7 +1351,7 @@ bool NyquistEffect::ProcessOne() if (rval == nyx_string) { wxString msg = NyquistToWxString(nyx_get_string()); - if (!msg.IsEmpty()) // Empty string may be used as a No-Op return value. + if (!msg.empty()) // Empty string may be used as a No-Op return value. Effect::MessageBox(msg); else return true; @@ -1511,7 +1511,7 @@ bool NyquistEffect::ProcessOne() wxString NyquistEffect::NyquistToWxString(const char *nyqString) { wxString str(nyqString, wxConvUTF8); - if (nyqString != NULL && nyqString[0] && str.IsEmpty()) { + if (nyqString != NULL && nyqString[0] && str.empty()) { // invalid UTF-8 string, convert as Latin-1 str = _("[Warning: Nyquist returned invalid UTF-8 string, converted here as Latin-1]"); // TODO: internationalization of strings from Nyquist effects, at least @@ -2080,8 +2080,8 @@ bool NyquistEffect::Parse( // Deprecated if (len >= 2 && tokens[0] == wxT("categories")) { - for (size_t i = 1; i < tokens.GetCount(); ++i) { - mCategories.Add(tokens[i]); + for (size_t i = 1; i < tokens.size(); ++i) { + mCategories.push_back(tokens[i]); } } return true; @@ -2100,7 +2100,7 @@ bool NyquistEffect::ParseProgram(wxInputStream & stream) mCmd = wxT(""); mIsSal = false; mControls.clear(); - mCategories.Clear(); + mCategories.clear(); mIsSpectral = false; mManPage = wxEmptyString; // If not wxEmptyString, must be a page in the Audacity manual. mHelpFile = wxEmptyString; // If not wxEmptyString, must be a valid HTML help file. @@ -2346,14 +2346,14 @@ wxArrayString NyquistEffect::GetNyquistSearchPath() wxArrayString audacityPathList = wxGetApp().audacityPathList; wxArrayString pathList; - for (size_t i = 0; i < audacityPathList.GetCount(); i++) + for (size_t i = 0; i < audacityPathList.size(); i++) { wxString prefix = audacityPathList[i] + wxFILE_SEP_PATH; wxGetApp().AddUniquePathToPathList(prefix + wxT("nyquist"), pathList); wxGetApp().AddUniquePathToPathList(prefix + wxT("plugins"), pathList); wxGetApp().AddUniquePathToPathList(prefix + wxT("plug-ins"), pathList); } - pathList.Add(FileNames::PlugInDir()); + pathList.push_back(FileNames::PlugInDir()); return pathList; } @@ -2707,7 +2707,7 @@ void NyquistEffect::BuildEffectWindow(ShuttleGui & S) if (ctrl.type != NYQ_CTRL_FILE) { - if (ctrl.type == NYQ_CTRL_CHOICE || ctrl.label.IsEmpty()) + if (ctrl.type == NYQ_CTRL_CHOICE || ctrl.label.empty()) { S.AddSpace(10, 10); } @@ -2956,7 +2956,7 @@ void NyquistEffect::OnFileButton(wxCommandEvent& evt) wxArrayString selectedFiles; openFileDialog.GetPaths(selectedFiles); - for (size_t sf = 0; sf < selectedFiles.GetCount(); sf++) { + for (size_t sf = 0; sf < selectedFiles.size(); sf++) { path += "\""; path += selectedFiles[sf]; path += "\""; @@ -2992,7 +2992,7 @@ void NyquistEffect::resolveFilePath(wxString& path, wxString extension /* empty int characters = path.Find(wxFileName::GetPathSeparator()); if(characters == wxNOT_FOUND) // Just a path or just a file name { - if (path.IsEmpty()) + if (path.empty()) path = "*default*"; if (pathKeys.find(path) != pathKeys.end()) @@ -3023,7 +3023,7 @@ void NyquistEffect::resolveFilePath(wxString& path, wxString extension /* empty if (fname.wxFileName::IsOk() && fname.GetFullName() == wxEmptyString) { path = fname.GetPathWithSep() + _("untitled"); - if (!extension.IsEmpty()) + if (!extension.empty()) path = path + extension; } } diff --git a/src/effects/vamp/LoadVamp.cpp b/src/effects/vamp/LoadVamp.cpp index a5bb11d10..2ff425cd7 100644 --- a/src/effects/vamp/LoadVamp.cpp +++ b/src/effects/vamp/LoadVamp.cpp @@ -185,7 +185,7 @@ wxArrayString VampEffectsModule::FindPluginPaths(PluginManagerInterface & WXUNUS } wxString path = wxString::FromUTF8(i->c_str()) + wxT("/") + name; - names.Add(path); + names.push_back(path); ++output; } diff --git a/src/effects/vamp/VampEffect.cpp b/src/effects/vamp/VampEffect.cpp index 7c7e0a55c..a49ec469a 100644 --- a/src/effects/vamp/VampEffect.cpp +++ b/src/effects/vamp/VampEffect.cpp @@ -561,7 +561,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) wxArrayString choices; for (size_t i = 0, cnt = programs.size(); i < cnt; i++) { - choices.Add(wxString::FromUTF8(programs[i].c_str())); + choices.push_back(wxString::FromUTF8(programs[i].c_str())); } S.AddPrompt(_("Program")); @@ -592,7 +592,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mValues[p] = 0.0; wxString labelText = wxString::FromUTF8(mParameters[p].name.c_str()); - if (!unit.IsEmpty()) + if (!unit.empty()) { labelText += wxT(" (") + unit + wxT(")"); } @@ -607,7 +607,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mToggles[p] = S.AddCheckBox( {}, value > 0.5 ? wxT("true") : wxT("false")); mToggles[p]->SetName(labelText); - if (!tip.IsEmpty()) + if (!tip.empty()) { mToggles[p]->SetToolTip(tip); } @@ -633,14 +633,14 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) { selected = choice; } - choices.Add(choice); + choices.push_back(choice); } S.Id(ID_Choices + p); mChoices[p] = S.AddChoice( {}, selected, &choices); mChoices[p]->SetName(labelText); mChoices[p]->SetSizeHints(-1, -1); - if (!tip.IsEmpty()) + if (!tip.empty()) { mChoices[p]->SetToolTip(tip); } @@ -667,7 +667,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mFields[p] = S.AddTextBox( {}, wxT(""), 12); mFields[p]->SetName(labelText); mFields[p]->SetValidator(vld); - if (!tip.IsEmpty()) + if (!tip.empty()) { mFields[p]->SetToolTip(tip); } @@ -682,7 +682,7 @@ void VampEffect::PopulateOrExchange(ShuttleGui & S) mSliders[p] = S.AddSlider( {}, 0, 1000, 0); mSliders[p]->SetName(labelText); mSliders[p]->SetSizeHints(150, -1); - if (!tip.IsEmpty()) + if (!tip.empty()) { mSliders[p]->SetToolTip(tip); } diff --git a/src/export/Export.cpp b/src/export/Export.cpp index f13f32346..373d6927e 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -125,7 +125,7 @@ void ExportPlugin::SetDescription(const wxString & description, int index) void ExportPlugin::AddExtension(const wxString &extension,int index) { - mFormatInfos[index].mExtensions.Add(extension); + mFormatInfos[index].mExtensions.push_back(extension); } void ExportPlugin::SetExtensions(const wxArrayString & extensions, int index) @@ -170,7 +170,7 @@ wxArrayString ExportPlugin::GetExtensions(int index) wxString ExportPlugin::GetMask(int index) { - if (!mFormatInfos[index].mMask.IsEmpty()) { + if (!mFormatInfos[index].mMask.empty()) { return mFormatInfos[index].mMask; } @@ -179,7 +179,7 @@ wxString ExportPlugin::GetMask(int index) // Build the mask // wxString ext = GetExtension(index); wxArrayString exts = GetExtensions(index); - for (size_t i = 0; i < exts.GetCount(); i++) { + for (size_t i = 0; i < exts.size(); i++) { mask += wxT("*.") + exts[i] + wxT(";"); } @@ -527,7 +527,7 @@ bool Exporter::GetFilename() wxString maskString; wxString defaultFormat = mFormatName; - if( defaultFormat.IsEmpty() ) + if( defaultFormat.empty() ) defaultFormat = gPrefs->Read(wxT("/Export/Format"), wxT("WAV")); @@ -624,7 +624,7 @@ bool Exporter::GetFilename() // Check the extension - add the default if it's not there, // and warn user if it's abnormal. // - if (ext.IsEmpty()) { + if (ext.empty()) { // // Make sure the user doesn't accidentally save the file // as an extension with no name, like just plain ".wav". @@ -648,7 +648,7 @@ bool Exporter::GetFilename() { continue; } - else if (!ext.IsEmpty() && !mPlugins[mFormat]->IsExtension(ext,mSubFormat) && ext.CmpNoCase(defext)) { + else if (!ext.empty() && !mPlugins[mFormat]->IsExtension(ext,mSubFormat) && ext.CmpNoCase(defext)) { wxString prompt; prompt.Printf(_("You are about to export a %s file with the name \"%s\".\n\nNormally these files end in \".%s\", and some programs will not open files with nonstandard extensions.\n\nAre you sure you want to export the file under this name?"), mPlugins[mFormat]->GetFormat(mSubFormat), @@ -730,7 +730,7 @@ bool Exporter::CheckFilename() if (!mProject->GetDirManager()->EnsureSafeFilename(mFilename)) return false; - if( mFormatName.IsEmpty() ) + if( mFormatName.empty() ) gPrefs->Write(wxT("/Export/Format"), mPlugins[mFormat]->GetFormat(mSubFormat)); gPrefs->Write(wxT("/Export/Path"), mFilename.GetPath()); gPrefs->Flush(); @@ -1311,12 +1311,12 @@ ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly const wxString sTrackName = (t->GetName()).Left(20); if( t->GetChannel() == Track::LeftChannel ) /* i18n-hint: track name and L abbreviating Left channel */ - mTrackNames.Add( wxString::Format( _( "%s - L" ), sTrackName ) ); + mTrackNames.push_back( wxString::Format( _( "%s - L" ), sTrackName ) ); else if( t->GetChannel() == Track::RightChannel ) /* i18n-hint: track name and R abbreviating Right channel */ - mTrackNames.Add( wxString::Format( _( "%s - R" ), sTrackName ) ); + mTrackNames.push_back( wxString::Format( _( "%s - R" ), sTrackName ) ); else - mTrackNames.Add(sTrackName); + mTrackNames.push_back(sTrackName); } // JKC: This is an attempt to fix a 'watching brief' issue, where the slider is diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index a7d00b1c5..02c1f7bbc 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -103,7 +103,7 @@ void ExportCLOptions::PopulateOrExchange(ShuttleGui & S) wxString cmd; for (size_t i = 0; i < mHistory.GetCount(); i++) { - cmds.Add(mHistory.GetHistoryFile(i)); + cmds.push_back(mHistory.GetHistoryFile(i)); } cmd = cmds[0]; @@ -178,7 +178,7 @@ void ExportCLOptions::OnBrowse(wxCommandEvent& WXUNUSED(event)) wxT("*") + ext, wxFD_OPEN | wxRESIZE_BORDER, this); - if (path.IsEmpty()) { + if (path.empty()) { return; } @@ -347,7 +347,7 @@ ProgressResult ExportCL::Export(AudacityProject *project, if (reg.Exists()) { wxString ipath; reg.QueryValue(wxT("InstallPath"), ipath); - if (!ipath.IsEmpty()) { + if (!ipath.empty()) { npath += wxPATH_SEP + ipath; } } @@ -362,7 +362,7 @@ ProgressResult ExportCL::Export(AudacityProject *project, { #if defined(__WXMSW__) auto cleanup = finally( [&] { - if (!opath.IsEmpty()) { + if (!opath.empty()) { wxSetEnv(wxT("PATH"),opath); } } ); diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index 67a3e4e53..7b4dbaed0 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -1027,7 +1027,7 @@ int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate, if (label >= lowrate && label <= highrate) { wxString name = wxString::Format(wxT("%d"),label); - choices.Add(name); + choices.push_back(name); if (label <= rate) { selected = name; @@ -1035,7 +1035,7 @@ int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate, } } - if (selected.IsEmpty()) + if (selected.empty()) { selected = choices[0]; } diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index 42bc5e2a4..a06a6e8b7 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -149,7 +149,7 @@ ExportFFmpegAC3Options::ExportFFmpegAC3Options(wxWindow *parent, int WXUNUSED(fo { for (unsigned int i=0; i < (sizeof(iAC3BitRates)/sizeof(int)); i++) { - mBitRateNames.Add(wxString::Format(_("%i kbps"),iAC3BitRates[i]/1000)); + mBitRateNames.push_back(wxString::Format(_("%i kbps"),iAC3BitRates[i]/1000)); mBitRateLabels.push_back(iAC3BitRates[i]); } @@ -275,7 +275,7 @@ ExportFFmpegAMRNBOptions::ExportFFmpegAMRNBOptions(wxWindow *parent, int WXUNUSE { for (unsigned int i=0; i < (sizeof(iAMRNBBitRate)/sizeof(int)); i++) { - mBitRateNames.Add(wxString::Format(_("%.2f kbps"),(float)iAMRNBBitRate[i]/1000)); + mBitRateNames.push_back(wxString::Format(_("%.2f kbps"),(float)iAMRNBBitRate[i]/1000)); mBitRateLabels.push_back(iAMRNBBitRate[i]); } @@ -346,7 +346,7 @@ ExportFFmpegWMAOptions::ExportFFmpegWMAOptions(wxWindow *parent, int WXUNUSED(fo for (unsigned int i=0; i < (sizeof(iWMABitRate)/sizeof(int)); i++) { /* i18n-hint: abbreviates thousands of bits per second */ - mBitRateNames.Add(wxString::Format(_("%i kbps"),iWMABitRate[i]/1000)); + mBitRateNames.push_back(wxString::Format(_("%i kbps"),iWMABitRate[i]/1000)); mBitRateLabels.push_back(iWMABitRate[i]); } @@ -476,7 +476,7 @@ void ExportFFmpegCustomOptions::OnOpen(wxCommandEvent & WXUNUSED(evt)) FFmpegPreset::FFmpegPreset() { - mControlState.SetCount(FELastID - FEFirstID); + mControlState.resize(FELastID - FEFirstID); } FFmpegPreset::~FFmpegPreset() @@ -532,14 +532,14 @@ void FFmpegPresets::ExportPresets(wxString &filename) void FFmpegPresets::GetPresetList(wxArrayString &list) { - list.Clear(); + list.clear(); FFmpegPresetMap::iterator iter; for (iter = mPresets.begin(); iter != mPresets.end(); ++iter) { - list.Add(iter->second.mPresetName); + list.push_back(iter->second.mPresetName); } - list.Sort(); + std::sort( list.begin(), list.end() ); } void FFmpegPresets::DeletePreset(wxString &name) @@ -613,10 +613,10 @@ void FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name) switch(id) { case FEFormatID: - preset->mControlState.Item(id - FEFirstID) = format; + preset->mControlState[id - FEFirstID] = format; break; case FECodecID: - preset->mControlState.Item(id - FEFirstID) = codec; + preset->mControlState[id - FEFirstID] = codec; break; // Spin control case FEBitrateID: @@ -634,26 +634,26 @@ void FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name) case FEMuxRateID: case FEPacketSizeID: sc = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID) = wxString::Format(wxT("%d"),sc->GetValue()); + preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),sc->GetValue()); break; // Text control case FELanguageID: case FETagID: tc = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID) = tc->GetValue(); + preset->mControlState[id - FEFirstID] = tc->GetValue(); break; // Choice case FEProfileID: case FEPredOrderID: ch = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID) = wxString::Format(wxT("%d"),ch->GetSelection()); + preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),ch->GetSelection()); break; // Check box case FEUseLPCID: case FEBitReservoirID: case FEVariableBlockLenID: cb = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID) = wxString::Format(wxT("%d"),cb->GetValue()); + preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),cb->GetValue()); break; } } @@ -689,7 +689,7 @@ void FFmpegPresets::LoadPreset(ExportFFmpegOptions *parent, wxString &name) case FEFormatID: case FECodecID: lb = dynamic_cast(wnd); - readstr = preset->mControlState.Item(id - FEFirstID); + readstr = preset->mControlState[id - FEFirstID]; readlong = lb->FindString(readstr); if (readlong > -1) lb->Select(readlong); break; @@ -709,20 +709,20 @@ void FFmpegPresets::LoadPreset(ExportFFmpegOptions *parent, wxString &name) case FEMuxRateID: case FEPacketSizeID: sc = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID).ToLong(&readlong); + preset->mControlState[id - FEFirstID].ToLong(&readlong); sc->SetValue(readlong); break; // Text control case FELanguageID: case FETagID: tc = dynamic_cast(wnd); - tc->SetValue(preset->mControlState.Item(id - FEFirstID)); + tc->SetValue(preset->mControlState[id - FEFirstID]); break; // Choice case FEProfileID: case FEPredOrderID: ch = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID).ToLong(&readlong); + preset->mControlState[id - FEFirstID].ToLong(&readlong); if (readlong > -1) ch->Select(readlong); break; // Check box @@ -730,7 +730,7 @@ void FFmpegPresets::LoadPreset(ExportFFmpegOptions *parent, wxString &name) case FEBitReservoirID: case FEVariableBlockLenID: cb = dynamic_cast(wnd); - preset->mControlState.Item(id - FEFirstID).ToLong(&readlong); + preset->mControlState[id - FEFirstID].ToLong(&readlong); if (readlong) readbool = true; else readbool = false; cb->SetValue(readbool); break; @@ -810,7 +810,7 @@ bool FFmpegPresets::HandleXMLTag(const wxChar *tag, const wxChar **attrs) else if (!wxStrcmp(attr,wxT("state"))) { if (id > FEFirstID && id < FELastID) - mPreset->mControlState.Item(id - FEFirstID) = wxString(value); + mPreset->mControlState[id - FEFirstID] = wxString(value); } } return true; @@ -872,7 +872,7 @@ void FFmpegPresets::WriteXML(XMLWriter &xmlFile) const { xmlFile.StartTag(wxT("setctrlstate")); xmlFile.WriteAttr(wxT("id"),wxString(FFmpegExportCtrlIDNames[i - FEFirstID])); - xmlFile.WriteAttr(wxT("state"),preset->mControlState.Item(i - FEFirstID)); + xmlFile.WriteAttr(wxT("state"),preset->mControlState[i - FEFirstID]); xmlFile.EndTag(wxT("setctrlstate")); } xmlFile.EndTag(wxT("preset")); @@ -1385,12 +1385,12 @@ ExportFFmpegOptions::ExportFFmpegOptions(wxWindow *parent) for (unsigned int i = 0; i < 6; i++) { mPredictionOrderMethodLabels.push_back(i); - mPredictionOrderMethodNames.Add(wxString::Format(wxT("%s"),PredictionOrderMethodNames(i))); + mPredictionOrderMethodNames.push_back(wxString::Format(wxT("%s"),PredictionOrderMethodNames(i))); } for (unsigned int i=0; i < (sizeof(iAACProfileValues)/sizeof(int)); i++) { - mProfileNames.Add(wxString::Format(wxT("%s"),iAACProfileNames(i))); + mProfileNames.push_back(wxString::Format(wxT("%s"),iAACProfileNames(i))); mProfileLabels.push_back(iAACProfileValues[i]); } @@ -1420,8 +1420,8 @@ void ExportFFmpegOptions::FetchFormatList() // If it doesn't, then it doesn't supports any audio codecs if (ofmt->audio_codec != AV_CODEC_ID_NONE) { - mFormatNames.Add(wxString::FromUTF8(ofmt->name)); - mFormatLongNames.Add(wxString::Format(wxT("%s - %s"),mFormatNames.Last(),wxString::FromUTF8(ofmt->long_name))); + mFormatNames.push_back(wxString::FromUTF8(ofmt->name)); + mFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),mFormatNames.back(),wxString::FromUTF8(ofmt->long_name))); } } // Show all formats @@ -1440,8 +1440,8 @@ void ExportFFmpegOptions::FetchCodecList() // We're only interested in audio and only in encoders if (codec->type == AVMEDIA_TYPE_AUDIO && av_codec_is_encoder(codec)) { - mCodecNames.Add(wxString::FromUTF8(codec->name)); - mCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mCodecNames.Last(),wxString::FromUTF8(codec->long_name))); + mCodecNames.push_back(wxString::FromUTF8(codec->name)); + mCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mCodecNames.back(),wxString::FromUTF8(codec->long_name))); } } // Show all codecs @@ -1660,8 +1660,8 @@ int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID i // By default assume that id is not in the list int index = -1; // By default no codecs are compatible (yet) - mShownCodecNames.Clear(); - mShownCodecLongNames.Clear(); + mShownCodecNames.clear(); + mShownCodecLongNames.clear(); // Clear the listbox mCodecList->Clear(); // Zero - format is not found at all @@ -1685,9 +1685,9 @@ int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID i if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec)) { // If it was selected - remember it's NEW index - if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount(); - mShownCodecNames.Add(wxString::FromUTF8(codec->name)); - mShownCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mShownCodecNames.Last(),wxString::FromUTF8(codec->long_name))); + if ((id >= 0) && codec->id == id) index = mShownCodecNames.size(); + mShownCodecNames.push_back(wxString::FromUTF8(codec->name)); + mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name))); } } } @@ -1701,9 +1701,9 @@ int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID i { if (mShownCodecNames.Index(wxString::FromUTF8(codec->name)) < 0) { - if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount(); - mShownCodecNames.Add(wxString::FromUTF8(codec->name)); - mShownCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mShownCodecNames.Last(),wxString::FromUTF8(codec->long_name))); + if ((id >= 0) && codec->id == id) index = mShownCodecNames.size(); + mShownCodecNames.push_back(wxString::FromUTF8(codec->name)); + mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name))); } } } @@ -1719,9 +1719,9 @@ int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID i AVCodec *codec = avcodec_find_encoder(format->audio_codec); if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec)) { - if ((id >= 0) && codec->id == id) index = mShownCodecNames.GetCount(); - mShownCodecNames.Add(wxString::FromUTF8(codec->name)); - mShownCodecLongNames.Add(wxString::Format(wxT("%s - %s"),mShownCodecNames.Last(),wxString::FromUTF8(codec->long_name))); + if ((id >= 0) && codec->id == id) index = mShownCodecNames.size(); + mShownCodecNames.push_back(wxString::FromUTF8(codec->name)); + mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name))); } } } @@ -1736,8 +1736,8 @@ int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID i int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfmt) { int index = -1; - mShownFormatNames.Clear(); - mShownFormatLongNames.Clear(); + mShownFormatNames.clear(); + mShownFormatLongNames.clear(); mFormatList->Clear(); AVOutputFormat *ofmt = NULL; ofmt = NULL; @@ -1747,11 +1747,11 @@ int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfm { if (CompatibilityList[i].codec == id || CompatibilityList[i].codec == AV_CODEC_ID_NONE) { - if ((selfmt != NULL) && (selfmt->Cmp(CompatibilityList[i].fmt) == 0)) index = mShownFormatNames.GetCount(); - FromList.Add(CompatibilityList[i].fmt); - mShownFormatNames.Add(CompatibilityList[i].fmt); + if ((selfmt != NULL) && (selfmt->Cmp(CompatibilityList[i].fmt) == 0)) index = mShownFormatNames.size(); + FromList.push_back(CompatibilityList[i].fmt); + mShownFormatNames.push_back(CompatibilityList[i].fmt); AVOutputFormat *tofmt = av_guess_format(wxString(CompatibilityList[i].fmt).ToUTF8(),NULL,NULL); - if (tofmt != NULL) mShownFormatLongNames.Add(wxString::Format(wxT("%s - %s"),CompatibilityList[i].fmt,wxString::FromUTF8(tofmt->long_name))); + if (tofmt != NULL) mShownFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),CompatibilityList[i].fmt,wxString::FromUTF8(tofmt->long_name))); } } bool found = false; @@ -1776,7 +1776,7 @@ int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfm { wxString ofmtname = wxString::FromUTF8(ofmt->name); found = false; - for (unsigned int i = 0; i < FromList.GetCount(); i++) + for (unsigned int i = 0; i < FromList.size(); i++) { if (ofmtname.Cmp(FromList[i]) == 0) { @@ -1786,9 +1786,9 @@ int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfm } if (!found) { - if ((selfmt != NULL) && (selfmt->Cmp(wxString::FromUTF8(ofmt->name)) == 0)) index = mShownFormatNames.GetCount(); - mShownFormatNames.Add(wxString::FromUTF8(ofmt->name)); - mShownFormatLongNames.Add(wxString::Format(wxT("%s - %s"),mShownFormatNames.Last(),wxString::FromUTF8(ofmt->long_name))); + if ((selfmt != NULL) && (selfmt->Cmp(wxString::FromUTF8(ofmt->name)) == 0)) index = mShownFormatNames.size(); + mShownFormatNames.push_back(wxString::FromUTF8(ofmt->name)); + mShownFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownFormatNames.back(),wxString::FromUTF8(ofmt->long_name))); } } } @@ -1803,7 +1803,7 @@ void ExportFFmpegOptions::OnDeletePreset(wxCommandEvent& WXUNUSED(event)) { wxComboBox *preset = dynamic_cast(FindWindowById(FEPresetID,this)); wxString presetname = preset->GetValue(); - if (presetname.IsEmpty()) + if (presetname.empty()) { AudacityMessageBox(_("You can't delete a preset without name")); return; @@ -1826,7 +1826,7 @@ void ExportFFmpegOptions::OnSavePreset(wxCommandEvent& WXUNUSED(event)) { wxComboBox *preset = dynamic_cast(FindWindowById(FEPresetID,this)); wxString name = preset->GetValue(); - if (name.IsEmpty()) + if (name.empty()) { AudacityMessageBox(_("You can't save a preset without name")); return; @@ -1835,7 +1835,7 @@ void ExportFFmpegOptions::OnSavePreset(wxCommandEvent& WXUNUSED(event)) int index = mPresetNames.Index(name,false); if (index == -1) { - mPresetNames.Add(name); + mPresetNames.push_back(name); mPresetCombo->Clear(); mPresetCombo->Append(mPresetNames); mPresetCombo->Select(mPresetNames.Index(name,false)); diff --git a/src/export/ExportMP2.cpp b/src/export/ExportMP2.cpp index e6889f775..e5dcf8389 100644 --- a/src/export/ExportMP2.cpp +++ b/src/export/ExportMP2.cpp @@ -104,7 +104,7 @@ ExportMP2Options::ExportMP2Options(wxWindow *parent, int WXUNUSED(format)) { for (unsigned int i=0; i < (sizeof(iBitrates)/sizeof(int)); i++) { - mBitRateNames.Add(wxString::Format(_("%i kbps"),iBitrates[i])); + mBitRateNames.push_back(wxString::Format(_("%i kbps"),iBitrates[i])); mBitRateLabels.push_back(iBitrates[i]); } diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index 562d72f7b..2d75d3104 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -536,7 +536,7 @@ wxArrayString ExportMP3Options::GetNames(CHOICES *choices, int count) wxArrayString names; for (int i = 0; i < count; i++) { - names.Add(choices[i].name); + names.push_back(choices[i].name); } return names; @@ -615,7 +615,7 @@ public: S.StartMultiColumn(2, wxEXPAND); S.SetStretchyCol(0); { - if (mLibPath.GetFullPath().IsEmpty()) { + if (mLibPath.GetFullPath().empty()) { /* i18n-hint: There is a button to the right of the arrow.*/ text.Printf(_("To find %s, click here -->"), mName); mPathText = S.AddTextBox( {}, text, 0); @@ -659,7 +659,7 @@ public: mType, wxFD_OPEN | wxRESIZE_BORDER, this); - if (!path.IsEmpty()) { + if (!path.empty()) { mLibPath = path; mPathText->SetValue(path); } @@ -943,7 +943,7 @@ bool MP3Exporter::FindLibrary(wxWindow *parent) wxString path; wxString name; - if (!mLibPath.IsEmpty()) { + if (!mLibPath.empty()) { wxFileName fn = mLibPath; path = fn.GetPath(); name = fn.GetFullName(); @@ -985,7 +985,7 @@ bool MP3Exporter::LoadLibrary(wxWindow *parent, AskUser askuser) #endif // First try loading it from a previously located path - if (!mLibPath.IsEmpty()) { + if (!mLibPath.empty()) { wxLogMessage(wxT("Attempting to load LAME from previously defined path")); mLibraryLoaded = InitLibrary(mLibPath); } @@ -1016,7 +1016,7 @@ bool MP3Exporter::LoadLibrary(wxWindow *parent, AskUser askuser) // Oh well, just give up if (!ValidLibraryLoaded()) { #if defined(__WXMSW__) - if (askuser && !mBladeVersion.IsEmpty()) { + if (askuser && !mBladeVersion.empty()) { AudacityMessageBox(mBladeVersion); } #endif @@ -1763,7 +1763,7 @@ ProgressResult ExportMP3::Export(AudacityProject *project, } // Verify sample rate - if (FindName(sampRates, WXSIZEOF(sampRates), rate).IsEmpty() || + if (FindName(sampRates, WXSIZEOF(sampRates), rate).empty() || (rate < lowrate) || (rate > highrate)) { rate = AskResample(bitrate, rate, lowrate, highrate); if (rate == 0) { @@ -2006,14 +2006,14 @@ int ExportMP3::AskResample(int bitrate, int rate, int lowrate, int highrate) for (size_t i = 0; i < WXSIZEOF(sampRates); i++) { int label = sampRates[i].label; if (label >= lowrate && label <= highrate) { - choices.Add(sampRates[i].name); + choices.push_back(sampRates[i].name); if (label <= rate) { selected = sampRates[i].name; } } } - if (selected.IsEmpty()) { + if (selected.empty()) { selected = choices[0]; } diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index 52b11786c..eb67a5971 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -203,7 +203,7 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S) ++i; for (int j = 0; j < pPlugin->GetFormatCount(); j++) { - formats.Add(mPlugins[i]->GetDescription(j)); + formats.push_back(mPlugins[i]->GetDescription(j)); if (mPlugins[i]->GetFormat(j) == defaultFormat) { mPluginIndex = i; mSubFormatIndex = j; @@ -542,7 +542,7 @@ void ExportMultiple::OnExport(wxCommandEvent& WXUNUSED(event)) // bool overwrite = mOverwrite->GetValue(); ProgressResult ok = ProgressResult::Failed; - mExported.Empty(); + mExported.clear(); // Give 'em the result auto cleanup = finally( [&] @@ -556,10 +556,10 @@ void ExportMultiple::OnExport(wxCommandEvent& WXUNUSED(event)) : _("Something went really wrong after exporting the following %lld file(s).") ) ) - ), (long long) mExported.GetCount()); + ), (long long) mExported.size()); wxString FileList; - for (size_t i = 0; i < mExported.GetCount(); i++) { + for (size_t i = 0; i < mExported.size(); i++) { FileList += mExported[i]; FileList += '\n'; } @@ -675,7 +675,7 @@ ProgressResult ExportMultiple::ExportMultipleByLabel(bool byName, setting.t1 = mTracks->GetEndTime(); } - if( name.IsEmpty() ) + if( name.empty() ) name = _("untitled"); // store title of label to use in tags @@ -692,7 +692,7 @@ ProgressResult ExportMultiple::ExportMultipleByLabel(bool byName, // store sanitised and user checked name in object setting.destfile.SetName(MakeFileName(name)); - if( setting.destfile.GetName().IsEmpty() ) + if( setting.destfile.GetName().empty() ) { // user cancelled dialogue, or deleted everything in field. // or maybe the label was empty?? // So we ignore this one and keep going. @@ -733,7 +733,7 @@ ProgressResult ExportMultiple::ExportMultipleByLabel(bool byName, /* get the settings to use for the export from the array */ activeSetting = exportSettings[count]; // Bug 1440 fix. - if( activeSetting.destfile.GetName().IsEmpty() ) + if( activeSetting.destfile.GetName().empty() ) continue; // Export it @@ -787,7 +787,7 @@ ProgressResult ExportMultiple::ExportMultipleByTrack(bool byName, // Get name and title title = tr->GetName(); - if( title.IsEmpty() ) + if( title.empty() ) title = _("untitled"); if (byName) { @@ -804,7 +804,7 @@ ProgressResult ExportMultiple::ExportMultipleByTrack(bool byName, // store sanitised and user checked name in object setting.destfile.SetName(MakeFileName(name)); - if (setting.destfile.GetName().IsEmpty()) + if (setting.destfile.GetName().empty()) { // user cancelled dialogue, or deleted everything in field. // So we ignore this one and keep going. } @@ -842,7 +842,7 @@ ProgressResult ExportMultiple::ExportMultipleByTrack(bool byName, wxLogDebug( "Get setting %i", count ); /* get the settings to use for the export from the array */ activeSetting = exportSettings[count]; - if( activeSetting.destfile.GetName().IsEmpty() ){ + if( activeSetting.destfile.GetName().empty() ){ count++; continue; } @@ -951,7 +951,7 @@ ProgressResult ExportMultiple::DoExport(std::unique_ptr &pDialog mSubFormatIndex); if (success == ProgressResult::Success || success == ProgressResult::Stopped) { - mExported.Add(fullPath); + mExported.push_back(fullPath); } Refresh(); diff --git a/src/export/ExportPCM.cpp b/src/export/ExportPCM.cpp index 6e5130d00..b6257a113 100644 --- a/src/export/ExportPCM.cpp +++ b/src/export/ExportPCM.cpp @@ -147,7 +147,7 @@ ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat) mHeaderFromChoice = 0; for (int i = 0, num = sf_num_headers(); i < num; i++) { - mHeaderNames.Add(sf_header_index_name(i)); + mHeaderNames.push_back(sf_header_index_name(i)); if ((format & SF_FORMAT_TYPEMASK) == (int)sf_header_index_to_type(i)) mHeaderFromChoice = i; } @@ -159,7 +159,7 @@ ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat) bool valid = ValidatePair(fmt); if (valid) { - mEncodingNames.Add(sf_encoding_index_name(i)); + mEncodingNames.push_back(sf_encoding_index_name(i)); mEncodingFormats.push_back(enc); if ((format & SF_FORMAT_SUBMASK) == (int)sf_encoding_index_to_subtype(i)) mEncodingFromChoice = sel; @@ -235,7 +235,7 @@ void ExportPCMOptions::OnHeaderChoice(wxCommandEvent & WXUNUSED(evt)) if( format == SF_FORMAT_AIFF ) format = SF_FORMAT_AIFF | SF_FORMAT_PCM_16; - mEncodingNames.Clear(); + mEncodingNames.clear(); mEncodingChoice->Clear(); mEncodingFormats.clear(); int sel = wxNOT_FOUND; @@ -259,7 +259,7 @@ void ExportPCMOptions::OnHeaderChoice(wxCommandEvent & WXUNUSED(evt)) if (valid) { const auto name = sf_encoding_index_name(i); - mEncodingNames.Add(name); + mEncodingNames.push_back(name); mEncodingChoice->Append(name); mEncodingFormats.push_back(encSubtype); for (j = 0; j < sfnum; j++) diff --git a/src/import/Import.cpp b/src/import/Import.cpp index b0ef1b27f..f87061480 100644 --- a/src/import/Import.cpp +++ b/src/import/Import.cpp @@ -135,7 +135,7 @@ void Importer::StringToList(wxString &str, wxString &delims, wxArrayString &list wxStringTokenizer toker; for (toker.SetString(str, delims, mod); - toker.HasMoreTokens(); list.Add (toker.GetNextToken())); + toker.HasMoreTokens(); list.push_back(toker.GetNextToken())); } void Importer::ReadImportItems() @@ -195,14 +195,14 @@ void Importer::ReadImportItems() /* Filters are stored in one list, but the position at which * unused filters start is remembered */ - new_item->divider = new_item->filters.Count(); + new_item->divider = new_item->filters.size(); StringToList (unused_filters, delims, new_item->filters); } else new_item->divider = -1; /* Find corresponding filter object for each filter ID */ - for (size_t i = 0; i < new_item->filters.Count(); i++) + for (size_t i = 0; i < new_item->filters.size(); i++) { bool found = false; for (const auto &importPlugin : mImportPluginList) @@ -235,7 +235,7 @@ void Importer::ReadImportItems() { int index = new_item->divider; if (new_item->divider < 0) - index = new_item->filters.Count(); + index = new_item->filters.size(); new_item->filters.Insert(importPlugin->GetPluginStringID(),index); new_item->filter_objects.insert( new_item->filter_objects.begin() + index, importPlugin.get()); @@ -254,35 +254,35 @@ void Importer::WriteImportItems() for (i = 0; i < this->mExtImportItems.size(); i++) { ExtImportItem *item = mExtImportItems[i].get(); - val.Clear(); + val.clear(); - for (size_t j = 0; j < item->extensions.Count(); j++) + for (size_t j = 0; j < item->extensions.size(); j++) { val.Append (item->extensions[j]); - if (j < item->extensions.Count() - 1) + if (j < item->extensions.size() - 1) val.Append (wxT(":")); } val.Append (wxT("\\")); - for (size_t j = 0; j < item->mime_types.Count(); j++) + for (size_t j = 0; j < item->mime_types.size(); j++) { val.Append (item->mime_types[j]); - if (j < item->mime_types.Count() - 1) + if (j < item->mime_types.size() - 1) val.Append (wxT(":")); } val.Append (wxT("|")); - for (size_t j = 0; j < item->filters.Count() && ((int) j < item->divider || item->divider < 0); j++) + for (size_t j = 0; j < item->filters.size() && ((int) j < item->divider || item->divider < 0); j++) { val.Append (item->filters[j]); - if (j < item->filters.Count() - 1 && ((int) j < item->divider - 1 || item->divider < 0)) + if (j < item->filters.size() - 1 && ((int) j < item->divider - 1 || item->divider < 0)) val.Append (wxT(":")); } if (item->divider >= 0) { val.Append (wxT("\\")); - for (size_t j = item->divider; j < item->filters.Count(); j++) + for (size_t j = item->divider; j < item->filters.size(); j++) { val.Append (item->filters[j]); - if (j < item->filters.Count() - 1) + if (j < item->filters.size() - 1) val.Append (wxT(":")); } } @@ -311,12 +311,12 @@ void Importer::WriteImportItems() std::unique_ptr Importer::CreateDefaultImportItem() { auto new_item = std::make_unique(); - new_item->extensions.Add(wxT("*")); - new_item->mime_types.Add(wxT("*")); + new_item->extensions.push_back(wxT("*")); + new_item->mime_types.push_back(wxT("*")); for (const auto &importPlugin : mImportPluginList) { - new_item->filters.Add (importPlugin->GetPluginStringID()); + new_item->filters.push_back(importPlugin->GetPluginStringID()); new_item->filter_objects.push_back(importPlugin.get()); } new_item->divider = -1; @@ -396,7 +396,7 @@ bool Importer::Import(const wxString &fName, ExtImportItem *item = uItem.get(); bool matches_ext = false, matches_mime = false; wxLogDebug(wxT("Testing extensions")); - for (size_t j = 0; j < item->extensions.Count(); j++) + for (size_t j = 0; j < item->extensions.size(); j++) { wxLogDebug(wxT("%s"), item->extensions[j].Lower()); if (wxMatchWild (item->extensions[j].Lower(),fName.Lower(), false)) @@ -406,7 +406,7 @@ bool Importer::Import(const wxString &fName, break; } } - if (item->extensions.Count() == 0) + if (item->extensions.size() == 0) { wxLogDebug(wxT("Match! (empty list)")); matches_ext = true; @@ -415,7 +415,7 @@ bool Importer::Import(const wxString &fName, wxLogDebug(wxT("Testing mime types")); else wxLogDebug(wxT("Not testing mime types")); - for (size_t j = 0; matches_ext && j < item->mime_types.Count(); j++) + for (size_t j = 0; matches_ext && j < item->mime_types.size(); j++) { if (wxMatchWild (item->mime_types[j].Lower(),mime_type.Lower(), false)) { @@ -424,7 +424,7 @@ bool Importer::Import(const wxString &fName, break; } } - if (item->mime_types.Count() == 0) + if (item->mime_types.size() == 0) { wxLogDebug(wxT("Match! (empty list)")); matches_mime = true; diff --git a/src/import/ImportFFmpeg.cpp b/src/import/ImportFFmpeg.cpp index a5aaf8923..73fe93fae 100644 --- a/src/import/ImportFFmpeg.cpp +++ b/src/import/ImportFFmpeg.cpp @@ -453,7 +453,7 @@ bool FFmpegImportFileHandle::InitCodecs() } strinfo.Printf(_("Index[%02x] Codec[%s], Language[%s], Bitrate[%s], Channels[%d], Duration[%d]"), sc->m_stream->id,codec->name,lang,bitrate,(int)sc->m_stream->codec->channels,(int)duration); - mStreamInfo.Add(strinfo); + mStreamInfo.push_back(strinfo); mScs->get()[mNumStreams++] = std::move(sc); } //for video and unknown streams do nothing diff --git a/src/import/ImportFLAC.cpp b/src/import/ImportFLAC.cpp index 547bd97d1..c77905541 100644 --- a/src/import/ImportFLAC.cpp +++ b/src/import/ImportFLAC.cpp @@ -192,7 +192,7 @@ void MyFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata) { case FLAC__METADATA_TYPE_VORBIS_COMMENT: for (FLAC__uint32 i = 0; i < metadata->data.vorbis_comment.num_comments; i++) { - mComments.Add(UTF8CTOWX((char *)metadata->data.vorbis_comment.comments[i].entry)); + mComments.push_back(UTF8CTOWX((char *)metadata->data.vorbis_comment.comments[i].entry)); } break; @@ -528,7 +528,7 @@ ProgressResult FLACImportFileHandle::Import(TrackFactory *trackFactory, outTracks.push_back(std::move(mChannels)); tags->Clear(); - size_t cnt = mFile->mComments.GetCount(); + size_t cnt = mFile->mComments.size(); for (size_t c = 0; c < cnt; c++) { wxString name = mFile->mComments[c].BeforeFirst(wxT('=')); wxString value = mFile->mComments[c].AfterFirst(wxT('=')); diff --git a/src/import/ImportGStreamer.cpp b/src/import/ImportGStreamer.cpp index 0a3a14110..5334daa27 100644 --- a/src/import/ImportGStreamer.cpp +++ b/src/import/ImportGStreamer.cpp @@ -302,7 +302,7 @@ GetGStreamerImportPlugin(ImportPluginList &importPluginList, auto plug = std::make_unique(); // No supported extensions...no gstreamer plugins installed - if (plug->GetSupportedExtensions().GetCount() == 0) + if (plug->GetSupportedExtensions().size() == 0) return; // Add to list of importers @@ -391,7 +391,7 @@ GStreamerImportPlugin::GetSupportedExtensions() wxString extension = wxString::FromUTF8(extensions[i]); if (mExtensions.Index(extension, false) == wxNOT_FOUND) { - mExtensions.Add(extension); + mExtensions.push_back(extension); } } } @@ -403,7 +403,7 @@ GStreamerImportPlugin::GetSupportedExtensions() // Log it for debugging wxString extensions = wxT("Extensions:"); - for (size_t i = 0; i < mExtensions.GetCount(); i++) + for (size_t i = 0; i < mExtensions.size(); i++) { extensions = extensions + wxT(" ") + mExtensions[i]; } @@ -892,7 +892,7 @@ GStreamerImportFileHandle::~GStreamerImportFileHandle() wxInt32 GStreamerImportFileHandle::GetStreamCount() { - return mStreamInfo.GetCount(); + return mStreamInfo.size(); } // ---------------------------------------------------------------------------- @@ -991,7 +991,7 @@ GStreamerImportFileHandle::Init() wxString::FromUTF8(c->mType.get()), (int) c->mNumChannels, (int) c->mSampleRate); - mStreamInfo.Add(strinfo); + mStreamInfo.push_back(strinfo); } return success; diff --git a/src/import/ImportMP3.cpp b/src/import/ImportMP3.cpp index 87133abdc..60b245950 100644 --- a/src/import/ImportMP3.cpp +++ b/src/import/ImportMP3.cpp @@ -382,7 +382,7 @@ void MP3ImportFileHandle::ImportID3(Tags *tags) v = UTF8CTOWX(str.get()); } - if (!n.IsEmpty() && !v.IsEmpty()) { + if (!n.empty() && !v.empty()) { tags->SetTag(n, v); } } diff --git a/src/import/ImportOGG.cpp b/src/import/ImportOGG.cpp index e51c542ea..6200bad9e 100644 --- a/src/import/ImportOGG.cpp +++ b/src/import/ImportOGG.cpp @@ -115,7 +115,7 @@ public: { wxString strinfo; strinfo.Printf(wxT("Index[%02x] Version[%d], Channels[%d], Rate[%ld]"), (unsigned int) i,mVorbisFile->vi[i].version,mVorbisFile->vi[i].channels,mVorbisFile->vi[i].rate); - mStreamInfo.Add(strinfo); + mStreamInfo.push_back(strinfo); mStreamUsage[i] = 0; } diff --git a/src/import/ImportPCM.cpp b/src/import/ImportPCM.cpp index f5740741f..b62acd5f5 100644 --- a/src/import/ImportPCM.cpp +++ b/src/import/ImportPCM.cpp @@ -692,7 +692,7 @@ ProgressResult PCMImportFileHandle::Import(TrackFactory *trackFactory, v = UTF8CTOWX(convStr.get()); } - if (!n.IsEmpty() && !v.IsEmpty()) { + if (!n.empty() && !v.empty()) { tags->SetTag(n, v); } } diff --git a/src/import/ImportQT.cpp b/src/import/ImportQT.cpp index 34171ccd3..75e6d2645 100644 --- a/src/import/ImportQT.cpp +++ b/src/import/ImportQT.cpp @@ -526,7 +526,7 @@ void QTImportFileHandle::AddMetadata(Tags *tags) break; } - if (!v.IsEmpty()) { + if (!v.empty()) { tags->SetTag(names[i].name, v); } } diff --git a/src/import/ImportRaw.cpp b/src/import/ImportRaw.cpp index 08f82e5a1..0405d1ea0 100644 --- a/src/import/ImportRaw.cpp +++ b/src/import/ImportRaw.cpp @@ -345,7 +345,7 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent, if (sf_format_check(&info)) { mEncodingSubtype[mNumEncodings] = subtype; - encodings.Add(sf_encoding_index_name(i)); + encodings.push_back(sf_encoding_index_name(i)); if ((mEncoding & SF_FORMAT_SUBMASK) == subtype) selection = mNumEncodings; @@ -387,7 +387,7 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent, chans.Add(_("1 Channel (Mono)")); chans.Add(_("2 Channels (Stereo)")); for (i=2; i<16; i++) { - chans.Add(wxString::Format(_("%d Channels"), i + 1)); + chans.push_back(wxString::Format(_("%d Channels"), i + 1)); } S.StartVerticalLay(false); diff --git a/src/menus/FileMenus.cpp b/src/menus/FileMenus.cpp index f27ca3732..1f4f5498b 100644 --- a/src/menus/FileMenus.cpp +++ b/src/menus/FileMenus.cpp @@ -34,8 +34,8 @@ void DoExport // Prompt for file name and/or extension? bool bPromptingRequired = - (project.mBatchMode == 0) || project.GetFileName().IsEmpty() || - Format.IsEmpty(); + (project.mBatchMode == 0) || project.GetFileName().empty() || + Format.empty(); wxString filename; if (!bPromptingRequired) { @@ -394,7 +394,7 @@ void OnImport(const CommandContext &context) wxGetApp().SetMissingAliasedFileWarningShouldShow(true); wxArrayString selectedFiles = project.ShowOpenDialog(wxT("")); - if (selectedFiles.GetCount() == 0) { + if (selectedFiles.size() == 0) { gPrefs->Write(wxT("/LastOpenType"),wxT("")); gPrefs->Flush(); return; @@ -418,7 +418,7 @@ void OnImport(const CommandContext &context) project.HandleResize(); // Adjust scrollers for NEW track sizes. } ); - for (size_t ff = 0; ff < selectedFiles.GetCount(); ff++) { + for (size_t ff = 0; ff < selectedFiles.size(); ff++) { wxString fileName = selectedFiles[ff]; FileNames::UpdateDefaultPath(FileNames::Operation::Open, fileName); diff --git a/src/menus/HelpMenus.cpp b/src/menus/HelpMenus.cpp index f885e6d22..1ce7ceff2 100644 --- a/src/menus/HelpMenus.cpp +++ b/src/menus/HelpMenus.cpp @@ -96,7 +96,7 @@ void OnAudioDeviceInfo(const CommandContext &context) wxT("*.txt"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, &project); - if (!fName.IsEmpty()) + if (!fName.empty()) { if (!text->SaveFile(fName)) { @@ -140,7 +140,7 @@ void OnMidiDeviceInfo(const CommandContext &context) wxT("*.txt"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER, &project); - if (!fName.IsEmpty()) + if (!fName.empty()) { if (!text->SaveFile(fName)) { diff --git a/src/menus/PluginMenus.cpp b/src/menus/PluginMenus.cpp index b1ae428a3..180573d43 100644 --- a/src/menus/PluginMenus.cpp +++ b/src/menus/PluginMenus.cpp @@ -44,11 +44,11 @@ bool CompareEffectsByPublisher( auto akey = em.GetVendorName(a->GetID()); auto bkey = em.GetVendorName(b->GetID()); - if (akey.IsEmpty()) + if (akey.empty()) { akey = _("Uncategorized"); } - if (bkey.IsEmpty()) + if (bkey.empty()) { bkey = _("Uncategorized"); } @@ -94,11 +94,11 @@ bool CompareEffectsByTypeAndName( auto akey = em.GetEffectFamilyName(a->GetID()); auto bkey = em.GetEffectFamilyName(b->GetID()); - if (akey.IsEmpty()) + if (akey.empty()) { akey = _("Uncategorized"); } - if (bkey.IsEmpty()) + if (bkey.empty()) { bkey = _("Uncategorized"); } @@ -127,11 +127,11 @@ bool CompareEffectsByType(const PluginDescriptor *a, const PluginDescriptor *b) auto akey = em.GetEffectFamilyName(a->GetID()); auto bkey = em.GetEffectFamilyName(b->GetID()); - if (akey.IsEmpty()) + if (akey.empty()) { akey = _("Uncategorized"); } - if (bkey.IsEmpty()) + if (bkey.empty()) { bkey = _("Uncategorized"); } @@ -195,7 +195,7 @@ void AddEffectMenuItems( if (groupBy == wxT("groupby:publisher")) { current = EffectManager::Get().GetVendorName(plug->GetID()); - if (current.IsEmpty()) + if (current.empty()) { current = _("Unknown"); } @@ -203,7 +203,7 @@ void AddEffectMenuItems( else if (groupBy == wxT("groupby:type")) { current = EffectManager::Get().GetEffectFamilyName(plug->GetID()); - if (current.IsEmpty()) + if (current.empty()) { current = _("Unknown"); } @@ -213,7 +213,7 @@ void AddEffectMenuItems( { using namespace MenuTable; BaseItemPtrs temp; - bool bInSubmenu = !last.IsEmpty() && (groupNames.Count() > 1); + bool bInSubmenu = !last.empty() && (groupNames.size() > 1); AddEffectMenuItemGroup(temp, groupNames, vHasDialog, @@ -223,25 +223,25 @@ void AddEffectMenuItems( ( bInSubmenu ? last : wxString{} ), std::move( temp ) ) ); - groupNames.Clear(); + groupNames.clear(); vHasDialog.clear(); - groupPlugs.Clear(); + groupPlugs.clear(); groupFlags.clear(); last = current; } - groupNames.Add(name); + groupNames.push_back(name); vHasDialog.push_back(hasDialog); - groupPlugs.Add(plug->GetID()); + groupPlugs.push_back(plug->GetID()); groupFlags.push_back( plug->IsEffectRealtime() ? realflags : batchflags); } - if (groupNames.GetCount() > 0) + if (groupNames.size() > 0) { using namespace MenuTable; BaseItemPtrs temp; - bool bInSubmenu = groupNames.Count() > 1; + bool bInSubmenu = groupNames.size() > 1; AddEffectMenuItemGroup(temp, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault); @@ -280,18 +280,18 @@ void AddEffectMenuItems( group = wxEmptyString; } - if (!group.IsEmpty()) + if (!group.empty()) { group += wxT(": "); } - groupNames.Add(group + name); + groupNames.push_back(group + name); vHasDialog.push_back(hasDialog); - groupPlugs.Add(plug->GetID()); + groupPlugs.push_back(plug->GetID()); groupFlags.push_back(plug->IsEffectRealtime() ? realflags : batchflags); } - if (groupNames.GetCount() > 0) + if (groupNames.size() > 0) { AddEffectMenuItemGroup( table, groupNames, vHasDialog, groupPlugs, groupFlags, isDefault); @@ -568,7 +568,7 @@ void OnManageEffects(const CommandContext &context) void OnRepeatLastEffect(const CommandContext &context) { auto lastEffect = GetMenuManager(context.project).mLastEffect; - if (!lastEffect.IsEmpty()) + if (!lastEffect.empty()) { DoEffect( lastEffect, context, kConfigured ); } @@ -711,7 +711,7 @@ void AddEffectMenuItemGroup( const std::vector & flags, bool isDefault) { - const int namesCnt = (int) names.GetCount(); + const int namesCnt = (int) names.size(); int perGroup; #if defined(__WXGTK__) @@ -827,7 +827,7 @@ MenuTable::BaseItemPtrs PopulateMacrosMenu( CommandFlag flags ) wxArrayString names = MacroCommands::GetNames(); int i; - for (i = 0; i < (int)names.GetCount(); i++) { + for (i = 0; i < (int)names.size(); i++) { wxString MacroID = ApplyMacroDialog::MacroIdOfName( names[i] ); result.push_back( MenuTable::Command( MacroID, names[i], false, FN(OnApplyMacroDirectly), @@ -871,7 +871,7 @@ MenuTable::BaseItemPtr EffectMenu( AudacityProject &project ) const auto &lastEffect = GetMenuManager(project).mLastEffect; wxString buildMenuLabel; - if (!lastEffect.IsEmpty()) { + if (!lastEffect.empty()) { buildMenuLabel.Printf(_("Repeat %s"), EffectManager::Get().GetCommandName(lastEffect)); } diff --git a/src/ondemand/ODDecodeFlacTask.cpp b/src/ondemand/ODDecodeFlacTask.cpp index 9752f687b..3821fc505 100644 --- a/src/ondemand/ODDecodeFlacTask.cpp +++ b/src/ondemand/ODDecodeFlacTask.cpp @@ -50,7 +50,7 @@ void ODFLACFile::metadata_callback(const FLAC__StreamMetadata *metadata) { case FLAC__METADATA_TYPE_VORBIS_COMMENT: for (FLAC__uint32 i = 0; i < metadata->data.vorbis_comment.num_comments; i++) { - mComments.Add(UTF8CTOWX((char *)metadata->data.vorbis_comment.comments[i].entry)); + mComments.push_back(UTF8CTOWX((char *)metadata->data.vorbis_comment.comments[i].entry)); } break; diff --git a/src/prefs/DevicePrefs.cpp b/src/prefs/DevicePrefs.cpp index 73e4d984b..211e7c918 100644 --- a/src/prefs/DevicePrefs.cpp +++ b/src/prefs/DevicePrefs.cpp @@ -99,8 +99,8 @@ void DevicePrefs::GetNamesAndLabels() if ((info!=NULL)&&(info->maxOutputChannels > 0 || info->maxInputChannels > 0)) { wxString name = wxSafeConvertMB2WX(Pa_GetHostApiInfo(info->hostApi)->name); if (mHostNames.Index(name) == wxNOT_FOUND) { - mHostNames.Add(name); - mHostLabels.Add(name); + mHostNames.push_back(name); + mHostLabels.push_back(name); } } } @@ -267,12 +267,12 @@ void DevicePrefs::OnHost(wxCommandEvent & e) /* deal with not having any devices at all */ if (mPlay->GetCount() == 0) { - playnames.Add(_("No devices found")); + playnames.push_back(_("No devices found")); mPlay->Append(playnames[0], (void *) NULL); mPlay->SetSelection(0); } if (mRecord->GetCount() == 0) { - recordnames.Add(_("No devices found")); + recordnames.push_back(_("No devices found")); mRecord->Append(recordnames[0], (void *) NULL); mRecord->SetSelection(0); } @@ -355,7 +355,7 @@ void DevicePrefs::OnDevice(wxCommandEvent & WXUNUSED(event)) name = wxString::Format(wxT("%d"), i + 1); } - channelnames.Add(name); + channelnames.push_back(name); int index = mChannels->Append(name); if (i == mRecordChannels - 1) { mChannels->SetSelection(index); diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index bb29ed0ab..e0eb5c550 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -169,8 +169,8 @@ void DirectoriesPrefs::OnChooseTempDir(wxCommandEvent & e) // (that doesn't exist) -- hence the constructor calls if (tmpDirPath != wxFileName(wxGetApp().defaultTempDir, wxT("")) && tmpDirPath != wxFileName(mTempDir->GetValue(), wxT("")) && - (dirsInPath.GetCount() == 0 || - dirsInPath[dirsInPath.GetCount()-1] != newDirName)) + (dirsInPath.size() == 0 || + dirsInPath[dirsInPath.size()-1] != newDirName)) { tmpDirPath.AppendDir(newDirName); } diff --git a/src/prefs/ExtImportPrefs.cpp b/src/prefs/ExtImportPrefs.cpp index 0f3b39612..aa47d510a 100644 --- a/src/prefs/ExtImportPrefs.cpp +++ b/src/prefs/ExtImportPrefs.cpp @@ -439,7 +439,7 @@ void ExtImportPrefs::DoOnRuleTableSelect (int toprow) PluginList->DeleteAllItems(); int fcount; - fcount = item->filters.Count(); + fcount = item->filters.size(); int shift = 0; for (int i = 0; i < fcount; i++) { @@ -493,14 +493,14 @@ void ExtImportPrefs::OnRuleTableEdit (wxGridEvent& event) switch (col) { case 0: - item->extensions.Clear(); + item->extensions.clear(); break; case 1: - item->mime_types.Clear(); + item->mime_types.clear(); break; } - for (size_t i = 0; i < vals.Count(); i++) + for (size_t i = 0; i < vals.size(); i++) { wxString trimmed = vals[i]; @@ -529,17 +529,17 @@ Audacity to trim spaces for you?" switch (col) { case 0: - item->extensions.Add (trimmed); + item->extensions.push_back(trimmed); break; case 1: - item->mime_types.Add (trimmed); + item->mime_types.push_back(trimmed); break; } } if (fixSpaces == wxYES) { wxString vals_as_string; - for (size_t i = 0; i < vals.Count(); i++) + for (size_t i = 0; i < vals.size(); i++) { if (i > 0) vals_as_string.Append (wxT(":")); @@ -554,19 +554,19 @@ Audacity to trim spaces for you?" void ExtImportPrefs::AddItemToTable (int index, const ExtImportItem *item) { wxString extensions, mime_types; - if (item->extensions.Count() > 0) + if (item->extensions.size() > 0) { extensions.Append (item->extensions[0]); - for (unsigned int i = 1; i < item->extensions.Count(); i++) + for (unsigned int i = 1; i < item->extensions.size(); i++) { extensions.Append (wxT(":")); extensions.Append (item->extensions[i]); } } - if (item->mime_types.Count() > 0) + if (item->mime_types.size() > 0) { mime_types.Append (item->mime_types[0]); - for (unsigned int i = 1; i < item->mime_types.Count(); i++) + for (unsigned int i = 1; i < item->mime_types.size(); i++) { mime_types.Append (wxT(":")); mime_types.Append (item->mime_types[i]); diff --git a/src/prefs/KeyConfigPrefs.cpp b/src/prefs/KeyConfigPrefs.cpp index 4dce07153..b327cee84 100644 --- a/src/prefs/KeyConfigPrefs.cpp +++ b/src/prefs/KeyConfigPrefs.cpp @@ -283,7 +283,7 @@ void KeyConfigPrefs::RefreshBindings(bool bSort) wxArrayString Categories; wxArrayString Prefixes; - mNames.Clear(); + mNames.clear(); mKeys.clear(); mDefaultKeys.clear(); mStandardDefaultKeys.clear(); @@ -432,7 +432,7 @@ void KeyConfigPrefs::OnHotkeyChar(wxKeyEvent & WXUNUSED(e)) void KeyConfigPrefs::OnHotkeyKillFocus(wxFocusEvent & e) { - if (mKey->GetValue().IsEmpty() && mCommandSelected != wxNOT_FOUND) { + if (mKey->GetValue().empty() && mCommandSelected != wxNOT_FOUND) { mKey->AppendText(mView->GetKey(mCommandSelected).Display()); } @@ -635,7 +635,7 @@ bool KeyConfigPrefs::Commit() PopulateOrExchange(S); bool bFull = gPrefs->ReadBool(wxT("/GUI/Shortcuts/FullDefaults"), false); - for (size_t i = 0; i < mNames.GetCount(); i++) { + for (size_t i = 0; i < mNames.size(); i++) { const auto &dkey = bFull ? mDefaultKeys[i] : mStandardDefaultKeys[i]; wxString name = wxT("/NewKeys/") + mNames[i]; const auto &key = mNewKeys[i]; @@ -661,7 +661,7 @@ bool KeyConfigPrefs::Commit() void KeyConfigPrefs::Cancel() { // Restore original key values - for (size_t i = 0; i < mNames.GetCount(); i++) { + for (size_t i = 0; i < mNames.size(); i++) { mManager->SetKeyFromIndex(i, mKeys[i]); } diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 47333c19b..f5ee0345a 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -104,8 +104,8 @@ void MidiIOPrefs::GetNamesAndLabels() { if (info->output || info->input) { //should always happen wxString name = wxSafeConvertMB2WX(info->interf); if (mHostNames.Index(name) == wxNOT_FOUND) { - mHostNames.Add(name); - mHostLabels.Add(name); + mHostNames.push_back(name); + mHostLabels.push_back(name); } } } @@ -181,8 +181,8 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) { wxString itemAtIndex; int index = mHost->GetCurrentSelection(); - if (index >= 0 && index < (int)mHostNames.Count()) - itemAtIndex = mHostNames.Item(index); + if (index >= 0 && index < (int)mHostNames.size()) + itemAtIndex = mHostNames[index]; int nDevices = Pm_CountDevices(); if (nDevices == 0) { @@ -193,7 +193,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) mPlay->Clear(); #ifdef EXPERIMENTAL_MIDI_IN - mRecord->Clear(); + mRecord->clear(); #endif wxArrayString playnames; @@ -208,7 +208,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) interf, name); if (info->output) { - playnames.Add(name); + playnames.push_back(name); index = mPlay->Append(name, (void *) info); if (device == mPlayDevice) { mPlay->SetSelection(index); @@ -216,7 +216,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) } #ifdef EXPERIMENTAL_MIDI_IN if (info->input) { - recordnames.Add(name); + recordnames.push_back(name); index = mRecord->Append(name, (void *) info); if (device == mRecordDevice) { mRecord->SetSelection(index); @@ -227,12 +227,12 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) } if (mPlay->GetCount() == 0) { - playnames.Add(_("No devices found")); + playnames.push_back(_("No devices found")); mPlay->Append(playnames[0], (void *) NULL); } #ifdef EXPERIMENTAL_MIDI_IN - if (mRecord->GetCount() == 0) { - recordnames.Add(_("No devices found")); + if (mRecord->size() == 0) { + recordnames.push_back(_("No devices found")); mRecord->Append(recordnames[0], (void *) NULL); } #endif @@ -240,7 +240,7 @@ void MidiIOPrefs::OnHost(wxCommandEvent & WXUNUSED(e)) mPlay->SetSelection(0); } #ifdef EXPERIMENTAL_MIDI_IN - if (mRecord->GetCount() && mRecord->GetSelection() == wxNOT_FOUND) { + if (mRecord->size() && mRecord->GetSelection() == wxNOT_FOUND) { mRecord->SetSelection(0); } #endif diff --git a/src/prefs/ModulePrefs.cpp b/src/prefs/ModulePrefs.cpp index 94b29aad0..0181847c0 100644 --- a/src/prefs/ModulePrefs.cpp +++ b/src/prefs/ModulePrefs.cpp @@ -52,9 +52,9 @@ void ModulePrefs::GetAllModuleStatuses(){ // TODO: On an Audacity upgrade we should (?) actually untick modules. // The old modules might be still around, and we do not want to use them. - mModules.Clear(); + mModules.clear(); mStatuses.clear(); - mPaths.Clear(); + mPaths.clear(); // Iterate through all Modules listed in prefs. @@ -72,9 +72,9 @@ void ModulePrefs::GetAllModuleStatuses(){ gPrefs->Write( str, iStatus ); } //wxLogDebug( wxT("Entry: %s Value: %i"), str, iStatus ); - mModules.Add( str ); + mModules.push_back( str ); mStatuses.push_back( iStatus ); - mPaths.Add( fname ); + mPaths.push_back( fname ); } bCont = gPrefs->GetNextEntry(str, dummy); } @@ -115,11 +115,11 @@ void ModulePrefs::PopulateOrExchange(ShuttleGui & S) { S.StartMultiColumn( 2 ); int i; - for(i=0;i<(int)mModules.GetCount();i++) + for(i=0;i<(int)mModules.size();i++) S.TieChoice( mModules[i], mStatuses[i], &StatusChoices ); S.EndMultiColumn(); } - if( mModules.GetCount() < 1 ) + if( mModules.size() < 1 ) { S.AddFixedText( _("No modules were found") ); } @@ -133,7 +133,7 @@ bool ModulePrefs::Commit() ShuttleGui S(this, eIsSavingToPrefs); PopulateOrExchange(S); int i; - for(i=0;i<(int)mPaths.GetCount();i++) + for(i=0;i<(int)mPaths.size();i++) SetModuleStatus( mPaths[i], mStatuses[i] ); return true; } diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index ca9a7901e..6618290db 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -152,10 +152,10 @@ void QualityPrefs::GetNamesAndLabels() for (int i = 0; i < AudioIO::NumStandardRates; i++) { int iRate = AudioIO::StandardRates[i]; mSampleRateLabels.push_back(iRate); - mSampleRateNames.Add(wxString::Format(wxT("%i Hz"), iRate)); + mSampleRateNames.push_back(wxString::Format(wxT("%i Hz"), iRate)); } - mSampleRateNames.Add(_("Other...")); + mSampleRateNames.push_back(_("Other...")); // The label for the 'Other...' case can be any value at all. mSampleRateLabels.push_back(44100); // If chosen, this value will be overwritten @@ -176,7 +176,7 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) { // If the value in Prefs isn't in the list, then we want // the last item, 'Other...' to be shown. - S.SetNoMatchSelector(mSampleRateNames.GetCount() - 1); + S.SetNoMatchSelector(mSampleRateNames.size() - 1); // First the choice... // We make sure it uses the ID we want, so that we get changes S.Id(ID_SAMPLE_RATE_CHOICE); diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 0ec53d7c1..e14992ad7 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -83,25 +83,25 @@ enum { void SpectrumPrefs::Populate(size_t windowSize) { - mSizeChoices.Add(_("8 - most wideband")); - mSizeChoices.Add(wxT("16")); - mSizeChoices.Add(wxT("32")); - mSizeChoices.Add(wxT("64")); - mSizeChoices.Add(wxT("128")); - mSizeChoices.Add(wxT("256")); - mSizeChoices.Add(wxT("512")); - mSizeChoices.Add(_("1024 - default")); - mSizeChoices.Add(wxT("2048")); - mSizeChoices.Add(wxT("4096")); - mSizeChoices.Add(wxT("8192")); - mSizeChoices.Add(wxT("16384")); - mSizeChoices.Add(_("32768 - most narrowband")); + mSizeChoices.push_back(_("8 - most wideband")); + mSizeChoices.push_back(wxT("16")); + mSizeChoices.push_back(wxT("32")); + mSizeChoices.push_back(wxT("64")); + mSizeChoices.push_back(wxT("128")); + mSizeChoices.push_back(wxT("256")); + mSizeChoices.push_back(wxT("512")); + mSizeChoices.push_back(_("1024 - default")); + mSizeChoices.push_back(wxT("2048")); + mSizeChoices.push_back(wxT("4096")); + mSizeChoices.push_back(wxT("8192")); + mSizeChoices.push_back(wxT("16384")); + mSizeChoices.push_back(_("32768 - most narrowband")); wxASSERT(mSizeChoices.size() == SpectrogramSettings::NumWindowSizes); PopulatePaddingChoices(windowSize); for (int i = 0; i < NumWindowFuncs(); i++) { - mTypeChoices.Add(WindowFuncName(i)); + mTypeChoices.push_back(WindowFuncName(i)); } mScaleChoices = SpectrogramSettings::GetScaleNames(); @@ -140,7 +140,7 @@ void SpectrumPrefs::PopulatePaddingChoices(size_t windowSize) const size_t maxWindowSize = 1 << (SpectrogramSettings::LogMaxWindowSize); while (windowSize <= maxWindowSize) { const wxString numeral = wxString::Format(wxT("%d"), padding); - mZeroPaddingChoices.Add(numeral); + mZeroPaddingChoices.push_back(numeral); if (pPaddingSizeControl) pPaddingSizeControl->Append(numeral); windowSize <<= 1; diff --git a/src/prefs/TracksBehaviorsPrefs.cpp b/src/prefs/TracksBehaviorsPrefs.cpp index 2f25594f2..36b5786d1 100644 --- a/src/prefs/TracksBehaviorsPrefs.cpp +++ b/src/prefs/TracksBehaviorsPrefs.cpp @@ -41,13 +41,13 @@ const wxChar *TracksBehaviorsPrefs::ScrollingPreferenceKey() void TracksBehaviorsPrefs::Populate() { - mSoloCodes.Add(wxT("Simple")); - mSoloCodes.Add(wxT("Multi")); - mSoloCodes.Add(wxT("None")); + mSoloCodes.push_back(wxT("Simple")); + mSoloCodes.push_back(wxT("Multi")); + mSoloCodes.push_back(wxT("None")); - mSoloChoices.Add(_("Simple")); - mSoloChoices.Add(_("Multi-track")); - mSoloChoices.Add(_("None")); + mSoloChoices.push_back(_("Simple")); + mSoloChoices.push_back(_("Multi-track")); + mSoloChoices.push_back(_("None")); //------------------------- Main section -------------------- // Now construct the GUI itself. diff --git a/src/prefs/WaveformSettings.cpp b/src/prefs/WaveformSettings.cpp index 677a14c73..794e19fb2 100644 --- a/src/prefs/WaveformSettings.cpp +++ b/src/prefs/WaveformSettings.cpp @@ -154,8 +154,8 @@ const wxArrayString &WaveformSettings::GetScaleNames() void Populate() override { // Keep in correspondence with enum WaveTrack::WaveTrackDisplay: - mContents.Add(_("Linear")); - mContents.Add(_("Logarithmic")); + mContents.push_back(_("Linear")); + mContents.push_back(_("Logarithmic")); } }; diff --git a/src/toolbars/ControlToolBar.cpp b/src/toolbars/ControlToolBar.cpp index 7425de38a..7f637a2bb 100644 --- a/src/toolbars/ControlToolBar.cpp +++ b/src/toolbars/ControlToolBar.cpp @@ -1190,14 +1190,14 @@ bool ControlToolBar::DoRecord(AudacityProject &project, } if (useDateStamp) { - if (!nameSuffix.IsEmpty()) { + if (!nameSuffix.empty()) { nameSuffix += wxT("_"); } nameSuffix += wxDateTime::Now().FormatISODate(); } if (useTimeStamp) { - if (!nameSuffix.IsEmpty()) { + if (!nameSuffix.empty()) { nameSuffix += wxT("_"); } nameSuffix += wxDateTime::Now().FormatISOTime(); @@ -1206,10 +1206,10 @@ bool ControlToolBar::DoRecord(AudacityProject &project, // ISO standard would be nice, but ":" is unsafe for file name. nameSuffix.Replace(wxT(":"), wxT("-")); - if (baseTrackName.IsEmpty()) { + if (baseTrackName.empty()) { newTrack->SetName(nameSuffix); } - else if (nameSuffix.IsEmpty()) { + else if (nameSuffix.empty()) { newTrack->SetName(baseTrackName); } else { @@ -1389,7 +1389,7 @@ wxString ControlToolBar::StateForStatusBar() auto pProject = GetActiveProject(); auto scrubState = pProject ? pProject->GetScrubber().GetUntranslatedStateString() : wxString(); - if (!scrubState.IsEmpty()) + if (!scrubState.empty()) state = wxGetTranslation(scrubState); else if (mPlay->IsDown()) state = wxGetTranslation(mStatePlay); diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index 1c6eda7df..cc29bf446 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -511,15 +511,15 @@ void DeviceToolBar::FillHosts() // go over our lists add the host to the list if it isn't there yet for (i = 0; i < inMaps.size(); i++) if (hosts.Index(inMaps[i].hostString) == wxNOT_FOUND) - hosts.Add(inMaps[i].hostString); + hosts.push_back(inMaps[i].hostString); for (i = 0; i < outMaps.size(); i++) if (hosts.Index(outMaps[i].hostString) == wxNOT_FOUND) - hosts.Add(outMaps[i].hostString); + hosts.push_back(outMaps[i].hostString); mHost->Clear(); mHost->Append(hosts); - if (hosts.GetCount() == 0) + if (hosts.size() == 0) mHost->Enable(false); mHost->InvalidateBestSize(); diff --git a/src/toolbars/SelectionBar.cpp b/src/toolbars/SelectionBar.cpp index 25bc60094..d4f1b1eef 100644 --- a/src/toolbars/SelectionBar.cpp +++ b/src/toolbars/SelectionBar.cpp @@ -250,7 +250,7 @@ void SelectionBar::Populate() // the control that gets the focus events. So we have to find the // textctrl. wxWindowList kids = mRateBox->GetChildren(); - for (unsigned int i = 0; i < kids.GetCount(); i++) { + for (unsigned int i = 0; i < kids.size(); i++) { wxClassInfo *ci = kids[i]->GetClassInfo(); if (ci->IsKindOf(CLASSINFO(wxTextCtrl))) { mRateText = kids[i]; diff --git a/src/tracks/labeltrack/ui/LabelTrackControls.cpp b/src/tracks/labeltrack/ui/LabelTrackControls.cpp index a7a73030e..578debfdd 100644 --- a/src/tracks/labeltrack/ui/LabelTrackControls.cpp +++ b/src/tracks/labeltrack/ui/LabelTrackControls.cpp @@ -86,7 +86,7 @@ void LabelTrackMenuTable::OnSetFont(wxCommandEvent &) bool OnFacename(const wxString& font) override { - mFontNames->Add(font); + mFontNames->push_back(font); return true; } diff --git a/src/widgets/AButton.cpp b/src/widgets/AButton.cpp index be6cdb523..44d9be36d 100644 --- a/src/widgets/AButton.cpp +++ b/src/widgets/AButton.cpp @@ -627,7 +627,7 @@ wxAccStatus AButtonAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionN // Returns the description for this object or a child. wxAccStatus AButtonAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -658,7 +658,7 @@ wxAccStatus AButtonAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) return wxACC_OK; #else - helpText->Clear(); + helpText->clear(); return wxACC_NOT_SUPPORTED; #endif @@ -668,7 +668,7 @@ wxAccStatus AButtonAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) // Return e.g. ALT+K wxAccStatus AButtonAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -691,12 +691,12 @@ wxAccStatus AButtonAx::GetName(int WXUNUSED(childId), wxString* name) AButton *ab = wxDynamicCast( GetWindow(), AButton ); *name = ab->GetName(); - if( name->IsEmpty() ) + if( name->empty() ) { *name = ab->GetLabel(); } - if( name->IsEmpty() ) + if( name->empty() ) { *name = _("Button"); } diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index cd6c0a220..2b2bbcefe 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -857,7 +857,7 @@ wxString LWSlider::GetTip(float value) const { wxString label; - if (mTipTemplate.IsEmpty()) + if (mTipTemplate.empty()) { wxString val; @@ -919,7 +919,7 @@ wxArrayString LWSlider::GetWidestTips() const { wxArrayString results; - if (mTipTemplate.IsEmpty()) + if (mTipTemplate.empty()) { wxString val; @@ -1694,7 +1694,7 @@ wxAccStatus ASliderAx::GetChildCount(int* childCount) // a document has a default action of "Press" rather than "Prints the current document." wxAccStatus ASliderAx::GetDefaultAction( int WXUNUSED(childId), wxString *actionName ) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -1702,7 +1702,7 @@ wxAccStatus ASliderAx::GetDefaultAction( int WXUNUSED(childId), wxString *action // Returns the description for this object or a child. wxAccStatus ASliderAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -1722,7 +1722,7 @@ wxAccStatus ASliderAx::GetFocus(int* childId, wxAccessible** child) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus ASliderAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -1731,7 +1731,7 @@ wxAccStatus ASliderAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) // Return e.g. ALT+K wxAccStatus ASliderAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } diff --git a/src/widgets/FileHistory.cpp b/src/widgets/FileHistory.cpp index 4bcb757f2..8f40cb40e 100644 --- a/src/widgets/FileHistory.cpp +++ b/src/widgets/FileHistory.cpp @@ -37,7 +37,7 @@ void FileHistory::AddFileToHistory(const wxString & file, bool update) { // Needed to transition from wxFileHistory to FileHistory since there // can be empty history "slots". - if (file.IsEmpty()) { + if (file.empty()) { return; } @@ -51,8 +51,8 @@ void FileHistory::AddFileToHistory(const wxString & file, bool update) mHistory.RemoveAt(i); } - if (mMaxFiles == mHistory.GetCount()) { - mHistory.RemoveAt(mHistory.GetCount() - 1); + if (mMaxFiles == mHistory.size()) { + mHistory.RemoveAt(mHistory.size() - 1); } mHistory.Insert(file, 0); @@ -64,9 +64,9 @@ void FileHistory::AddFileToHistory(const wxString & file, bool update) void FileHistory::RemoveFileFromHistory(size_t i, bool update) { - wxASSERT(i < mHistory.GetCount()); + wxASSERT(i < mHistory.size()); - if (i < mHistory.GetCount()) { + if (i < mHistory.size()) { mHistory.RemoveAt(i); if (update) { @@ -77,16 +77,16 @@ void FileHistory::RemoveFileFromHistory(size_t i, bool update) void FileHistory::Clear() { - mHistory.Clear(); + mHistory.clear(); AddFilesToMenu(); } const wxString &FileHistory::GetHistoryFile(size_t i) const { - wxASSERT(i < mHistory.GetCount()); + wxASSERT(i < mHistory.size()); - if (i < mHistory.GetCount()) { + if (i < mHistory.size()) { return mHistory[i]; } @@ -96,7 +96,7 @@ const wxString &FileHistory::GetHistoryFile(size_t i) const size_t FileHistory::GetCount() { - return mHistory.GetCount(); + return mHistory.size(); } void FileHistory::UseMenu(wxMenu *menu) @@ -116,7 +116,7 @@ void FileHistory::UseMenu(wxMenu *menu) void FileHistory::Load(wxConfigBase & config, const wxString & group) { - mHistory.Clear(); + mHistory.clear(); config.SetPath(group); @@ -140,8 +140,8 @@ void FileHistory::Save(wxConfigBase & config, const wxString & group) config.SetPath(group); // Stored in reverse order - int n = mHistory.GetCount() - 1; - for (size_t i = 1; i <= mHistory.GetCount(); i++) { + int n = mHistory.size() - 1; + for (size_t i = 1; i <= mHistory.size(); i++) { config.Write(wxString::Format(wxT("file%02d"), (int)i), mHistory[n--]); } @@ -162,17 +162,17 @@ void FileHistory::AddFilesToMenu(wxMenu *menu) for (auto end = items.end(), iter = items.begin(); iter != end;) menu->Destroy(*iter++); - for (size_t i = 0; i < mHistory.GetCount(); i++) { + for (size_t i = 0; i < mHistory.size(); i++) { wxString item = mHistory[i]; item.Replace( "&", "&&" ); menu->Append(mIDBase + 1 + i,item); } - if (mHistory.GetCount() > 0) { + if (mHistory.size() > 0) { menu->AppendSeparator(); } menu->Append(mIDBase, _("&Clear")); - menu->Enable(mIDBase, mHistory.GetCount() > 0); + menu->Enable(mIDBase, mHistory.size() > 0); } void FileHistory::Compress() diff --git a/src/widgets/Grid.cpp b/src/widgets/Grid.cpp index da563036f..66b7d058a 100644 --- a/src/widgets/Grid.cpp +++ b/src/widgets/Grid.cpp @@ -255,9 +255,9 @@ wxGridCellRenderer *NumericRenderer::Clone() const ChoiceEditor::ChoiceEditor(size_t count, const wxString choices[]) { if (count) { - mChoices.Alloc(count); + mChoices.reserve(count); for (size_t n = 0; n < count; n++) { - mChoices.Add(choices[n]); + mChoices.push_back(choices[n]); } } } @@ -332,7 +332,7 @@ bool ChoiceEditor::EndEdit(int WXUNUSED(row), int WXUNUSED(col), int sel = Choice()->GetSelection(); // This can happen if the wxChoice control is displayed and the list of choices get changed - if ((sel < 0) || (sel >= (int)(mChoices.GetCount()))) + if ((sel < 0) || (sel >= (int)(mChoices.size()))) { return false; } @@ -707,7 +707,7 @@ wxAccStatus GridAx::GetChildCount(int *childCount) // a document has a default action of "Press" rather than "Prints the current document." wxAccStatus GridAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -715,7 +715,7 @@ wxAccStatus GridAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName // Returns the description for this object or a child. wxAccStatus GridAx::GetDescription(int WXUNUSED(childId), wxString *description) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -723,7 +723,7 @@ wxAccStatus GridAx::GetDescription(int WXUNUSED(childId), wxString *description) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus GridAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -732,7 +732,7 @@ wxAccStatus GridAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) // Return e.g. ALT+K wxAccStatus GridAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -766,7 +766,7 @@ wxAccStatus GridAx::GetName(int childId, wxString *name) if (GetRowCol(childId, row, col)) { wxString n = mGrid->GetColLabelValue(col); wxString v = mGrid->GetCellValue(row, col); - if (v.IsEmpty()) { + if (v.empty()) { v = _("Empty"); } @@ -888,7 +888,7 @@ wxAccStatus GridAx::GetValue(int childId, wxString *strValue) wxAccStatus GridAx::GetValue(int WXUNUSED(childId), wxString *strValue) #endif { - strValue->Clear(); + strValue->clear(); #if defined(__WXMSW__) return wxACC_OK; diff --git a/src/widgets/HelpSystem.cpp b/src/widgets/HelpSystem.cpp index b3b9ce2f6..b322ac1bf 100644 --- a/src/widgets/HelpSystem.cpp +++ b/src/widgets/HelpSystem.cpp @@ -229,16 +229,16 @@ void HelpSystem::ShowHelp(wxWindow *parent, else localfile = localFileName; - if( (HelpMode == wxT("FromInternet")) && !remoteURL.IsEmpty() ) + if( (HelpMode == wxT("FromInternet")) && !remoteURL.empty() ) { // Always go to remote URL. Use External browser. OpenInDefaultBrowser( remoteURL ); } - else if( localfile.IsEmpty() || !wxFileExists( localfile )) + else if( localfile.empty() || !wxFileExists( localfile )) { // If you give an empty remote URL, you should have already ensured // that the file exists! - wxASSERT( !remoteURL.IsEmpty() ); + wxASSERT( !remoteURL.empty() ); // I can't find it'. // Use Built-in browser to suggest you use the remote url. wxString Text = HelpText( wxT("remotehelp") ); @@ -496,7 +496,7 @@ wxString QuickFixDialog::StringFromEvent( wxCommandEvent &event ) return ""; } wxString Str = pStrCd->GetData(); - if( Str.IsEmpty()){ + if( Str.empty()){ wxFAIL_MSG( "String data empty"); return ""; } diff --git a/src/widgets/HtmlWindow.cpp b/src/widgets/HtmlWindow.cpp index d850e8e83..bc03842ae 100644 --- a/src/widgets/HtmlWindow.cpp +++ b/src/widgets/HtmlWindow.cpp @@ -97,7 +97,7 @@ wxAccStatus HtmlWindowAx::GetChildCount(int* childCount) // "Press" rather than "Prints the current document." wxAccStatus HtmlWindowAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionName) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -105,7 +105,7 @@ wxAccStatus HtmlWindowAx::GetDefaultAction(int WXUNUSED(childId), wxString* acti // Returns the description for this object or a child. wxAccStatus HtmlWindowAx::GetDescription( int WXUNUSED(childId), wxString *description ) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -125,7 +125,7 @@ wxAccStatus HtmlWindowAx::GetFocus(int* childId, wxAccessible** child) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus HtmlWindowAx::GetHelpText( int WXUNUSED(childId), wxString *helpText ) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -134,7 +134,7 @@ wxAccStatus HtmlWindowAx::GetHelpText( int WXUNUSED(childId), wxString *helpText // Return e.g. ALT+K wxAccStatus HtmlWindowAx::GetKeyboardShortcut( int WXUNUSED(childId), wxString *shortcut ) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -157,7 +157,7 @@ wxAccStatus HtmlWindowAx::GetName(int WXUNUSED(childId), wxString* name) HtmlWindow *hw = wxDynamicCast( GetWindow(), HtmlWindow ); *name = hw->GetName(); - if( name->IsEmpty() ) + if( name->empty() ) { *name = hw->GetLabel(); } diff --git a/src/widgets/KeyView.cpp b/src/widgets/KeyView.cpp index efd74ad13..6a466c8c9 100644 --- a/src/widgets/KeyView.cpp +++ b/src/widgets/KeyView.cpp @@ -130,7 +130,7 @@ KeyView::GetFullLabel(int index) const wxString label = node.label; // Prepend the prefix if available - if (!node.prefix.IsEmpty()) + if (!node.prefix.empty()) { label = node.prefix + wxT(" - ") + label; } @@ -462,7 +462,7 @@ KeyView::RecalcExtents() // Prepend prefix for view types other than tree wxString label = node.label; - if (mViewType != ViewByTree && !node.prefix.IsEmpty()) + if (mViewType != ViewByTree && !node.prefix.empty()) { label = node.prefix + wxT(" - ") + label; } @@ -542,7 +542,7 @@ KeyView::RefreshBindings(const wxArrayString & names, bool inpfx = false; // Examine all names...all arrays passed have the same indexes - int cnt = (int) names.GetCount(); + int cnt = (int) names.size(); for (int i = 0; i < cnt; i++) { wxString name = names[i]; @@ -682,7 +682,7 @@ KeyView::RefreshBindings(const wxArrayString & names, // Prepend prefix for all view types to determine maximum // column widths wxString label = node.label; - if (!node.prefix.IsEmpty()) + if (!node.prefix.empty()) { label = node.prefix + wxT(" - ") + label; } @@ -695,7 +695,7 @@ KeyView::RefreshBindings(const wxArrayString & names, #if 0 // For debugging - for (int j = 0; j < mNodes.GetCount(); j++) + for (int j = 0; j < mNodes.size(); j++) { KeyNode & node = mNodes[j]; wxLogDebug(wxT("NODE line %4d index %4d depth %1d open %1d parent %1d cat %1d pfx %1d name %s STR %s | %s | %s"), @@ -737,7 +737,7 @@ KeyView::RefreshLines(bool bSort) mLines.clear(); // Process a filter if one is set - if (!mFilter.IsEmpty()) + if (!mFilter.empty()) { // Examine all nodes for (int i = 0; i < cnt; i++) @@ -918,7 +918,7 @@ KeyView::RefreshLines(bool bSort) if( bSort ) { //To see how many lines are being sorted (and how often). - //wxLogDebug("Sorting %i lines for type %i", mLines.GetCount(), mViewType); + //wxLogDebug("Sorting %i lines for type %i", mLines.size(), mViewType); // Speed up the comparison function used in sorting // by only translating this string once. @@ -949,7 +949,7 @@ KeyView::RefreshLines(bool bSort) #if 0 // For debugging - for (int j = 0; j < mLines.GetCount(); j++) + for (int j = 0; j < mLines.size(); j++) { KeyNode & node = *mLines[j]; wxLogDebug(wxT("LINE line %4d index %4d depth %1d open %1d parent %1d cat %1d pfx %1d name %s STR %s | %s | %s"), @@ -1175,7 +1175,7 @@ KeyView::OnDrawItem(wxDC & dc, const wxRect & rect, size_t line) const wxCoord x = rect.x + KV_LEFT_MARGIN - mScrollX; // Prepend prefix if available - if (!node->prefix.IsEmpty()) + if (!node->prefix.empty()) { label = node->prefix + wxT(" - ") + label; } @@ -1599,13 +1599,13 @@ KeyView::CmpKeyNodeByName(KeyNode *t1, KeyNode *t2) wxString k2 = t2->label; // Prepend prefix if available - if (!t1->prefix.IsEmpty()) + if (!t1->prefix.empty()) { k1 = t1->prefix + wxT(" - ") + k1; } // Prepend prefix if available - if (!t2->prefix.IsEmpty()) + if (!t2->prefix.empty()) { k2 = t2->prefix + wxT(" - ") + k2; } @@ -1633,25 +1633,25 @@ KeyView::CmpKeyNodeByKey(KeyNode *t1, KeyNode *t2) wxString k2 = t2->key.Display(); // Left node is unassigned, so prefix it - if(k1.IsEmpty()) + if(k1.empty()) { k1 = wxT("\xff"); } // Right node is unassigned, so prefix it - if(k2.IsEmpty()) + if(k2.empty()) { k2 = wxT("\xff"); } // Add prefix if available - if (!t1->prefix.IsEmpty()) + if (!t1->prefix.empty()) { k1 += t1->prefix + wxT(" - "); } // Add prefix if available - if (!t2->prefix.IsEmpty()) + if (!t2->prefix.empty()) { k2 += t2->prefix + wxT(" - "); } @@ -1742,7 +1742,7 @@ KeyView::GetValue(int line) wxString key = GetKey(index).Display(); // Add the key if it isn't empty - if (!key.IsEmpty()) + if (!key.empty()) { if (mViewType == ViewByKey) { @@ -1933,7 +1933,7 @@ KeyViewAx::GetChildCount(int *childCount) wxAccStatus KeyViewAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -1942,7 +1942,7 @@ KeyViewAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName) wxAccStatus KeyViewAx::GetDescription(int WXUNUSED(childId), wxString *description) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -1951,7 +1951,7 @@ KeyViewAx::GetDescription(int WXUNUSED(childId), wxString *description) wxAccStatus KeyViewAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) { - helpText->Clear(); + helpText->clear(); return wxACC_OK; } @@ -1961,7 +1961,7 @@ KeyViewAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) wxAccStatus KeyViewAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -2152,7 +2152,7 @@ KeyViewAx::GetValue(int childId, wxString *strValue) { int line; - strValue->Clear(); + strValue->clear(); if (!IdToLine(childId, line)) { diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 9283c69a5..ffc878ae1 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -586,7 +586,7 @@ void MeterPanel::OnPaint(wxPaintEvent & WXUNUSED(event)) texts.Add( _("Click to Start") ); texts.Add( _("Click") ); - for( size_t i = 0, cnt = texts.GetCount(); i < cnt; i++ ) + for( size_t i = 0, cnt = texts.size(); i < cnt; i++ ) { wxString Text = wxT(" ") + texts[i] + wxT(" "); wxSize Siz = destDC.GetTextExtent( Text ); @@ -2116,7 +2116,7 @@ wxAccStatus MeterAx::GetDefaultAction(int WXUNUSED(childId), wxString* actionNam // Returns the description for this object or a child. wxAccStatus MeterAx::GetDescription(int WXUNUSED(childId), wxString *description) { - description->Clear(); + description->clear(); return wxACC_NOT_SUPPORTED; } @@ -2134,7 +2134,7 @@ wxAccStatus MeterAx::GetFocus(int* childId, wxAccessible** child) // Returns help text for this object or a child, similar to tooltip text. wxAccStatus MeterAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) { - helpText->Clear(); + helpText->clear(); return wxACC_NOT_SUPPORTED; } @@ -2142,7 +2142,7 @@ wxAccStatus MeterAx::GetHelpText(int WXUNUSED(childId), wxString *helpText) // Return e.g. ALT+K wxAccStatus MeterAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -2170,10 +2170,10 @@ wxAccStatus MeterAx::GetName(int WXUNUSED(childId), wxString* name) else { *name = m->GetName(); - if (name->IsEmpty()) + if (name->empty()) *name = m->GetLabel(); - if (name->IsEmpty()) + if (name->empty()) *name = _("Meter"); if (m->mMonitoring) diff --git a/src/widgets/NumericTextCtrl.cpp b/src/widgets/NumericTextCtrl.cpp index 486938b4e..4090b03a5 100644 --- a/src/widgets/NumericTextCtrl.cpp +++ b/src/widgets/NumericTextCtrl.cpp @@ -1942,7 +1942,7 @@ wxAccStatus NumericTextCtrlAx::GetChildCount(int *childCount) // "Press" rather than "Prints the current document." wxAccStatus NumericTextCtrlAx::GetDefaultAction(int WXUNUSED(childId), wxString *actionName) { - actionName->Clear(); + actionName->clear(); return wxACC_OK; } @@ -1950,7 +1950,7 @@ wxAccStatus NumericTextCtrlAx::GetDefaultAction(int WXUNUSED(childId), wxString // Returns the description for this object or a child. wxAccStatus NumericTextCtrlAx::GetDescription(int WXUNUSED(childId), wxString *description) { - description->Clear(); + description->clear(); return wxACC_OK; } @@ -1979,7 +1979,7 @@ wxAccStatus NumericTextCtrlAx::GetHelpText(int WXUNUSED(childId), wxString *help return wxACC_OK; #else - helpText->Clear(); + helpText->clear(); return wxACC_NOT_SUPPORTED; #endif @@ -1989,7 +1989,7 @@ wxAccStatus NumericTextCtrlAx::GetHelpText(int WXUNUSED(childId), wxString *help // Return e.g. ALT+K wxAccStatus NumericTextCtrlAx::GetKeyboardShortcut(int WXUNUSED(childId), wxString *shortcut) { - shortcut->Clear(); + shortcut->clear(); return wxACC_OK; } @@ -2034,7 +2034,7 @@ wxAccStatus NumericTextCtrlAx::GetName(int childId, wxString *name) (childId < 1)) { *name = mCtrl->GetName(); - if (name->IsEmpty()) { + if (name->empty()) { *name = mCtrl->GetLabel(); } diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index e130efc69..930a2bb85 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -1492,7 +1492,7 @@ ProgressResult ProgressDialog::Update(double current, double total, const wxStri // void ProgressDialog::SetMessage(const wxString & message) { - if (!message.IsEmpty()) + if (!message.empty()) { mMessage->SetLabel(message); @@ -1591,7 +1591,7 @@ void ProgressDialog::Beep() const wxBusyCursor busy; wxSound s; - if (name.IsEmpty()) + if (name.empty()) { s.Create(sizeof(beep), beep); } diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index bb08662b2..ab4508301 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -1140,7 +1140,7 @@ void Ruler::Update(const TimeTrack* timetrack)// Envelope *speedEnv, long minSpe step = floor(sg * warpedD / denom); bool major = jj == 0; Tick(i, sg * step * denom, major, !major); - if( !major && mMinorLabels[mNumMinor-1].text.IsEmpty() ){ + if( !major && mMinorLabels[mNumMinor-1].text.empty() ){ nDroppedMinorLabels++; } } @@ -1532,7 +1532,7 @@ void Ruler::SetCustomMajorLabels(wxArrayString *label, size_t numLabel, int star mMajorLabels.reinit(numLabel); for(size_t i = 0; iItem(i); + mMajorLabels[i].text = (*label)[i]; mMajorLabels[i].pos = start + i*step; } //Remember: DELETE majorlabels.... @@ -1544,7 +1544,7 @@ void Ruler::SetCustomMinorLabels(wxArrayString *label, size_t numLabel, int star mMinorLabels.reinit(numLabel); for(size_t i = 0; iItem(i); + mMinorLabels[i].text = (*label)[i]; mMinorLabels[i].pos = start + i*step; } //Remember: DELETE majorlabels.... diff --git a/src/widgets/numformatter.cpp b/src/widgets/numformatter.cpp index a309a6f52..54f7b90e6 100644 --- a/src/widgets/numformatter.cpp +++ b/src/widgets/numformatter.cpp @@ -74,7 +74,7 @@ bool NumberFormatter::GetThousandsSeparatorIfUsed(wxChar *sep) struct lconv *info = localeconv(); wxString s = info ? wxString::FromUTF8(info->thousands_sep) : wxT(""); - if (s.IsEmpty()) + if (s.empty()) { return false; } diff --git a/src/xml/XMLTagHandler.cpp b/src/xml/XMLTagHandler.cpp index 29d0de5f6..7560899d9 100644 --- a/src/xml/XMLTagHandler.cpp +++ b/src/xml/XMLTagHandler.cpp @@ -74,7 +74,7 @@ bool XMLValueChecker::IsGoodFileName(const wxString & strFileName, const wxStrin bool XMLValueChecker::IsGoodFileString(const wxString &str) { return (IsGoodString(str) && - !str.IsEmpty() && + !str.empty() && // FILENAME_MAX is 260 in MSVC, but inconsistent across platforms, // sometimes huge, but we use 260 for all platforms. @@ -109,7 +109,7 @@ bool XMLValueChecker::IsGoodPathName(const wxString & strPathName) bool XMLValueChecker::IsGoodPathString(const wxString &str) { return (IsGoodString(str) && - !str.IsEmpty() && + !str.empty() && (str.Length() <= PLATFORM_MAX_PATH)); } @@ -193,18 +193,18 @@ bool XMLTagHandler::ReadXMLTag(const char *tag, const char **attrs) while (*attrs) { const char *s = *attrs++; - tmp_attrs.Add(UTF8CTOWX(s)); + tmp_attrs.push_back(UTF8CTOWX(s)); } // JKC: Previously the next line was: -// const char **out_attrs = NEW char (const char *)[tmp_attrs.GetCount()+1]; +// const char **out_attrs = NEW char (const char *)[tmp_attrs.size()+1]; // however MSVC doesn't like the constness in this position, so this is now // added by a cast after creating the array of pointers-to-non-const chars. - auto out_attrs = std::make_unique(tmp_attrs.GetCount() + 1); - for (size_t i=0; i(tmp_attrs.size() + 1); + for (size_t i=0; i 0) { + if (mTagstack.size() > 0) { if (mTagstack[0] == name) { if (mHasKids[1]) { // There will always be at least 2 at this point if (mInTag) { @@ -349,7 +349,7 @@ void XMLFileWriter::Commit() void XMLFileWriter::PreCommit() // may throw { - while (mTagstack.GetCount()) { + while (mTagstack.size()) { EndTag(mTagstack[0]); } @@ -418,7 +418,7 @@ XMLStringWriter::XMLStringWriter(size_t initialSize) { if (initialSize) { - Alloc(initialSize); + reserve(initialSize); } }