1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-05 16:43:52 +01:00

Bug 2372 - ENH: Export Multiple with (external program) Audacity fails to export if labels have no extension

This commit is contained in:
Leland Lucius
2020-04-02 08:38:25 -05:00
parent 9eaa2f28f7
commit 66661daa05

View File

@@ -134,10 +134,15 @@ void ExportCLOptions::PopulateOrExchange(ShuttleGui & S)
cmds);
S.Id(ID_BROWSE).AddButton(XO("Browse..."),
wxALIGN_CENTER_VERTICAL);
S.TieTextBox(XO("Extension:"),
{ wxT("/FileFormats/ExternalProgramExtension"), wxT("wav") },
30);
S.AddFixedText( {} );
S.AddFixedText( {} );
S.TieCheckBox(XO("Show output"),
{wxT("/FileFormats/ExternalProgramShowOutput"),
false});
S.AddFixedText({});
}
S.EndMultiColumn();
}
@@ -305,6 +310,7 @@ private:
std::vector<char> GetMetaChunk(const Tags *metadata);
wxString mCmd;
wxString mExt;
bool mShow;
struct ExtendPath
@@ -375,15 +381,17 @@ ProgressResult ExportCL::Export(AudacityProject *project,
wxString output;
long rc;
const auto path = fName.GetFullPath();
GetSettings();
// Bug 2178 - users who don't know what they are doing will
// now get a file extension of .wav appended to their ffmpeg filename
// and therefore ffmpeg will be able to choose a file type.
if( mCmd == wxT("ffmpeg -i - \"%f\"") && !fName.HasExt())
mCmd.Replace( "%f", "%f.wav" );
wxFileName fn = fName;
if (!fn.HasExt()) {
if (mCmd.find(wxT("%f.")) == wxNOT_FOUND) {
fn.SetExt(mExt);
}
}
const auto path = fn.GetFullPath();
mCmd.Replace(wxT("%f"), path);
// Kick off the command
@@ -800,6 +808,7 @@ void ExportCL::GetSettings()
// Retrieve settings
gPrefs->Read(wxT("/FileFormats/ExternalProgramShowOutput"), &mShow, false);
mCmd = gPrefs->Read(wxT("/FileFormats/ExternalProgramExportCommand"), wxT("lame - \"%f.mp3\""));
mExt = gPrefs->Read(wxT("/FileFormats/ExternalProgramExtension"), wxT("wav"));
}
static Exporter::RegisteredExportPlugin sRegisteredPlugin{ "CommandLine",