2 Copyright (C) 2000-2009 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef __ardour_time_fx_dialog_h__
21 #define __ardour_time_fx_dialog_h__
23 #include <gtkmm/adjustment.h>
24 #include <gtkmm/spinbutton.h>
25 #include <gtkmm/progressbar.h>
26 #include <gtkmm/box.h>
27 #include <gtkmm/comboboxtext.h>
28 #include <gtkmm/label.h>
29 #include <gtkmm/button.h>
31 #include "ardour/timefx_request.h"
33 #include "ardour_dialog.h"
34 #include "progress_reporter.h"
39 class TimeFXDialog : public ArdourDialog, public ProgressReporter
42 /* We need a position so that BBT mode in the clock can function */
43 TimeFXDialog (Editor& e, bool for_pitch, ARDOUR::framecnt_t old_length, ARDOUR::framecnt_t new_length, ARDOUR::framepos_t position);
45 ARDOUR::TimeFXRequest request;
48 Gtk::ProgressBar progress_bar;
49 ARDOUR::RegionList regions;
52 Gtk::CheckButton quick_button;
53 Gtk::CheckButton antialias_button;
54 Gtk::VBox upper_button_box;
57 Gtk::ComboBoxText stretch_opts_selector;
58 Gtk::Label stretch_opts_label;
59 Gtk::CheckButton precise_button;
60 Gtk::CheckButton preserve_formants_button;
62 Gtk::Button* cancel_button;
63 Gtk::Button* action_button;
67 sigc::connection first_cancel;
68 sigc::connection first_delete;
69 void cancel_in_progress ();
70 gint delete_in_progress (GdkEventAny*);
72 float get_time_fraction () const;
73 float get_pitch_fraction () const;
75 void start_updates ();
77 void on_response (int response_id) {
78 Gtk::Dialog::on_response (response_id);
83 ArdourDialog::hide ();
87 ARDOUR::framecnt_t original_length;
88 Gtk::Adjustment pitch_octave_adjustment;
89 Gtk::Adjustment pitch_semitone_adjustment;
90 Gtk::Adjustment pitch_cent_adjustment;
91 Gtk::SpinButton pitch_octave_spinner;
92 Gtk::SpinButton pitch_semitone_spinner;
93 Gtk::SpinButton pitch_cent_spinner;
94 Gtk::Adjustment duration_adjustment;
95 AudioClock* duration_clock;
96 bool ignore_adjustment_change;
97 bool ignore_clock_change;
98 sigc::connection update_connection;
101 void update_progress_gui (float);
102 void duration_clock_changed ();
103 void duration_adjustment_changed ();
104 void timer_update ();
107 #endif /* __ardour_time_fx_dialog_h__ */