add plural forms for pt to gtk2_ardour/po/pt.po
[ardour.git] / gtk2_ardour / transform_dialog.cc
index 762f504aa2d2df00e7b86b48ff928e327e94cf7c..7199b2a2f71225ed6381b492961e67cb6bd14afd 100644 (file)
@@ -23,7 +23,7 @@
 
 #include "transform_dialog.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace std;
 using namespace Gtk;
@@ -114,6 +114,7 @@ TransformDialog::TransformDialog()
 
        show_all();
        _seed_chooser->value_spinner.hide();
+       _seed_chooser->source_changed();
 }
 
 TransformDialog::ValueChooser::ValueChooser(const Model& model)
@@ -179,6 +180,9 @@ set_spinner_for(Gtk::SpinButton&                     spinner,
                spinner.set_digits(0);
                break;
        }
+       spinner.set_value(
+               std::min(spinner.get_adjustment()->get_upper(),
+                        std::max(spinner.get_adjustment()->get_lower(), spinner.get_value())));
 }
 
 void
@@ -239,7 +243,7 @@ TransformDialog::ValueChooser::get(std::list<Operation>& ops)
                const double max   = std::max(a, b);
                const double range = max - min;
 
-               // "rand range * min +" (i.e. (rand * range) + min)
+               // "rand range * min +" ((rand * range) + min)
                ops.push_back(Operation(Operation::PUSH, Value(Value::RANDOM)));
                ops.push_back(Operation(Operation::PUSH, Value(range)));
                ops.push_back(Operation(Operation::MULT));
@@ -254,11 +258,13 @@ TransformDialog::ValueChooser::get(std::list<Operation>& ops)
                const double last  = max_spinner.get_value();
                const double rise  = last - first;
 
-               // "index rise * n_notes / first +" (i.e. index * rise / n_notes + first)
+               // "index rise * n_notes 1 - / first +" (index * rise / (n_notes - 1) + first)
                ops.push_back(Operation(Operation::PUSH, Value(Value::INDEX)));
                ops.push_back(Operation(Operation::PUSH, Value(rise)));
                ops.push_back(Operation(Operation::MULT));
                ops.push_back(Operation(Operation::PUSH, Value(Value::N_NOTES)));
+               ops.push_back(Operation(Operation::PUSH, Value(1)));
+               ops.push_back(Operation(Operation::SUB));
                ops.push_back(Operation(Operation::DIV));
                ops.push_back(Operation(Operation::PUSH, Value(first)));
                ops.push_back(Operation(Operation::ADD));
@@ -303,6 +309,7 @@ TransformDialog::OperationChooser::OperationChooser(const Model& model)
        show_all();
        value_chooser.property_combo.hide();
        value_chooser.value_spinner.set_value(1);
+       value_chooser.source_changed();
 }
 
 void