summaryrefslogtreecommitdiff
path: root/gtk2_ardour/route_time_axis.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2020-04-12 13:45:45 +0200
committerRobin Gareus <robin@gareus.org>2020-04-12 13:45:45 +0200
commit134b2162ba4327508e4eea4b3e3d16d5c2764c30 (patch)
tree78fa00c2d9b8e1d84394f739b1767fe7e7daea65 /gtk2_ardour/route_time_axis.cc
parent43d52fe41a8c7ac7319aa3978d5b9733eb3b9124 (diff)
Fix waveform update when channel-count changes
7434478a35 introduced a race, IOchange triggers updating the GUI and re-configuring processors. The latter needs to complete first, otherwise Track::n_channels() returns the previous channel count.
Diffstat (limited to 'gtk2_ardour/route_time_axis.cc')
-rw-r--r--gtk2_ardour/route_time_axis.cc24
1 files changed, 15 insertions, 9 deletions
diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc
index 22f4c179de..db0cb8ef51 100644
--- a/gtk2_ardour/route_time_axis.cc
+++ b/gtk2_ardour/route_time_axis.cc
@@ -321,6 +321,8 @@ RouteTimeAxisView::set_route (boost::shared_ptr<Route> rt)
track()->FreezeChange.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::map_frozen, this), gui_context());
track()->SpeedChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::speed_changed, this), gui_context());
+ track()->ChanCountChanged.connect (*this, invalidator (*this), boost::bind (&RouteTimeAxisView::chan_count_changed, this), gui_context());
+
/* pick up the correct freeze state */
map_frozen ();
@@ -2404,15 +2406,19 @@ RouteTimeAxisView::io_changed (IOChange /*change*/, void */*src*/)
{
reset_meter ();
if (_route && !no_redraw) {
- AudioStreamView* asv = dynamic_cast<AudioStreamView*>(_view);
- if (asv) {
- /* this needs to happen with the disk-reader's I/O changed,
- * however there is no dedicated signal for this, and in almost
- * call cases it follows I/O changes.
- * This is similar to ARDOUR_UI::cleanup_peakfiles, and
- * re-loads wave-form displays. */
- asv->reload_waves ();
- }
+ request_redraw ();
+ }
+}
+
+void
+RouteTimeAxisView::chan_count_changed ()
+{
+ AudioStreamView* asv = dynamic_cast<AudioStreamView*>(_view);
+ if (_route && !no_redraw && asv) {
+ /* This is similar to ARDOUR_UI::cleanup_peakfiles, and
+ * re-loads wave-form displays. */
+ asv->reload_waves ();
+ reset_meter ();
request_redraw ();
}
}