X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fquantize_dialog.cc;h=dab1b6adeceffb361090bd1c591db262de78b6d0;hb=e7c85706e5553181636e7052f2fe10469b57fd85;hp=82e3a1abd57fedd8500a485d79a0b6f0a50652a1;hpb=ced4378d0914bcfb926267772c45d1d23f3bed38;p=ardour.git diff --git a/gtk2_ardour/quantize_dialog.cc b/gtk2_ardour/quantize_dialog.cc index 82e3a1abd5..dab1b6adec 100644 --- a/gtk2_ardour/quantize_dialog.cc +++ b/gtk2_ardour/quantize_dialog.cc @@ -25,7 +25,7 @@ #include "quantize_dialog.h" #include "public_editor.h" -#include "i18n.h" +#include "pbd/i18n.h" using namespace std; using namespace Gtk; @@ -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"), @@ -103,7 +112,7 @@ QuantizeDialog::QuantizeDialog (PublicEditor& e) snap_end_button.set_active (false); get_vbox()->pack_start (*table); - show_all (); + get_vbox()->show_all (); add_button (Stock::CANCEL, RESPONSE_CANCEL); add_button (_("Quantize"), RESPONSE_OK); @@ -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;