AUP3: First go at the AUP importer

Near as I can tell, it's pretty much done. Feeding all manner of
.aup projects will definitely need to be done. It would be best
to feed it REAL projects, not the contrived ones I've been playing
with.
This commit is contained in:
Leland Lucius 2020-07-12 03:53:25 -05:00
parent f34b9697c0
commit 251da3bb3b
4 changed files with 1507 additions and 4 deletions

View File

@ -619,7 +619,7 @@ list( APPEND SOURCES
# Standard importers
# import/ImportAUP.cpp
import/ImportAUP.cpp
import/ImportLOF.cpp
import/ImportPCM.cpp
import/ImportPlugin.h

View File

@ -1193,6 +1193,16 @@ bool ProjectFileManager::Import(
return false;
}
// for AUP ("legacy project") files, do not import the file as if it
// were an audio file itself
if (fileName.AfterLast('.').IsSameAs(wxT("aup"), false)) {
auto &history = ProjectHistory::Get( project );
history.PushState(XO("Imported '%s'").Format( fileName ), XO("Import"));
return false;
}
// PRL: Undo history is incremented inside this:
auto newSharedTracks = AddImportedTracks(fileName, std::move(newTracks));

View File

@ -15,7 +15,7 @@
and return the tracks that were imported. This function just
figures out which one to call; the actual importers are in
ImportPCM, ImportMP3, ImportOGG, ImportRawData, ImportLOF,
ImportQT and ImportFLAC.
ImportQT, ImportFLAC and ImportAUP.
*//***************************************************************//**
@ -29,7 +29,7 @@ It's defined in Import.h
\class Importer
\brief Class which actually imports the auido, using functions defined
in ImportPCM.cpp, ImportMP3.cpp, ImportOGG.cpp, ImportRawData.cpp,
and ImportLOF.cpp.
ImportLOF.cpp, and ImportAUP.cpp.
*//******************************************************************/
@ -137,7 +137,7 @@ bool Importer::Initialize()
using namespace Registry;
static OrderingPreferenceInitializer init{
PathStart,
{ {wxT(""), wxT("PCM,OGG,FLAC,MP3,LOF,FFmpeg") } }
{ {wxT(""), wxT("AUP,PCM,OGG,FLAC,MP3,LOF,FFmpeg") } }
// QT and GStreamer are only conditionally compiled and would get
// placed at the end if present
};
@ -634,6 +634,12 @@ bool Importer::Import( AudacityProject &project,
return true;
}
// AUP ("legacy projects") have different semantics
if (extension.IsSameAs(wxT("aup"), false))
{
return true;
}
auto end = tracks.end();
auto iter = std::remove_if( tracks.begin(), end,
std::mem_fn( &NewChannelGroup::empty ) );

1487
src/import/ImportAUP.cpp Normal file

File diff suppressed because it is too large Load Diff