mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 08:09:32 +02:00
Avoid extra indirection in FormatList
This commit is contained in:
parent
00db530c9b
commit
8e995d66d0
@ -241,10 +241,9 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event))
|
||||
wxString filter;
|
||||
wxString all;
|
||||
|
||||
l.DeleteContents(true);
|
||||
Importer::Get().GetSupportedImportFormats(&l);
|
||||
for (FormatList::compatibility_iterator n = l.GetFirst(); n; n = n->GetNext()) {
|
||||
Format *f = n->GetData();
|
||||
for (const auto &format : l) {
|
||||
const Format *f = &format;
|
||||
|
||||
wxString newfilter = f->formatName + wxT("|");
|
||||
for (size_t i = 0; i < f->formatExtensions.size(); i++) {
|
||||
|
@ -2413,12 +2413,11 @@ wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString ext
|
||||
}
|
||||
|
||||
// Construct the filter
|
||||
l.DeleteContents(true);
|
||||
Importer::Get().GetSupportedImportFormats(&l);
|
||||
|
||||
for (FormatList::compatibility_iterator n = l.GetFirst(); n; n = n->GetNext()) {
|
||||
for (const auto &format : l) {
|
||||
/* this loop runs once per supported _format_ */
|
||||
Format *f = n->GetData();
|
||||
const Format *f = &format;
|
||||
|
||||
wxString newfilter = f->formatName + wxT("|");
|
||||
// bung format name into string plus | separator
|
||||
|
@ -62,7 +62,6 @@ and ImportLOF.cpp.
|
||||
|
||||
WX_DEFINE_LIST(ImportPluginList);
|
||||
WX_DEFINE_LIST(UnusableImportPluginList);
|
||||
WX_DEFINE_LIST(FormatList);
|
||||
WX_DEFINE_OBJARRAY(ExtImportItems);
|
||||
|
||||
// ============================================================================
|
||||
@ -138,8 +137,8 @@ void Importer::GetSupportedImportFormats(FormatList *formatList)
|
||||
while(importPluginNode)
|
||||
{
|
||||
ImportPlugin *importPlugin = importPluginNode->GetData();
|
||||
formatList->Append(new Format(importPlugin->GetPluginFormatDescription(),
|
||||
importPlugin->GetSupportedExtensions()));
|
||||
formatList->emplace_back(importPlugin->GetPluginFormatDescription(),
|
||||
importPlugin->GetSupportedExtensions());
|
||||
importPluginNode = importPluginNode->GetNext();
|
||||
}
|
||||
}
|
||||
|
@ -11,10 +11,9 @@
|
||||
#ifndef _IMPORT_
|
||||
#define _IMPORT_
|
||||
|
||||
#include <vector>
|
||||
#include <wx/arrstr.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/list.h>
|
||||
#include <wx/listimpl.cpp>
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/listbox.h>
|
||||
#include <wx/tokenzr.h>
|
||||
@ -41,7 +40,7 @@ public:
|
||||
|
||||
class ExtImportItem;
|
||||
|
||||
WX_DECLARE_LIST(Format, FormatList);
|
||||
using FormatList = std::vector<Format> ;
|
||||
WX_DEFINE_ARRAY_PTR(ImportPlugin *, ImportPluginPtrArray);
|
||||
WX_DECLARE_OBJARRAY(ExtImportItem, ExtImportItems);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user