Ardour  9.2-541-gc1841a13dd
quantize_dialog.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-2015 David Robillard <d@drobilla.net>
3  *
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.
8  *
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.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __ardour_gtk2_quantize_dialog_h_
20 #define __ardour_gtk2_quantize_dialog_h_
21 
22 #include <vector>
23 #include <string>
24 
25 #include <ytkmm/comboboxtext.h>
26 #include <ytkmm/adjustment.h>
27 #include <ytkmm/checkbutton.h>
28 #include <ytkmm/spinbutton.h>
29 
30 #include "temporal/beats.h"
31 
32 #include "ardour/types.h"
33 
34 #include "ardour_dialog.h"
35 
36 namespace ARDOUR {
37  class MidiRegion;
38  class MidiModel;
39 };
40 
41 class EditingContext;
42 
43 class QuantizeWidget : public Gtk::Table
44 {
45 public:
48 
51  bool snap_start() const { return snap_start_button.get_active(); }
52  bool snap_end() const { return snap_end_button.get_active(); }
53  float strength() const;
55  float swing () const;
56 
57 private:
59 
73 
74  static std::vector<std::string> grid_strings;
75  static std::vector<std::string> type_strings;
76 
77  Temporal::Beats grid_size_to_musical_time (const std::string&) const;
78 };
79 
81 {
82  public:
85 
86  /* Proxy all QuantizeWidget methods */
87 
90  bool snap_start() const { return quantize_widget.snap_start(); }
91  bool snap_end() const { return quantize_widget.snap_end(); }
92  float strength() const { return quantize_widget.strength(); }
94  float swing () const { return quantize_widget.swing(); }
95 
96  private:
98 };
99 
100 #endif /* __ardour_gtk2_quantize_dialog_h_ */
bool get_active() const
Temporal::Beats start_grid_size() const
Temporal::Beats threshold() const
Temporal::Beats end_grid_size() const
float strength() const
QuantizeDialog(Gtk::Window &, EditingContext &)
float swing() const
bool snap_end() const
QuantizeWidget quantize_widget
bool snap_start() const
Gtk::CheckButton snap_start_button
Temporal::Beats start_grid_size() const
Gtk::Label strength_label
Gtk::CheckButton snap_end_button
Gtk::Adjustment swing_adjustment
Gtk::Adjustment threshold_adjustment
Temporal::Beats grid_size_to_musical_time(const std::string &) const
Gtk::CheckButton swing_button
EditingContext & editor
float strength() const
float swing() const
Temporal::Beats threshold() const
static std::vector< std::string > grid_strings
Gtk::ComboBoxText start_grid_combo
static std::vector< std::string > type_strings
QuantizeWidget(EditingContext &)
Gtk::ComboBoxText end_grid_combo
Gtk::Adjustment strength_adjustment
bool snap_start() const
Gtk::SpinButton swing_spinner
bool snap_end() const
Gtk::SpinButton threshold_spinner
Gtk::Label threshold_label
Temporal::Beats end_grid_size() const
Gtk::SpinButton strength_spinner