mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-25 15:53:52 +02:00
Sweep for filename copying: import and export
This commit is contained in:
@@ -98,7 +98,7 @@ public:
|
||||
~ExportFFmpeg() override;
|
||||
|
||||
/// Callback, called from GetFilename
|
||||
bool CheckFileName(wxFileName &filename, int format = 0);
|
||||
bool CheckFileName(wxFileName &filename, int format = 0) override;
|
||||
|
||||
/// Format intialization
|
||||
bool Init(const char *shortname, AudacityProject *project, const Tags *metadata, int subformat);
|
||||
|
||||
@@ -920,24 +920,28 @@ int ExportMultiple::ExportMultipleByTrack(bool byName,
|
||||
}
|
||||
|
||||
int ExportMultiple::DoExport(int channels,
|
||||
wxFileName name,
|
||||
const wxFileName &inName,
|
||||
bool selectedOnly,
|
||||
double t0,
|
||||
double t1,
|
||||
const Tags &tags)
|
||||
{
|
||||
wxLogDebug(wxT("Doing multiple Export: File name \"%s\""), (name.GetFullName()).c_str());
|
||||
wxFileName name;
|
||||
|
||||
wxLogDebug(wxT("Doing multiple Export: File name \"%s\""), (inName.GetFullName()).c_str());
|
||||
wxLogDebug(wxT("Channels: %i, Start: %lf, End: %lf "), channels, t0, t1);
|
||||
if (selectedOnly) wxLogDebug(wxT("Selected Region Only"));
|
||||
else wxLogDebug(wxT("Whole Project"));
|
||||
|
||||
if (mOverwrite->GetValue()) {
|
||||
// Make sure we don't overwrite (corrupt) alias files
|
||||
if (!mProject->GetDirManager()->EnsureSafeFilename(name)) {
|
||||
if (!mProject->GetDirManager()->EnsureSafeFilename(inName)) {
|
||||
return false;
|
||||
}
|
||||
name = inName;
|
||||
}
|
||||
else {
|
||||
name = inName;
|
||||
int i = 2;
|
||||
wxString base(name.GetName());
|
||||
while (name.FileExists()) {
|
||||
@@ -946,9 +950,10 @@ int ExportMultiple::DoExport(int channels,
|
||||
}
|
||||
|
||||
// Call the format export routine
|
||||
const wxString fullPath{name.GetFullPath()};
|
||||
int success = mPlugins[mPluginIndex]->Export(mProject,
|
||||
channels,
|
||||
name.GetFullPath(),
|
||||
fullPath,
|
||||
selectedOnly,
|
||||
t0,
|
||||
t1,
|
||||
@@ -957,7 +962,7 @@ int ExportMultiple::DoExport(int channels,
|
||||
mSubFormatIndex);
|
||||
|
||||
if (success == eProgressSuccess || success == eProgressStopped) {
|
||||
mExported.Add(name.GetFullPath());
|
||||
mExported.Add(fullPath);
|
||||
}
|
||||
|
||||
Refresh();
|
||||
|
||||
@@ -74,7 +74,7 @@ private:
|
||||
* @param tags Metadata to include in the file (if possible).
|
||||
*/
|
||||
int DoExport(int channels,
|
||||
wxFileName name,
|
||||
const wxFileName &name,
|
||||
bool selectedOnly,
|
||||
double t0,
|
||||
double t1,
|
||||
|
||||
Reference in New Issue
Block a user