Index: gtk2_ardour/audio_region_editor.cc
===================================================================
--- gtk2_ardour/audio_region_editor.cc	(revision 5896)
+++ gtk2_ardour/audio_region_editor.cc	(working copy)
@@ -25,6 +25,7 @@
 #include <gtkmm2ext/utils.h>
 #include <gtkmm2ext/stop_signal.h>
 #include <cmath>
+#include <ardour/dB.h>
 
 #include "audio_region_editor.h"
 #include "audio_region_view.h"
@@ -52,7 +53,8 @@
 	  length_clock (X_("regionlength"), true, X_("AudioRegionEditorClock"), true, true),
 	  /* XXX cannot edit sync point or start yet */
 	  sync_offset_clock (X_("regionsyncoffset"), true, X_("AudioRegionEditorClock"), false),
-	  start_clock (X_("regionstart"), true, X_("AudioRegionEditorClock"), false)
+	  start_clock (X_("regionstart"), true, X_("AudioRegionEditorClock"), false),	  
+	  gain_adjustment(accurate_coefficient_to_dB(_region->scale_amplitude()), -40.0, +40.0, 0.1, 1.0, 0)
 
 {
 	position_clock.set_session (&_session);
@@ -124,10 +126,17 @@
 	time_table.attach (start_alignment, 0, 1, 4, 5, Gtk::FILL, Gtk::FILL);
 	time_table.attach (start_clock, 1, 2, 4, 5, Gtk::FILL, Gtk::FILL);
 
+	gain_label.set_name ("AudioRegionEditorLabel");
+	gain_label.set_text (_("Scale amplitude:"));
+	gain_entry.configure(gain_adjustment, 0.0, 1);
+
 	lower_hbox.pack_start (time_table, true, true);
 	lower_hbox.pack_start (sep1, false, false);
 	lower_hbox.pack_start (sep2, false, false);
 
+	lower_hbox.pack_start (gain_label, false, false);
+	lower_hbox.pack_start (gain_entry, false, false);
+
 	get_vbox()->pack_start (top_row_hbox, true, true);
 	get_vbox()->pack_start (sep3, false, false);
 	get_vbox()->pack_start (lower_hbox, true, true);
@@ -143,6 +152,7 @@
 
 	name_changed ();
 	bounds_changed (Change (StartChanged|LengthChanged|PositionChanged|StartChanged|Region::SyncOffsetChanged));
+	gain_changed();
 
 	_region->StateChanged.connect (mem_fun(*this, &AudioRegionEditor::region_changed));
 	
@@ -165,6 +175,11 @@
 	if (what_changed & Change (BoundsChanged|StartChanged|Region::SyncOffsetChanged)) {
 		bounds_changed (what_changed);
 	}
+
+	if (what_changed & AudioRegion::ScaleAmplitudeChanged) {
+		gain_changed();
+	}
+	
 }
 
 gint 
@@ -208,6 +223,7 @@
 	position_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::position_clock_changed));
 	end_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::end_clock_changed));
 	length_clock.ValueChanged.connect (mem_fun(*this, &AudioRegionEditor::length_clock_changed));
+	gain_adjustment.signal_value_changed().connect (mem_fun(*this, &AudioRegionEditor::gain_adjustment_changed));
 
 	audition_button.signal_toggled().connect (mem_fun(*this, &AudioRegionEditor::audition_button_toggled));
 	_session.AuditionActive.connect (mem_fun(*this, &AudioRegionEditor::audition_state_changed));
@@ -271,6 +287,24 @@
 }
 
 void
+AudioRegionEditor::gain_changed ()
+{
+	float region_gain_dB =  accurate_coefficient_to_dB(_region->scale_amplitude());
+	if (region_gain_dB != gain_adjustment.get_value()) {
+		gain_adjustment.set_value(region_gain_dB);
+	}
+}
+
+void
+AudioRegionEditor::gain_adjustment_changed ()
+{
+	float gain =  dB_to_coefficient(gain_adjustment.get_value());
+	if (_region->scale_amplitude() != gain) {
+		_region->set_scale_amplitude(gain);
+	}
+}
+
+void
 AudioRegionEditor::audition_button_toggled ()
 {
 	if (audition_button.get_active()) {
Index: gtk2_ardour/audio_region_editor.h
===================================================================
--- gtk2_ardour/audio_region_editor.h	(revision 5896)
+++ gtk2_ardour/audio_region_editor.h	(working copy)
@@ -79,17 +79,23 @@
 	Gtk::Label length_label;
 	Gtk::Label sync_label;
 	Gtk::Label start_label;
+	Gtk::Label gain_label;
+	
 	Gtk::Alignment position_alignment;
 	Gtk::Alignment end_alignment;
 	Gtk::Alignment length_alignment;
 	Gtk::Alignment sync_alignment;
 	Gtk::Alignment start_alignment;
+	Gtk::Alignment gain_alignment;
 
 	AudioClock position_clock;
 	AudioClock end_clock;
 	AudioClock length_clock;
 	AudioClock sync_offset_clock;
 	AudioClock start_clock;
+	
+	Gtk::Adjustment gain_adjustment;
+	Gtk::SpinButton gain_entry;
 
 	Gtk::HSeparator sep3;
 	Gtk::VSeparator sep1;
@@ -98,6 +104,7 @@
 	void region_changed (ARDOUR::Change);
 	void bounds_changed (ARDOUR::Change);
 	void name_changed ();
+	void gain_changed ();
 
 	void audition_state_changed (bool);
 
@@ -107,6 +114,7 @@
 	void position_clock_changed ();
 	void end_clock_changed ();
 	void length_clock_changed ();
+	void gain_adjustment_changed ();
 
 	void audition_button_toggled ();
 
