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