1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-26 23:33:49 +01:00

Construct Exporter with project pointer, fewer GetActiveProject calls

This commit is contained in:
Paul Licameli
2019-05-21 20:16:20 -04:00
parent ece7bd888d
commit d23569ca10
13 changed files with 50 additions and 51 deletions

View File

@@ -40,7 +40,7 @@ void DoExport( AudacityProject &project, const FileExtension & Format )
{
auto &tracks = TrackList::Get( project );
Exporter e;
Exporter e{ project };
MissingAliasFilesDialog::SetShouldShow(true);
double t0 = 0.0;
@@ -85,7 +85,7 @@ void DoExport( AudacityProject &project, const FileExtension & Format )
{
// Do export with prompting.
e.SetDefaultFormat(Format);
e.Process(&project, false, t0, t1);
e.Process(false, t0, t1);
}
else
{
@@ -94,7 +94,6 @@ void DoExport( AudacityProject &project, const FileExtension & Format )
// We really can proceed without prompting.
int nChannels = MacroCommands::IsMono() ? 1 : 2;
e.Process(
&project, // AudacityProject
nChannels, // numChannels,
Format, // type,
filename, // filename,
@@ -201,11 +200,11 @@ void OnExportSelection(const CommandContext &context)
{
auto &project = context.project;
auto &selectedRegion = ViewInfo::Get( project ).selectedRegion;
Exporter e;
Exporter e{ project };
MissingAliasFilesDialog::SetShouldShow(true);
e.SetFileDialogTitle( XO("Export Selected Audio") );
e.Process(&project, true, selectedRegion.t0(),
e.Process(true, selectedRegion.t0(),
selectedRegion.t1());
}

View File

@@ -47,7 +47,7 @@ AudacityProject::AttachedWindows::RegisteredFactory sMacrosWindowKey{
[]( AudacityProject &parent ) -> wxWeakRef< wxWindow > {
auto &window = ProjectWindow::Get( parent );
return safenew MacrosWindow(
&window, true
&window, parent, true
);
}
};
@@ -543,7 +543,7 @@ void OnApplyMacroDirectly(const CommandContext &context )
auto &window = ProjectWindow::Get( project );
//wxLogDebug( "Macro was: %s", context.parameter);
ApplyMacroDialog dlg( &window );
ApplyMacroDialog dlg( &window, project );
const auto &Name = context.parameter;
// We used numbers previously, but macros could get renumbered, making