update region-gain-line time-converter. fixes #6293
This commit is contained in:
parent
2b294f0b43
commit
e65e77e360
@ -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());
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user