diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index a98df48a23..a5c7d39faa 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -2369,7 +2369,7 @@ private: void set_show_touched_automation (bool); bool _show_touched_automation; - int time_fx (ARDOUR::RegionList&, float val, bool pitching); + int time_fx (ARDOUR::RegionList&, Temporal::ratio_t ratio, bool pitching); void note_edit_done (int, EditNoteDialog*); void toggle_sound_midi_notes (); diff --git a/gtk2_ardour/editor_timefx.cc b/gtk2_ardour/editor_timefx.cc index fd8b22a170..15aad444d8 100644 --- a/gtk2_ardour/editor_timefx.cc +++ b/gtk2_ardour/editor_timefx.cc @@ -159,7 +159,7 @@ Editor::pitch_shift (RegionSelection& regions, float fraction) * @param pitching true to pitch shift, false to time stretch. * @return -1 in case of error, otherwise number of regions processed */ int -Editor::time_fx (RegionList& regions, float val, bool pitching) +Editor::time_fx (RegionList& regions, Temporal::ratio_t ratio, bool pitching) { delete current_timefx; @@ -169,7 +169,7 @@ Editor::time_fx (RegionList& regions, float val, bool pitching) } const timecnt_t oldlen = regions.front()->length(); - const timecnt_t newlen = regions.front()->length() * val; + const timecnt_t newlen = regions.front()->length() * ratio; const timepos_t pos = regions.front()->position (); current_timefx = new TimeFXDialog (*this, pitching, oldlen, newlen, pos); diff --git a/gtk2_ardour/time_fx_dialog.cc b/gtk2_ardour/time_fx_dialog.cc index a7f541e726..1b4a108e46 100644 --- a/gtk2_ardour/time_fx_dialog.cc +++ b/gtk2_ardour/time_fx_dialog.cc @@ -147,8 +147,7 @@ TimeFXDialog::TimeFXDialog (Editor& e, bool pitch, timecnt_t const & oldlen, tim duration_clock->set_session (e.session()); duration_clock->set (timepos_t (new_length), true); duration_clock->set_mode (AudioClock::BBT); -#warning NUTEMPO FIXME figure out what we are doing here - // duration_clock->set_bbt_reference (position); + duration_clock->set_bbt_reference (position); Gtk::Alignment* clock_align = manage (new Gtk::Alignment); clock_align->add (*duration_clock); @@ -260,14 +259,14 @@ TimeFXDialog::delete_in_progress (GdkEventAny*) return TRUE; } -float +Temporal::ratio_t TimeFXDialog::get_time_fraction () const { if (pitching) { - return 1.0; + return Temporal::ratio_t (1, 1); } - return duration_adjustment.get_value() / 100.0; + return Temporal::ratio_t (duration_adjustment.get_value(), 100); } float diff --git a/gtk2_ardour/time_fx_dialog.h b/gtk2_ardour/time_fx_dialog.h index 4372c5050b..a31401c0fa 100644 --- a/gtk2_ardour/time_fx_dialog.h +++ b/gtk2_ardour/time_fx_dialog.h @@ -71,7 +71,7 @@ public: void cancel_in_progress (); gint delete_in_progress (GdkEventAny*); - float get_time_fraction () const; + Temporal::ratio_t get_time_fraction () const; float get_pitch_fraction () const; void start_updates ();