summaryrefslogtreecommitdiff
path: root/gtk2_ardour/region_gain_line.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2015-04-30 22:54:18 +0200
committerRobin Gareus <robin@gareus.org>2015-04-30 22:54:18 +0200
commite65e77e3604ac6b1f134420a27354ad31f713acf (patch)
tree21932944a9a5cf6e0e529795a23fd437da816d2f /gtk2_ardour/region_gain_line.cc
parent2b294f0b43167104371705fc2092b54448b92b5f (diff)
update region-gain-line time-converter. fixes #6293
Diffstat (limited to 'gtk2_ardour/region_gain_line.cc')
-rw-r--r--gtk2_ardour/region_gain_line.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/gtk2_ardour/region_gain_line.cc b/gtk2_ardour/region_gain_line.cc
index cbeb1224af..5ac985fa9a 100644
--- a/gtk2_ardour/region_gain_line.cc
+++ b/gtk2_ardour/region_gain_line.cc
@@ -30,6 +30,7 @@
#include "time_axis_view.h"
#include "editor.h"
+#include "gui_thread.h"
#include "i18n.h"
@@ -46,6 +47,8 @@ AudioRegionGainLine::AudioRegionGainLine (const string & name, AudioRegionView&
_time_converter->set_origin_b (r.region()->position() - r.region()->start());
+ r.region()->PropertyChanged.connect (_region_changed_connection, invalidator (*this), boost::bind (&AudioRegionGainLine::region_changed, this, _1), gui_context());
+
group->raise_to_top ();
group->set_y_position (2);
set_uses_gain_mapping (true);
@@ -96,3 +99,15 @@ AudioRegionGainLine::end_drag (bool with_push, uint32_t final_index)
AutomationLine::end_drag (with_push, final_index);
}
+void
+AudioRegionGainLine::region_changed (const PropertyChange& what_changed)
+{
+ PropertyChange interesting_stuff;
+
+ interesting_stuff.add (ARDOUR::Properties::start);
+ interesting_stuff.add (ARDOUR::Properties::position);
+
+ if (what_changed.contains (interesting_stuff)) {
+ _time_converter->set_origin_b (rv.region()->position() - rv.region()->start());
+ }
+}