update region-gain-line time-converter. fixes #6293

This commit is contained in:
Robin Gareus 2015-04-30 22:54:18 +02:00
parent 2b294f0b43
commit e65e77e360
2 changed files with 18 additions and 0 deletions

View File

@ -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());
}
}

View File

@ -42,7 +42,10 @@ class AudioRegionGainLine : public AutomationLine
void remove_point (ControlPoint&);
private:
PBD::ScopedConnection _region_changed_connection;
void region_changed (const PBD::PropertyChange& what_changed);
AudioRegionView& rv;
};