From d5223c0c2c84970ed5d0f9cb001c5fdf9e3a4c0a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 28 Aug 2021 15:28:41 -0600 Subject: [PATCH] allow Editor source list to contain empty MIDI whole file regions --- gtk2_ardour/editor_sources.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk2_ardour/editor_sources.cc b/gtk2_ardour/editor_sources.cc index f8b4d65b61..6ba481bec6 100644 --- a/gtk2_ardour/editor_sources.cc +++ b/gtk2_ardour/editor_sources.cc @@ -495,10 +495,17 @@ EditorSources::add_source (boost::shared_ptr region) * if there's some other kind of source, we ignore it (for now) */ boost::shared_ptr fs = boost::dynamic_pointer_cast (region->source()); - if (!fs || fs->empty()) { + if (!fs) { return; } + if (fs->empty()) { + /* MIDI sources are allowed to be empty */ + if (!boost::dynamic_pointer_cast (region->source())) { + return; + } + } + region->DropReferences.connect (remove_region_connections, MISSING_INVALIDATOR, boost::bind (&EditorSources::remove_weak_region, this, boost::weak_ptr (region)), gui_context()); TreeModel::Row row = *(_model->append());