summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk2_ardour/editor.cc2
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_timefx.cc49
-rw-r--r--gtk2_ardour/time_fx_dialog.cc2
4 files changed, 39 insertions, 15 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 872566f54f..19408d32ed 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -201,6 +201,7 @@ static const gchar *_rb_opt_strings[] = {
N_("Unpitched percussion with stable notes"),
N_("Crisp monophonic instrumental"),
N_("Unpitched solo percussion"),
+ N_("Resample without preserving pitch"),
0
};
#endif
@@ -329,6 +330,7 @@ Editor::Editor ()
edit_point_strings = I18N (_edit_point_strings);
#ifdef USE_RUBBERBAND
rb_opt_strings = I18N (_rb_opt_strings);
+ rb_current_opt = 4;
#endif
snap_threshold = 5.0;
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 55ea12c35e..9158e40d26 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -221,6 +221,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
#ifdef USE_RUBBERBAND
std::vector<std::string> rb_opt_strings;
+ int rb_current_opt;
#endif
/* things that need to be public to be used in the main menubar */
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;
diff --git a/gtk2_ardour/time_fx_dialog.cc b/gtk2_ardour/time_fx_dialog.cc
index d1650430b2..c42caaf925 100644
--- a/gtk2_ardour/time_fx_dialog.cc
+++ b/gtk2_ardour/time_fx_dialog.cc
@@ -145,7 +145,7 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
set_popdown_strings (stretch_opts_selector, editor.rb_opt_strings);
/* set default */
- stretch_opts_selector.set_active_text (editor.rb_opt_strings[4]);
+ stretch_opts_selector.set_active_text (editor.rb_opt_strings[editor.rb_current_opt]);
table->attach (stretch_opts_selector, 2, 3, 0, 1, Gtk::FILL, Gtk::EXPAND & Gtk::FILL, 0, 0);
table->attach (precise_button, 1, 3, 1, 2, Gtk::FILL, Gtk::EXPAND, 0, 0);