diff options
author | Robin Gareus <robin@gareus.org> | 2015-09-15 14:42:43 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2015-09-15 14:44:05 +0200 |
commit | b05912b0cb20b1827f8f82d0234d7659475b988c (patch) | |
tree | 94f97e181c5f6e42b39f8c3db6d39208b6f821c8 /gtk2_ardour/ardour_ui.cc | |
parent | 04e7cfabbe58605e6770adbd9e27bf871a957bef (diff) |
GUI part: cleanup peak-files
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r-- | gtk2_ardour/ardour_ui.cc | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 89f0bb4f90..c041e7d89f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -107,6 +107,7 @@ typedef uint64_t microseconds_t; #include "ambiguous_file_dialog.h" #include "ardour_ui.h" #include "audio_clock.h" +#include "audio_region_view.h" #include "big_clock_window.h" #include "bundle_manager.h" #include "engine_dialog.h" @@ -3713,6 +3714,47 @@ ARDOUR_UI::flush_trash () } void +ARDOUR_UI::cleanup_peakfiles () +{ + if (_session == 0) { + /* shouldn't happen: menu item is insensitive */ + return; + } + + if (! _session->can_cleanup_peakfiles ()) { + return; + } + + // get all region-views in this session + RegionSelection rs; + TrackViewList empty; + empty.clear(); + editor->get_regions_after(rs, (framepos_t) 0, empty); + std::list<RegionView*> views = rs.by_layer(); + + // remove displayed audio-region-views waveforms + for (list<RegionView*>::iterator i = views.begin(); i != views.end(); ++i) { + AudioRegionView* arv = dynamic_cast<AudioRegionView*> (*i); + if (!arv) { continue ; } + arv->delete_waves(); + } + + // cleanup peak files: + // - stop pending peakfile threads + // - close peakfiles if any + // - remove peak dir in session + // - setup peakfiles (background thread) + _session->cleanup_peakfiles (); + + // re-add waves to ARV + for (list<RegionView*>::iterator i = views.begin(); i != views.end(); ++i) { + AudioRegionView* arv = dynamic_cast<AudioRegionView*> (*i); + if (!arv) { continue ; } + arv->create_waves(); + } +} + +void ARDOUR_UI::setup_order_hint (AddRouteDialog::InsertAt place) { uint32_t order_hint = UINT32_MAX; |