add JAG to author list
[ardour.git] / gtk2_ardour / editor_timefx.cc
index 8caa808979ba982cb670e618957cebc542532900..543c1821e0ac367936150eeb4e79b55220121cd0 100644 (file)
@@ -27,7 +27,6 @@
 #include <pbd/pthread_utils.h>
 #include <pbd/memento_command.h>
 
-#include <gtkmm2ext/window_title.h>
 #include <gtkmm2ext/utils.h>
 
 #include "editor.h"
@@ -71,19 +70,18 @@ Editor::TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
          quick_button (_("Quick but Ugly")),
          antialias_button (_("Skip Anti-aliasing")),
          stretch_opts_label (_("Contents:")),
-         precise_button (_("Strict Linear"))
+         precise_button (_("Strict Linear")),
+         preserve_formants_button(_("Preserve Formants"))
 {
        set_modal (true);
        set_position (Gtk::WIN_POS_MOUSE);
        set_name (N_("TimeFXDialog"));
 
-       WindowTitle title(Glib::get_application_name());
        if (pitching) {
-               title += _("Pitch Shift");
+               set_title(_("Pitch Shift"));
        } else {
-               title += _("Time Stretch");
+               set_title(_("Time Stretch"));
        }
-       set_title(title.get_string());
 
        cancel_button = add_button (_("Cancel"), Gtk::RESPONSE_CANCEL);
 
@@ -111,6 +109,9 @@ Editor::TimeFXDialog::TimeFXDialog (Editor& e, bool pitch)
 
                pitch_cent_spinner.set_digits (1);
 
+               upper_button_box.pack_start (preserve_formants_button, false, false);
+
+
                add_button (_("Shift"), Gtk::RESPONSE_ACCEPT);
 
                get_vbox()->pack_start (upper_button_box, false, false);
@@ -253,6 +254,7 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching)
        bool peaklock = true;
        bool longwin = false;
        bool shortwin = false;
+       bool preserve_formants = false;
        string txt;
 
        enum {
@@ -262,6 +264,7 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching)
        } transients = Transients;
        
        precise = current_timefx->precise_button.get_active();
+       preserve_formants = current_timefx->preserve_formants_button.get_active();
        
        txt = current_timefx->stretch_opts_selector.get_active_text ();
 
@@ -284,10 +287,14 @@ Editor::time_fx (RegionSelection& regions, float val, bool pitching)
 
        if (realtime)    options |= RubberBandStretcher::OptionProcessRealTime;
        if (precise)     options |= RubberBandStretcher::OptionStretchPrecise;
+       if (preserve_formants)  options |= RubberBandStretcher::OptionFormantPreserved;
+
        if (!peaklock)   options |= RubberBandStretcher::OptionPhaseIndependent;
        if (longwin)     options |= RubberBandStretcher::OptionWindowLong;
        if (shortwin)    options |= RubberBandStretcher::OptionWindowShort;
                
+               
+               
        switch (transients) {
        case NoTransients:
                options |= RubberBandStretcher::OptionTransientsSmooth;
@@ -402,7 +409,7 @@ Editor::do_timefx (TimeFXDialog& dialog)
                        new_region = fx->results.front();
 
                        if (!in_command) {
-                               begin_reversible_command (dialog.pitching ? _("pitch shift") : _("time stretch"));
+                               session->begin_reversible_command (dialog.pitching ? _("pitch shift") : _("time stretch"));
                                in_command = true;
                        }
 
@@ -417,7 +424,7 @@ Editor::do_timefx (TimeFXDialog& dialog)
        }
 
        if (in_command) {
-               commit_reversible_command ();
+               session->commit_reversible_command ();
        }
 
        dialog.status = 0;
@@ -427,7 +434,7 @@ Editor::do_timefx (TimeFXDialog& dialog)
 void*
 Editor::timefx_thread (void *arg)
 {
-       PBD::ThreadCreated (pthread_self(), X_("TimeFX"));
+       PBD::notify_gui_about_thread_creation (pthread_self(), X_("TimeFX"));
 
        TimeFXDialog* tsd = static_cast<TimeFXDialog*>(arg);