summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2009-06-20 14:02:27 +0000
committerCarl Hetherington <carl@carlh.net>2009-06-20 14:02:27 +0000
commit37ece84ba6a1614b3620ffd2e4b32eee56e1719e (patch)
tree4ed80eacb884e5658ff39e902795a26ae4a0c310 /gtk2_ardour
parent3cdc0d104a407ad29de68bbed624fdd80bb1b1f1 (diff)
Allow normalization to less than max, as per mantis #2739.
git-svn-id: svn://localhost/ardour2/branches/3.0@5223 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor_ops.cc27
1 files changed, 22 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index de6941aa7b..fcf9937e90 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -4575,17 +4575,34 @@ Editor::remove_last_capture ()
void
Editor::normalize_region ()
{
- RegionSelection rs;
-
- get_regions_for_action (rs);
-
if (!session) {
return;
}
+ RegionSelection rs;
+ get_regions_for_action (rs);
+
if (rs.empty()) {
return;
}
+
+ Dialog dialog (rs.size() > 1 ? _("Normalize regions") : _("Normalize region"));
+ HBox hbox;
+ hbox.pack_start (*manage (new Label (_("Normalize to:"))));
+ SpinButton spin (0.2, 2);
+ spin.set_range (-112, 0);
+ spin.set_increments (0.1, 1);
+ spin.set_value (0);
+ hbox.pack_start (spin);
+ hbox.pack_start (*manage (new Label (_("dbFS"))));
+ hbox.show_all ();
+ dialog.get_vbox()->pack_start (hbox);
+ dialog.add_button (Stock::CANCEL, RESPONSE_CANCEL);
+ dialog.add_button (_("Normalize"), RESPONSE_ACCEPT);
+
+ if (dialog.run () == RESPONSE_CANCEL) {
+ return;
+ }
begin_reversible_command (_("normalize"));
@@ -4597,7 +4614,7 @@ Editor::normalize_region ()
if (!arv)
continue;
XMLNode &before = arv->region()->get_state();
- arv->audio_region()->normalize_to (0.0f);
+ arv->audio_region()->normalize_to (spin.get_value());
session->add_command (new MementoCommand<Region>(*(arv->region().get()), &before, &arv->region()->get_state()));
}