From a345d05f0fc00bae22a2358bf55443b46f4bc8fd Mon Sep 17 00:00:00 2001 From: John Emmas Date: Tue, 7 May 2024 10:32:25 +0100 Subject: [PATCH] When importing AAF's move some code so that it only gets executed once per Source, rather than once for every Region Fixes a problem where the Editor's 'Sources' pane was showing too many entries if there were more Regions than Sources. --- gtk2_ardour/ardour_ui_aaf.cc | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/gtk2_ardour/ardour_ui_aaf.cc b/gtk2_ardour/ardour_ui_aaf.cc index b1312343da..f2c0abbbb7 100644 --- a/gtk2_ardour/ardour_ui_aaf.cc +++ b/gtk2_ardour/ardour_ui_aaf.cc @@ -188,7 +188,17 @@ import_sndfile_as_region (Session* s, struct aafiAudioEssencePointer* aafAudioEs } for (int i = 0; i < channelCount; i++) { + PropertyList proplist; sources->push_back (status.sources.at (i)); + + proplist.add (ARDOUR::Properties::start, 0); + proplist.add (ARDOUR::Properties::length, timecnt_t ((*sources)[0]->length (), pos)); + proplist.add (ARDOUR::Properties::name, aafAudioEssencePtrList->essenceFile->unique_name); + proplist.add (ARDOUR::Properties::layer, 0); + proplist.add (ARDOUR::Properties::whole_file, true); + proplist.add (ARDOUR::Properties::external, true); + + RegionFactory::create (*sources, proplist); } /* build peakfiles */ @@ -213,17 +223,6 @@ import_sndfile_as_region (Session* s, struct aafiAudioEssencePointer* aafAudioEs region_name = bump_name_once (region_name, '.'); } - PropertyList proplist; - - proplist.add (ARDOUR::Properties::start, 0); - proplist.add (ARDOUR::Properties::length, timecnt_t ((*sources)[0]->length (), pos)); - proplist.add (ARDOUR::Properties::name, aafAudioEssencePtrList->essenceFile->unique_name); - proplist.add (ARDOUR::Properties::layer, 0); - proplist.add (ARDOUR::Properties::whole_file, true); - proplist.add (ARDOUR::Properties::external, true); - - region = RegionFactory::create (*sources, proplist); - regions.push_back (region); return true; }