- 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;
+ }
+ }