diff options
author | Carl Hetherington <carl@carlh.net> | 2010-12-29 01:33:49 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-12-29 01:33:49 +0000 |
commit | a48cdf5ba639a6f25dc593d7c9bb4560df4e90b8 (patch) | |
tree | fb0dfd86496a8d94750ef2ceae209c2ffe255228 /gtk2_ardour/rhythm_ferret.cc | |
parent | 731bef6c176baa2431b42012770267a342668322 (diff) |
Clear displayed transients on closing the rhythm ferret dialogue. Fixes #3623.
git-svn-id: svn://localhost/ardour2/branches/3.0@8357 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/rhythm_ferret.cc')
-rw-r--r-- | gtk2_ardour/rhythm_ferret.cc | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gtk2_ardour/rhythm_ferret.cc b/gtk2_ardour/rhythm_ferret.cc index da31feca3c..5685cb56af 100644 --- a/gtk2_ardour/rhythm_ferret.cc +++ b/gtk2_ardour/rhythm_ferret.cc @@ -183,15 +183,17 @@ RhythmFerret::run_analysis () return; } - RegionSelection& regions (editor.get_selection().regions); + clear_transients (); + + regions_with_transients = editor.get_selection().regions; current_results.clear (); - if (regions.empty()) { + if (regions_with_transients.empty()) { return; } - for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) { + for (RegionSelection::iterator i = regions_with_transients.begin(); i != regions_with_transients.end(); ++i) { boost::shared_ptr<Readable> rd = boost::static_pointer_cast<AudioRegion> ((*i)->region()); @@ -382,5 +384,17 @@ void RhythmFerret::on_hide () { ArdourDialog::on_hide (); + clear_transients (); +} + +/* Clear any transients that we have added */ +void +RhythmFerret::clear_transients () +{ + current_results.clear (); + for (RegionSelection::iterator i = regions_with_transients.begin(); i != regions_with_transients.end(); ++i) { + (*i)->region()->set_transients (current_results); + } + regions_with_transients.clear (); } |