summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-01-31 21:24:16 +0000
committerCarl Hetherington <carl@carlh.net>2012-01-31 21:24:16 +0000
commit44283453bcbd60206c8e0d5f6a899100982caebe (patch)
tree25455c23c14c05050bd39521799315826e268b2c
parentd2428e851092bcb1f4fd4d10e1f55b596b201811 (diff)
Don't bother opening a time FX dialog if we are just time stretching MIDI regions (#4679).
git-svn-id: svn://localhost/ardour2/branches/3.0@11402 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--gtk2_ardour/editor_timefx.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc
index d4d02ea1c4..0b400f933b 100644
--- a/gtk2_ardour/editor_timefx.cc
+++ b/gtk2_ardour/editor_timefx.cc
@@ -146,9 +146,21 @@ int
Editor::time_fx (RegionList& regions, float val, bool pitching)
{
delete current_timefx;
-
current_timefx = new TimeFXDialog (*this, pitching);
+ current_timefx->regions = regions;
+
+ /* See if we have any audio regions on our list */
+ RegionList::iterator i = regions.begin ();
+ while (i != regions.end() && boost::dynamic_pointer_cast<AudioRegion> (*i) == 0) {
+ ++i;
+ }
+ if (i == regions.end ()) {
+ /* No audio regions; we can just do the timefx without a dialogue */
+ do_timefx (*current_timefx);
+ return 0;
+ }
+
switch (current_timefx->run ()) {
case RESPONSE_ACCEPT:
break;
@@ -158,7 +170,6 @@ Editor::time_fx (RegionList& regions, float val, bool pitching)
}
current_timefx->status = 0;
- current_timefx->regions = regions;
if (pitching) {