diff options
author | Carl Hetherington <carl@carlh.net> | 2010-08-13 16:50:29 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2010-08-13 16:50:29 +0000 |
commit | d62f7e1c72523e77b8d1fd1b3f4a2e8d078ac5f1 (patch) | |
tree | 772c48df59e8ff8839275cdcc1ee372ceade9b5a /gtk2_ardour/editor_timefx.cc | |
parent | 5524e377a2668e75c1a50c02fcb4cd7a88701e8e (diff) |
Patch from colinf to add tape-style region stretching via rubberband. Fixes #3075.
git-svn-id: svn://localhost/ardour2/branches/3.0@7620 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/editor_timefx.cc')
-rw-r--r-- | gtk2_ardour/editor_timefx.cc | 49 |
1 files changed, 35 insertions, 14 deletions
diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index 6f5e380fef..88889a4745 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -171,21 +171,42 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching) txt = current_timefx->stretch_opts_selector.get_active_text (); - if (txt == rb_opt_strings[0]) { - transients = NoTransients; peaklock = false; longwin = true; shortwin = false; - } else if (txt == rb_opt_strings[1]) { - transients = NoTransients; peaklock = false; longwin = false; shortwin = false; - } else if (txt == rb_opt_strings[2]) { - transients = NoTransients; peaklock = true; longwin = false; shortwin = false; - } else if (txt == rb_opt_strings[3]) { - transients = BandLimitedTransients; peaklock = true; longwin = false; shortwin = false; - } else if (txt == rb_opt_strings[5]) { - transients = Transients; peaklock = false; longwin = false; shortwin = true; - } else { - /* default/4 */ - - transients = Transients; peaklock = true; longwin = false; shortwin = false; + for (int i = 0; i <= 6; i++) { + if (txt == rb_opt_strings[i]) { + rb_current_opt = i; + break; + } } + + switch (rb_current_opt) { + case 0: + transients = NoTransients; peaklock = false; longwin = true; shortwin = false; + break; + case 1: + transients = NoTransients; peaklock = false; longwin = false; shortwin = false; + break; + case 2: + transients = NoTransients; peaklock = true; longwin = false; shortwin = false; + break; + case 3: + transients = BandLimitedTransients; peaklock = true; longwin = false; shortwin = false; + break; + case 5: + transients = Transients; peaklock = false; longwin = false; shortwin = true; + break; + case 6: + transients = NoTransients; + precise = true; + preserve_formants = false; + current_timefx->request.pitch_fraction = 1/val; + shortwin = true; + // peaklock = false; + break; + default: + /* default/4 */ + transients = Transients; peaklock = true; longwin = false; shortwin = false; + break; + }; if (realtime) options |= RubberBandStretcher::OptionProcessRealTime; if (precise) options |= RubberBandStretcher::OptionStretchPrecise; |