From 7434478a3567a0757791e1d231f9f60dbfdd8c10 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 8 Apr 2020 17:40:32 +0200 Subject: [PATCH] Update Waveform display when channel-count changes --- gtk2_ardour/audio_streamview.cc | 14 ++++++++++++++ gtk2_ardour/audio_streamview.h | 2 ++ gtk2_ardour/route_time_axis.cc | 9 +++++++++ 3 files changed, 25 insertions(+) diff --git a/gtk2_ardour/audio_streamview.cc b/gtk2_ardour/audio_streamview.cc index 58b55f94f2..fe9ace43cc 100644 --- a/gtk2_ardour/audio_streamview.cc +++ b/gtk2_ardour/audio_streamview.cc @@ -177,6 +177,20 @@ AudioStreamView::redisplay_track () layer_regions(); } +void +AudioStreamView::reload_waves () +{ + list::iterator i; + for (i = region_views.begin(); i != region_views.end(); ++i) { + AudioRegionView* arv = dynamic_cast (*i); + if (!arv) { + continue; + } + arv->delete_waves(); + arv->create_waves(); + } +} + void AudioStreamView::setup_rec_box () { diff --git a/gtk2_ardour/audio_streamview.h b/gtk2_ardour/audio_streamview.h index 47cc32fa25..b3bef6e127 100644 --- a/gtk2_ardour/audio_streamview.h +++ b/gtk2_ardour/audio_streamview.h @@ -67,6 +67,8 @@ public: RegionView* create_region_view (boost::shared_ptr, bool, bool); void set_selected_points (PointSelection&); + void reload_waves (); + private: void setup_rec_box (); void rec_peak_range_ready (samplepos_t start, ARDOUR::samplecnt_t cnt, boost::weak_ptr src); diff --git a/gtk2_ardour/route_time_axis.cc b/gtk2_ardour/route_time_axis.cc index 5af14987ee..22f4c179de 100644 --- a/gtk2_ardour/route_time_axis.cc +++ b/gtk2_ardour/route_time_axis.cc @@ -2404,6 +2404,15 @@ RouteTimeAxisView::io_changed (IOChange /*change*/, void */*src*/) { reset_meter (); if (_route && !no_redraw) { + AudioStreamView* asv = dynamic_cast(_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 (); } }