summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/automation_time_axis.cc12
-rw-r--r--gtk2_ardour/automation_time_axis.h2
-rw-r--r--gtk2_ardour/processor_box.cc1
-rw-r--r--libs/surfaces/mackie/mackie_control_protocol.cc5
-rw-r--r--libs/surfaces/mackie/route_signal.cc2
5 files changed, 21 insertions, 1 deletions
diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc
index a92ac38530..9cf1598010 100644
--- a/gtk2_ardour/automation_time_axis.cc
+++ b/gtk2_ardour/automation_time_axis.cc
@@ -245,6 +245,10 @@ AutomationTimeAxisView::AutomationTimeAxisView (
automation_state_changed ();
ColorsChanged.connect (sigc::mem_fun (*this, &AutomationTimeAxisView::color_handler));
+
+ _route->DropReferences.connect (
+ _route_connections, invalidator (*this), ui_bind (&AutomationTimeAxisView::route_going_away, this), gui_context ()
+ );
}
AutomationTimeAxisView::~AutomationTimeAxisView ()
@@ -252,6 +256,12 @@ AutomationTimeAxisView::~AutomationTimeAxisView ()
}
void
+AutomationTimeAxisView::route_going_away ()
+{
+ _route.reset ();
+}
+
+void
AutomationTimeAxisView::auto_clicked ()
{
using namespace Menu_Helpers;
@@ -492,7 +502,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
}
if (changed) {
- if (canvas_item_visible (_canvas_display)) {
+ if (canvas_item_visible (_canvas_display) && _route) {
/* only emit the signal if the height really changed and we were visible */
_route->gui_changed ("visible_tracks", (void *) 0); /* EMIT_SIGNAL */
}
diff --git a/gtk2_ardour/automation_time_axis.h b/gtk2_ardour/automation_time_axis.h
index 7fc9c2575a..d1a465238a 100644
--- a/gtk2_ardour/automation_time_axis.h
+++ b/gtk2_ardour/automation_time_axis.h
@@ -168,6 +168,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void cut_copy_clear_objects_one (AutomationLine&, PointSelection&, Editing::CutCopyOp);
bool paste_one (AutomationLine&, ARDOUR::framepos_t, float times, Selection&, size_t nth);
void reset_objects_one (AutomationLine&, PointSelection&);
+ void route_going_away ();
void set_automation_state (ARDOUR::AutoState);
bool ignore_state_request;
@@ -178,6 +179,7 @@ class AutomationTimeAxisView : public TimeAxisView {
void interpolation_changed (ARDOUR::AutomationList::InterpolationStyle);
PBD::ScopedConnectionList _list_connections;
+ PBD::ScopedConnectionList _route_connections;
void update_extra_xml_shown (bool editor_shown);
diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc
index 7ae9ddf16f..63a78260ae 100644
--- a/gtk2_ardour/processor_box.cc
+++ b/gtk2_ardour/processor_box.cc
@@ -527,6 +527,7 @@ ProcessorBox::route_going_away ()
{
/* don't keep updating display as processors are deleted */
no_processor_redisplay = true;
+ _route.reset ();
}
void
diff --git a/libs/surfaces/mackie/mackie_control_protocol.cc b/libs/surfaces/mackie/mackie_control_protocol.cc
index 457c37a798..05d1fa3de2 100644
--- a/libs/surfaces/mackie/mackie_control_protocol.cc
+++ b/libs/surfaces/mackie/mackie_control_protocol.cc
@@ -273,6 +273,11 @@ MackieControlProtocol::switch_banks (int initial)
DEBUG_TRACE (DEBUG::MackieControl, string_compose ("switch to %1, %2\n", _current_initial_bank, end_pos));
+ // clear out routes from our table in case any have been deleted
+ for (vector<boost::shared_ptr<Route> >::iterator i = route_table.begin(); i != route_table.end(); ++i) {
+ i->reset ();
+ }
+
// link routes to strips
uint32_t i = 0;
for (; it != end && it != sorted.end(); ++it, ++i)
diff --git a/libs/surfaces/mackie/route_signal.cc b/libs/surfaces/mackie/route_signal.cc
index bd75a06309..4446420cd4 100644
--- a/libs/surfaces/mackie/route_signal.cc
+++ b/libs/surfaces/mackie/route_signal.cc
@@ -63,6 +63,8 @@ void RouteSignal::connect()
// TODO this works when a currently-banked route is made inactive, but not
// when a route is activated which should be currently banked.
_route->active_changed.connect (connections, MISSING_INVALIDATOR, ui_bind (&MackieControlProtocol::notify_active_changed, &_mcp, this), midi_ui_context());
+
+ _route->DropReferences.connect (connections, MISSING_INVALIDATOR, ui_bind (&MackieControlProtocol::refresh_current_bank, &_mcp), midi_ui_context());
// TODO
// SelectedChanged