summaryrefslogtreecommitdiff
path: root/gtk2_ardour/quantize_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2016-03-07 10:16:01 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2016-03-07 10:16:01 -0500
commitec1b0890cb6babcdece50133fb3aa77b5acf63f8 (patch)
treebb5d19d59fcc8cfe9d1c82818d896a86b63a04de /gtk2_ardour/quantize_dialog.cc
parent60ed9ccc6ed3b9a006131121e171f9289b1baa0d (diff)
expand options in quantize dialog to include other beat fractions
Diffstat (limited to 'gtk2_ardour/quantize_dialog.cc')
-rw-r--r--gtk2_ardour/quantize_dialog.cc36
1 files changed, 18 insertions, 18 deletions
diff --git a/gtk2_ardour/quantize_dialog.cc b/gtk2_ardour/quantize_dialog.cc
index 82e3a1abd5..05c8d1e940 100644
--- a/gtk2_ardour/quantize_dialog.cc
+++ b/gtk2_ardour/quantize_dialog.cc
@@ -37,8 +37,17 @@ static const gchar *_grid_strings[] = {
N_("Beats/128"),
N_("Beats/64"),
N_("Beats/32"),
+ N_("Beats/28"),
+ N_("Beats/24"),
+ N_("Beats/20"),
N_("Beats/16"),
+ N_("Beats/14"),
+ N_("Beats/12"),
+ N_("Beats/10"),
N_("Beats/8"),
+ N_("Beats/7"),
+ N_("Beats/6"),
+ N_("Beats/5"),
N_("Beats/4"),
N_("Beats/3"),
N_("Beats/2"),
@@ -138,24 +147,15 @@ QuantizeDialog::grid_size_to_musical_time (const string& txt) const
return b.to_double();
}
- if (txt == _("Beats/128")) {
- return 1.0/128.0;
- } else if (txt == _("Beats/64")) {
- return 1.0/64.0;
- } else if (txt == _("Beats/32")) {
- return 1.0/32.0;
- } else if (txt == _("Beats/16")) {
- return 1.0/16.0;
- } if (txt == _("Beats/8")) {
- return 1.0/8.0;
- } else if (txt == _("Beats/4")) {
- return 1.0/4.0;
- } else if (txt == _("Beats/3")) {
- return 1.0/3.0;
- } else if (txt == _("Beats/2")) {
- return 1.0/2.0;
- } else if (txt == _("Beats")) {
- return 1.0;
+ string::size_type slash;
+
+ if ((slash = txt.find ('/')) != string::npos) {
+ if (slash < txt.length() - 1) {
+ double divisor = PBD::atof (txt.substr (slash+1));
+ if (divisor != 0.0) {
+ return 1.0/divisor;
+ }
+ }
}
return 1.0;