1
0
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:
Paul Licameli
2016-02-21 23:21:11 -05:00
parent 8f02213e23
commit c3cca71461
6 changed files with 19 additions and 17 deletions

View File

@@ -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);

View File

@@ -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();

View File

@@ -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,