Fix thinkos in cubasish theme
[ardour.git] / gtk2_ardour / time_fx_dialog.h
1 /*
2  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
3  * Copyright (C) 2009-2012 David Robillard <d@drobilla.net>
4  * Copyright (C) 2012-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2015-2019 Robin Gareus <robin@gareus.org>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #ifndef __ardour_time_fx_dialog_h__
23 #define __ardour_time_fx_dialog_h__
24
25 #include <gtkmm/adjustment.h>
26 #include <gtkmm/spinbutton.h>
27 #include <gtkmm/progressbar.h>
28 #include <gtkmm/box.h>
29 #include <gtkmm/comboboxtext.h>
30 #include <gtkmm/label.h>
31 #include <gtkmm/button.h>
32
33 #include "ardour/timefx_request.h"
34
35 #include "ardour_dialog.h"
36 #include "progress_reporter.h"
37
38 class Editor;
39 class AudioClock;
40
41 class TimeFXDialog : public ArdourDialog, public ProgressReporter
42 {
43 public:
44         /* We need a position so that BBT mode in the clock can function */
45         TimeFXDialog (Editor& e, bool for_pitch, ARDOUR::samplecnt_t old_length, ARDOUR::samplecnt_t new_length, ARDOUR::samplepos_t position);
46
47         ARDOUR::TimeFXRequest request;
48         Editor&               editor;
49         bool                  pitching;
50         Gtk::ProgressBar      progress_bar;
51         ARDOUR::RegionList    regions;
52
53         /* SoundTouch */
54         Gtk::CheckButton      quick_button;
55         Gtk::CheckButton      antialias_button;
56         Gtk::VBox             upper_button_box;
57
58         /* RubberBand */
59         Gtk::ComboBoxText     stretch_opts_selector;
60         Gtk::Label            stretch_opts_label;
61         Gtk::CheckButton      precise_button;
62         Gtk::CheckButton      preserve_formants_button;
63
64         Gtk::Button*          cancel_button;
65         Gtk::Button*          action_button;
66         Gtk::VBox             packer;
67         int                   status;
68
69         sigc::connection first_cancel;
70         sigc::connection first_delete;
71         void cancel_in_progress ();
72         gint delete_in_progress (GdkEventAny*);
73
74         float get_time_fraction () const;
75         float get_pitch_fraction () const;
76
77         void start_updates ();
78
79         void on_response (int response_id) {
80                 Gtk::Dialog::on_response (response_id);
81         }
82
83         void hide () {
84                 regions.clear ();
85                 ArdourDialog::hide ();
86         }
87
88 private:
89         ARDOUR::samplecnt_t original_length;
90         Gtk::Adjustment     pitch_octave_adjustment;
91         Gtk::Adjustment     pitch_semitone_adjustment;
92         Gtk::Adjustment     pitch_cent_adjustment;
93         Gtk::SpinButton     pitch_octave_spinner;
94         Gtk::SpinButton     pitch_semitone_spinner;
95         Gtk::SpinButton     pitch_cent_spinner;
96         Gtk::Adjustment     duration_adjustment;
97         AudioClock*         duration_clock;
98         bool                ignore_adjustment_change;
99         bool                ignore_clock_change;
100         sigc::connection    update_connection;
101         float               progress;
102
103         void update_progress_gui (float);
104         void duration_clock_changed ();
105         void duration_adjustment_changed ();
106         void timer_update ();
107 };
108
109 #endif /* __ardour_time_fx_dialog_h__ */