_route,
_route->pannable(),
pan_control,
+ pan_control->parameter (),
_editor,
*this,
false,
: StreamView (*dynamic_cast<RouteTimeAxisView*>(tv.get_parent()),
new ArdourCanvas::Group(*tv.canvas_background()),
new ArdourCanvas::Group(*tv.canvas_display()))
- , _controller(tv.controller())
, _automation_view(tv)
, _pending_automation_state (Off)
{
}
const boost::shared_ptr<AutomationControl> control = boost::dynamic_pointer_cast<AutomationControl> (
- region->control (_controller->controllable()->parameter(), true)
+ region->control (_automation_view.parameter(), true)
);
boost::shared_ptr<AutomationList> list;
}
}
- region_view = new AutomationRegionView (_canvas_group, _automation_view, region,
- _controller->controllable()->parameter(), list,
- _samples_per_unit, region_color);
+ region_view = new AutomationRegionView (
+ _canvas_group, _automation_view, region,
+ _automation_view.parameter (), list,
+ _samples_per_unit, region_color
+ );
region_view->init (region_color, false);
region_views.push_front (region_view);
void color_handler ();
- boost::shared_ptr<AutomationController> _controller;
-
AutomationTimeAxisView& _automation_view;
/** automation state that should be applied when this view gets its first RegionView */
ARDOUR::AutoState _pending_automation_state;
boost::shared_ptr<Route> r,
boost::shared_ptr<Automatable> a,
boost::shared_ptr<AutomationControl> c,
+ Evoral::Parameter p,
PublicEditor& e,
TimeAxisView& parent,
bool show_regions,
, _route (r)
, _control (c)
, _automatable (a)
- , _controller (AutomationController::create (a, c->parameter(), c))
+ , _parameter (p)
, _base_rect (0)
, _view (show_regions ? new AutomationStreamView (*this) : 0)
, _name (nom)
have_name_font = true;
}
+ if (_control) {
+ _controller = AutomationController::create (_automatable, _control->parameter(), _control);
+ }
+
automation_menu = 0;
auto_off_item = 0;
auto_touch_item = 0;
controls_table.attach (auto_button, 5, 8, 0, 1, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
- /* add bar controller */
- controls_table.attach (*_controller.get(), 0, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
+ if (_controller) {
+ /* add bar controller */
+ controls_table.attach (*_controller.get(), 0, 8, 1, 2, Gtk::FILL|Gtk::EXPAND, Gtk::FILL|Gtk::EXPAND);
+ }
controls_table.show_all ();
controls_base_unselected_name = X_("AutomationTrackControlsBase");
controls_ebox.set_name (controls_base_unselected_name);
- XMLNode* xml_node = get_parent_with_state()->get_automation_child_xml_node (_control->parameter());
+ XMLNode* xml_node = get_parent_with_state()->get_automation_child_xml_node (_parameter);
if (xml_node) {
set_state (*xml_node, Stateful::loading_state_version);
boost::shared_ptr<AutomationLine> line (
new AutomationLine (
- ARDOUR::EventTypeMap::instance().to_symbol(_control->parameter()),
+ ARDOUR::EventTypeMap::instance().to_symbol(_parameter),
*this,
*_canvas_display,
_control->alist()
}
if (_automatable) {
- _automatable->set_parameter_automation_state (_control->parameter(), state);
+ _automatable->set_parameter_automation_state (_parameter, state);
}
#if 0
if (_route == _automatable) { // This is a time axis for route (not region) automation
- _route->set_parameter_automation_state (_control->parameter(), state);
+ _route->set_parameter_automation_state (_parameter, state);
}
if (_control->list()) {
TimeAxisView* state_parent = get_parent_with_state ();
assert(state_parent);
- XMLNode* xml_node = state_parent->get_automation_child_xml_node (_control->parameter());
+ XMLNode* xml_node = state_parent->get_automation_child_xml_node (_parameter);
TimeAxisView::set_height (h);
_base_rect->property_y2() = h;
/* current interpolation state */
AutomationList::InterpolationStyle const s = _view ? _view->interpolation() : _control->list()->interpolation ();
- if (EventTypeMap::instance().is_midi_parameter(_control->parameter())) {
+ if (EventTypeMap::instance().is_midi_parameter(_parameter)) {
Menu* auto_mode_menu = manage (new Menu);
auto_mode_menu->set_name ("ArdourContextMenu");
}
XMLProperty const * type = node.property ("automation-id");
- if (type && type->value () == ARDOUR::EventTypeMap::instance().to_symbol (_control->parameter())) {
+ if (type && type->value () == ARDOUR::EventTypeMap::instance().to_symbol (_parameter)) {
XMLProperty const * shown = node.property ("shown");
if (shown && shown->value () == "yes") {
set_marked_for_display (true);
AutomationTimeAxisView::set_state_2X (const XMLNode& node, int /*version*/)
{
- if (node.name() == X_("gain") && _control->parameter() == Evoral::Parameter (GainAutomation)) {
+ if (node.name() == X_("gain") && _parameter == Evoral::Parameter (GainAutomation)) {
XMLProperty const * shown = node.property (X_("shown"));
if (shown && string_is_affirmative (shown->value ())) {
set_marked_for_display (true);
TimeAxisView* state_parent = get_parent_with_state ();
if (state_parent) {
- return state_parent->get_automation_child_xml_node (_control->parameter());
+ return state_parent->get_automation_child_xml_node (_parameter);
} else {
return 0;
}
boost::shared_ptr<ARDOUR::AutomationControl> control() { return _control; }
boost::shared_ptr<AutomationController> controller() { return _controller; }
+ Evoral::Parameter parameter () const {
+ return _parameter;
+ }
ArdourCanvas::Item* base_item () const {
return _base_rect;
}
protected:
- /** parent route *
+ /** parent route */
boost::shared_ptr<ARDOUR::Route> _route;
/** control; 0 if we are editing region-based automation */
- boost::shared_ptr<ARDOUR::AutomationControl> _control; ///< Control
+ boost::shared_ptr<ARDOUR::AutomationControl> _control;
/** control owner; may be _route, or 0 if we are editing region-based automation */
boost::shared_ptr<ARDOUR::Automatable> _automatable;
/** controller owner; 0 if we are editing region-based automation */
boost::shared_ptr<AutomationController> _controller;
+ Evoral::Parameter _parameter;
ArdourCanvas::SimpleRect* _base_rect;
boost::shared_ptr<AutomationLine> _line;
/* These controllers are region "automation", so we do not create
* an AutomationList/Line for the track */
- boost::shared_ptr<AutomationControl> c = _route->get_control (param);
- assert (c);
-
boost::shared_ptr<AutomationTimeAxisView> track (
new AutomationTimeAxisView (
_session,
_route,
_route,
- c,
+ boost::shared_ptr<AutomationControl> (),
+ param,
_editor,
*this,
true,
= boost::dynamic_pointer_cast<AutomationControl>(processor->control(what, true));
pan->view = boost::shared_ptr<AutomationTimeAxisView>(
- new AutomationTimeAxisView (_session, _route, processor, control,
- _editor, *this, false, parent_canvas, name, state_name));
+ new AutomationTimeAxisView (_session, _route, processor, control, control->parameter (),
+ _editor, *this, false, parent_canvas, name, state_name));
pan->view->Hiding.connect (sigc::bind (sigc::mem_fun(*this, &RouteTimeAxisView::processor_automation_track_hidden), pan, processor));
}
gain_track.reset (new AutomationTimeAxisView (_session,
- _route, _route->amp(), c,
+ _route, _route->amp(), c, param,
_editor,
*this,
false,