/*
Copyright (C) 2007 Paul Davis
- Author: Dave Robillard
+ Author: David Robillard
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "i18n.h"
-AutomationRegionView::AutomationRegionView(ArdourCanvas::Group* parent,
- AutomationTimeAxisView& time_axis,
- boost::shared_ptr<ARDOUR::Region> region,
- const Evoral::Parameter& param,
- boost::shared_ptr<ARDOUR::AutomationList> list,
- double spu,
- Gdk::Color const & basic_color)
+AutomationRegionView::AutomationRegionView (ArdourCanvas::Group* parent,
+ AutomationTimeAxisView& time_axis,
+ boost::shared_ptr<ARDOUR::Region> region,
+ const Evoral::Parameter& param,
+ boost::shared_ptr<ARDOUR::AutomationList> list,
+ double spu,
+ Gdk::Color const & basic_color)
: RegionView(parent, time_axis, region, spu, basic_color, true)
, _parameter(param)
{
set_height (trackview.current_height());
- _region->PropertyChanged.connect (*this, invalidator (*this), ui_bind (&RegionView::region_changed, this, _1), gui_context());
-
set_colors ();
_enable_display = true;
_line->show();
_line->show_all_control_points();
_line->set_maximum_time (_region->length());
+ _line->set_offset (_region->start ());
}
bool
-AutomationRegionView::canvas_event(GdkEvent* ev)
+AutomationRegionView::canvas_event (GdkEvent* ev)
{
PublicEditor& e = trackview.editor ();
* @param y y position, relative to our TimeAxisView.
*/
void
-AutomationRegionView::add_automation_event (GdkEvent *, nframes_t when, double y)
+AutomationRegionView::add_automation_event (GdkEvent *, framepos_t when, double y)
{
if (!_line) {
boost::shared_ptr<Evoral::Control> c = _region->control(_parameter, true);
void
AutomationRegionView::region_resized (const PBD::PropertyChange& what_changed)
{
- RegionView::region_resized(what_changed);
+ RegionView::region_resized (what_changed);
- if (_line) {
- _line->reset();
+ if (!_line) {
+ return;
+ }
+
+ if (what_changed.contains (ARDOUR::Properties::start)) {
+ _line->set_offset (_region->start ());
+ }
+
+ if (what_changed.contains (ARDOUR::Properties::length)) {
_line->set_maximum_time (_region->length());
}
}
void
AutomationRegionView::entered (bool)
{
- if (_line)
+ if (_line) {
_line->track_entered();
+ }
}
void
-AutomationRegionView::exited()
+AutomationRegionView::exited ()
{
- if (_line)
+ if (_line) {
_line->track_exited();
+ }
}
-