From 7c69b0ab8228a8aeae1185ccfca7d567e5e06306 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 5 Feb 2014 18:49:32 +0100 Subject: [PATCH 01/10] add debug-message to track down missing Sources --- libs/ardour/session_state.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index f3ad9d66dd..1728c11244 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -979,9 +979,19 @@ Session::state (bool full_state) if (!fs->destructive()) { if (fs->empty() && !fs->used()) { +#ifndef NDEBUG + cerr << "DEBUG: source '" + << fs->name() << "' id: " + << fs->id() << " is marked as empty and unused and is not saved.\n"; +#endif continue; } } +#ifndef NDEBUG + cerr << "DEBUG: saving source '" + << fs->name() << "' id: " + << fs->id() << ".\n"; +#endif child->add_child_nocopy (siter->second->get_state()); } From 5396459667a66f44707e535299164c93a5594082 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Feb 2014 17:55:46 +0100 Subject: [PATCH 02/10] update available panners when panshell changes Fixes issue when adding splitting plugin --- gtk2_ardour/mixer_strip.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 830d2bf161..db5287f0d0 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -1033,6 +1033,7 @@ MixerStrip::connect_to_pan () if (panners._panner == 0) { panners.panshell_changed (); } + update_panner_choices(); } void From 46806c1595afb1ee499a211b7455857b1cd79e33 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Feb 2014 18:05:47 +0100 Subject: [PATCH 03/10] panner UI: check URI and #of channels on re-configuration --- gtk2_ardour/panner_ui.cc | 16 +++++++++++----- gtk2_ardour/panner_ui.h | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/gtk2_ardour/panner_ui.cc b/gtk2_ardour/panner_ui.cc index 9ea2b357eb..c0c305fae1 100644 --- a/gtk2_ardour/panner_ui.cc +++ b/gtk2_ardour/panner_ui.cc @@ -49,6 +49,7 @@ const int PannerUI::pan_bar_height = 35; PannerUI::PannerUI (Session* s) : _current_nouts (-1) , _current_nins (-1) + , _current_uri ("") , pan_automation_style_button ("") , pan_automation_state_button ("") , _panner_list() @@ -214,12 +215,17 @@ PannerUI::setup_pan () int const nouts = _panner ? _panner->out().n_audio() : -1; int const nins = _panner ? _panner->in().n_audio() : -1; - if (nouts == _current_nouts && nins == _current_nins) { + if (nouts == _current_nouts + && nins == _current_nins + && _current_uri == _panshell->panner_gui_uri() + ) + { return; } _current_nins = nins; _current_nouts = nouts; + _current_uri = _panshell->panner_gui_uri(); container_clear (pan_vbox); @@ -236,7 +242,7 @@ PannerUI::setup_pan () return; } - if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_2in2out#ui") + if (_current_uri == "http://ardour.org/plugin/panner_2in2out#ui") { delete big_window; big_window = 0; @@ -262,8 +268,8 @@ PannerUI::setup_pan () boost::weak_ptr(ac))); _stereo_panner->signal_button_release_event().connect (sigc::mem_fun(*this, &PannerUI::pan_button_event)); } - else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_1in2out#ui" - || _panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_balance#ui") + else if (_current_uri == "http://ardour.org/plugin/panner_1in2out#ui" + || _current_uri == "http://ardour.org/plugin/panner_balance#ui") { delete big_window; big_window = 0; @@ -284,7 +290,7 @@ PannerUI::setup_pan () update_pan_sensitive (); pan_vbox.pack_start (*_mono_panner, false, false); } - else if (_panshell->panner_gui_uri() == "http://ardour.org/plugin/panner_vbap#ui") + else if (_current_uri == "http://ardour.org/plugin/panner_vbap#ui") { if (!twod_panner) { twod_panner = new Panner2d (_panshell, 61); diff --git a/gtk2_ardour/panner_ui.h b/gtk2_ardour/panner_ui.h index 9b349d664f..8bf448c7ea 100644 --- a/gtk2_ardour/panner_ui.h +++ b/gtk2_ardour/panner_ui.h @@ -96,6 +96,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr bool in_pan_update; int _current_nouts; int _current_nins; + std::string _current_uri; static const int pan_bar_height; From 52bff05a4aab789b7cdbd97714a9b6cac1c2f18c Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Feb 2014 19:21:30 +0100 Subject: [PATCH 04/10] fix stereo-panner GUI edge case (panshel changes, send|listen) --- gtk2_ardour/stereo_panner.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk2_ardour/stereo_panner.cc b/gtk2_ardour/stereo_panner.cc index d480c60529..2a5f521f1d 100644 --- a/gtk2_ardour/stereo_panner.cc +++ b/gtk2_ardour/stereo_panner.cc @@ -99,6 +99,7 @@ StereoPanner::StereoPanner (boost::shared_ptr p) width_control->Changed.connect (panvalue_connections, invalidator(*this), boost::bind (&StereoPanner::value_change, this), gui_context()); _panner_shell->Changed.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::bypass_handler, this), gui_context()); + _panner_shell->PannableChanged.connect (panshell_connections, invalidator (*this), boost::bind (&StereoPanner::pannable_handler, this), gui_context()); ColorsChanged.connect (sigc::mem_fun (*this, &StereoPanner::color_handler)); From 7bc3e0dab4dfac04d6c2957a2278345605c09769 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Feb 2014 19:30:43 +0100 Subject: [PATCH 05/10] don't add a [shared] panner for the sends to monitoing section fixes issue with 'stuck' mono panners (when using a stereo monitoring section and auto-connect): the send to monitor section is added after the main panner. At this point the channel-count is different, but the send shared panner() with the main route. Here: mono-panner on track, stereo-panner; and they shared control settings. since stereo-panner's width is 1, the position cannot be changed. --- libs/ardour/delivery.cc | 2 +- libs/ardour/internal_send.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 4a392a8145..8c12d44e51 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -397,7 +397,7 @@ Delivery::reset_panner () if (panners_legal) { if (!_no_panner_reset) { - if (_panshell && _role != Insert) { + if (_panshell && _role != Insert && _role != Listen) { _panshell->configure_io (ChanCount (DataType::AUDIO, pans_required()), ChanCount (DataType::AUDIO, pan_outs())); } } diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 1d4e18d06e..17a3ca1f42 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -129,7 +129,7 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame // we have to copy the input, because we may alter the buffers with the amp // in-place, which a send must never do. - if (_panshell && !_panshell->bypassed()) { + if (_panshell && !_panshell->bypassed() && role() != Listen) { _panshell->run (bufs, mixbufs, start_frame, end_frame, nframes); } else { if (role() == Listen) { From 60a9213035d3c9b8e17686778c70d91aa6acd356 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 13:38:15 -0500 Subject: [PATCH 06/10] fix utter confusion about session _path in new sessions. Yikes! --- libs/ardour/session_state.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 1728c11244..6d535b8e59 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -136,13 +136,21 @@ Session::pre_engine_init (string fullpath) /* discover canonical fullpath */ char buf[PATH_MAX+1]; - if (!realpath (fullpath.c_str(), buf) && (errno != ENOENT)) { - error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; - destroy (); - throw failed_constructor(); - } - _path = string(buf); + if (!realpath (fullpath.c_str(), buf)) { + if (errno == ENOENT) { + /* fullpath does not exist yet, so realpath() returned + * ENOENT. Just use it as-is + */ + _path = fullpath; + } else { + error << string_compose(_("Could not use path %1 (%2)"), buf, strerror(errno)) << endmsg; + destroy (); + throw failed_constructor(); + } + } else { + _path = string(buf); + } /* we require _path to end with a dir separator */ From ed75b9425b9d384d24f1c4fe41afd9f3a61a2d09 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 15:25:18 -0500 Subject: [PATCH 07/10] make backtrace symbols work again inside gtk2_ardour (-rdynamic is a link-time flag, not compile-time --- wscript | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wscript b/wscript index ae4b85e61d..57d3496465 100644 --- a/wscript +++ b/wscript @@ -177,10 +177,6 @@ def set_compiler_flags (conf,opt): if opt.gprofile: debug_flags = [ '-pg' ] - if opt.backtrace: - if platform != 'darwin' and not is_clang: - debug_flags = [ '-rdynamic' ] - # Autodetect if opt.dist_target == 'auto': if platform == 'darwin': @@ -415,6 +411,10 @@ def set_compiler_flags (conf,opt): conf.env.append_value('CFLAGS', optimization_flags) conf.env.append_value('CXXFLAGS', optimization_flags) + if opt.backtrace: + if platform != 'darwin' and not is_clang: + linker_flags += [ '-rdynamic' ] + conf.env.append_value('CFLAGS', compiler_flags) conf.env.append_value('CFLAGS', c_flags) conf.env.append_value('CXXFLAGS', compiler_flags) From 2c679132454fc3e4fdad28b1a87f11e923c236c6 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 17:16:13 -0500 Subject: [PATCH 08/10] Fix egregious logic bug in FileSource::removable() and introduce FileSource::is_stub() to hide logic for deciding if a source (file) is a stub --- libs/ardour/file_source.cc | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/libs/ardour/file_source.cc b/libs/ardour/file_source.cc index 0921498186..c6f3a9cd5d 100644 --- a/libs/ardour/file_source.cc +++ b/libs/ardour/file_source.cc @@ -101,7 +101,7 @@ FileSource::removable () const { bool r = ((_flags & Removable) && ((_flags & RemoveAtDestroy) || - ((_flags & RemovableIfEmpty) && empty() == 0))); + ((_flags & RemovableIfEmpty) && empty()))); return r; } @@ -589,3 +589,21 @@ FileSource::inc_use_count () Source::inc_use_count (); } +bool +FileSource::is_stub () const +{ + if (!empty()) { + return false; + } + + if (!removable()) { + return false; + } + + if (Glib::file_test (_path, Glib::FILE_TEST_EXISTS)) { + return false; + } + + return true; +} + From f715cd877c6a14a208052b4217a6a40f007da20a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 17:30:34 -0500 Subject: [PATCH 09/10] add FileSource::is_stub() declaration --- libs/ardour/ardour/file_source.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/ardour/ardour/file_source.h b/libs/ardour/ardour/file_source.h index 5898d04f0a..3d9c8c623f 100644 --- a/libs/ardour/ardour/file_source.h +++ b/libs/ardour/ardour/file_source.h @@ -74,6 +74,7 @@ public: void inc_use_count (); bool removable () const; + bool is_stub () const; const std::string& origin() const { return _origin; } From d47fe167e3c1dc44e4114227b0e8b83b40b35169 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 7 Feb 2014 17:38:42 -0500 Subject: [PATCH 10/10] when cleaning up sources, do not remove "stub" sources from the source list, even though they do not exist on disk yet; remove some debug output --- libs/ardour/session_state.cc | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc index 6d535b8e59..ffbe55afbf 100644 --- a/libs/ardour/session_state.cc +++ b/libs/ardour/session_state.cc @@ -987,19 +987,9 @@ Session::state (bool full_state) if (!fs->destructive()) { if (fs->empty() && !fs->used()) { -#ifndef NDEBUG - cerr << "DEBUG: source '" - << fs->name() << "' id: " - << fs->id() << " is marked as empty and unused and is not saved.\n"; -#endif continue; } } -#ifndef NDEBUG - cerr << "DEBUG: saving source '" - << fs->name() << "' id: " - << fs->id() << ".\n"; -#endif child->add_child_nocopy (siter->second->get_state()); } @@ -2710,19 +2700,23 @@ Session::cleanup_sources (CleanupReport& rep) ++tmp; if ((fs = boost::dynamic_pointer_cast (i->second)) != 0) { - if (playlists->source_use_count (fs) != 0) { - all_sources.insert (fs->path()); - } else { - /* we might not remove this source from disk, because it may be used - by other snapshots, but its not being used in this version - so lets get rid of it now, along with any representative regions - in the region list. - */ + if (!fs->is_stub()) { - RegionFactory::remove_regions_using_source (i->second); - sources.erase (i); - } + if (playlists->source_use_count (fs) != 0) { + all_sources.insert (fs->path()); + } else { + + /* we might not remove this source from disk, because it may be used + by other snapshots, but its not being used in this version + so lets get rid of it now, along with any representative regions + in the region list. + */ + + RegionFactory::remove_regions_using_source (i->second); + sources.erase (i); + } + } } i = tmp;