2009-10-14 12:10:01 -04:00
|
|
|
/*
|
2019-08-02 17:26:43 -04:00
|
|
|
* Copyright (C) 2009-2015 David Robillard <d@drobilla.net>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2009-08-27 08:47:04 -04:00
|
|
|
|
|
|
|
#ifndef __ardour_gtk2_quantize_dialog_h_
|
|
|
|
#define __ardour_gtk2_quantize_dialog_h_
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include <gtkmm/comboboxtext.h>
|
|
|
|
#include <gtkmm/adjustment.h>
|
|
|
|
#include <gtkmm/checkbutton.h>
|
|
|
|
#include <gtkmm/spinbutton.h>
|
|
|
|
|
2020-07-13 20:03:18 -04:00
|
|
|
#include "temporal/beats.h"
|
|
|
|
|
2009-08-27 08:47:04 -04:00
|
|
|
#include "ardour/types.h"
|
|
|
|
|
|
|
|
#include "ardour_dialog.h"
|
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class MidiRegion;
|
|
|
|
class MidiModel;
|
|
|
|
};
|
|
|
|
|
2023-11-25 17:25:29 -05:00
|
|
|
class EditingContext;
|
2009-08-27 08:47:04 -04:00
|
|
|
|
|
|
|
class QuantizeDialog : public ArdourDialog
|
|
|
|
{
|
2017-07-01 15:11:14 -04:00
|
|
|
public:
|
2023-11-25 17:25:29 -05:00
|
|
|
QuantizeDialog (EditingContext&);
|
2009-08-27 08:47:04 -04:00
|
|
|
~QuantizeDialog ();
|
|
|
|
|
2021-03-17 13:27:34 -04:00
|
|
|
Temporal::Beats start_grid_size() const;
|
|
|
|
Temporal::Beats end_grid_size() const;
|
2009-08-27 08:47:04 -04:00
|
|
|
bool snap_start() const { return snap_start_button.get_active(); }
|
|
|
|
bool snap_end() const { return snap_end_button.get_active(); }
|
|
|
|
float strength() const;
|
2020-07-13 20:03:18 -04:00
|
|
|
Temporal::Beats threshold () const;
|
2009-08-27 08:47:04 -04:00
|
|
|
float swing () const;
|
|
|
|
|
2017-07-01 15:11:14 -04:00
|
|
|
private:
|
2023-11-25 17:25:29 -05:00
|
|
|
EditingContext& editor;
|
2009-08-27 08:47:04 -04:00
|
|
|
|
|
|
|
Gtk::ComboBoxText start_grid_combo;
|
|
|
|
Gtk::ComboBoxText end_grid_combo;
|
|
|
|
Gtk::Adjustment strength_adjustment;
|
|
|
|
Gtk::SpinButton strength_spinner;
|
|
|
|
Gtk::Label strength_label;
|
|
|
|
Gtk::Adjustment swing_adjustment;
|
|
|
|
Gtk::SpinButton swing_spinner;
|
|
|
|
Gtk::CheckButton swing_button;
|
|
|
|
Gtk::Adjustment threshold_adjustment;
|
|
|
|
Gtk::SpinButton threshold_spinner;
|
|
|
|
Gtk::Label threshold_label;
|
|
|
|
Gtk::CheckButton snap_start_button;
|
|
|
|
Gtk::CheckButton snap_end_button;
|
|
|
|
|
|
|
|
static std::vector<std::string> grid_strings;
|
|
|
|
static std::vector<std::string> type_strings;
|
|
|
|
|
2021-03-17 13:27:34 -04:00
|
|
|
Temporal::Beats grid_size_to_musical_time (const std::string&) const;
|
2009-08-27 08:47:04 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_gtk2_quantize_dialog_h_ */
|