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:
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user