Fix ATAV identification by Parameter (2/2) #8201, 8203
Allow to uniquely identify Processor ATAV using the control ID.
This commit is contained in:
parent
0ab13e7b29
commit
54ffd92fde
|
@ -2749,6 +2749,23 @@ RouteTimeAxisView::remove_child (boost::shared_ptr<TimeAxisView> c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr<AutomationTimeAxisView>
|
||||||
|
RouteTimeAxisView::automation_child(Evoral::Parameter param, PBD::ID ctrl_id)
|
||||||
|
{
|
||||||
|
if (param.type() != PluginAutomation) {
|
||||||
|
return StripableTimeAxisView::automation_child (param, ctrl_id);
|
||||||
|
}
|
||||||
|
for (list<ProcessorAutomationInfo*>::iterator i = processor_automation.begin(); i != processor_automation.end(); ++i) {
|
||||||
|
for (vector<ProcessorAutomationNode*>::iterator ii = (*i)->lines.begin(); ii != (*i)->lines.end(); ++ii) {
|
||||||
|
boost::shared_ptr<AutomationTimeAxisView> atv ((*ii)->view);
|
||||||
|
if (atv->control()->id() == ctrl_id) {
|
||||||
|
return atv;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return boost::shared_ptr<AutomationTimeAxisView>();
|
||||||
|
}
|
||||||
|
|
||||||
boost::shared_ptr<AutomationLine>
|
boost::shared_ptr<AutomationLine>
|
||||||
RouteTimeAxisView::automation_child_by_alist_id (PBD::ID alist_id)
|
RouteTimeAxisView::automation_child_by_alist_id (PBD::ID alist_id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -134,6 +134,7 @@ public:
|
||||||
int set_state (const XMLNode&, int version);
|
int set_state (const XMLNode&, int version);
|
||||||
|
|
||||||
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
||||||
|
virtual boost::shared_ptr<AutomationTimeAxisView> automation_child(Evoral::Parameter param, PBD::ID ctrl_id = PBD::ID(0));
|
||||||
|
|
||||||
StreamView* view() const { return _view; }
|
StreamView* view() const { return _view; }
|
||||||
ARDOUR::RouteGroup* route_group() const;
|
ARDOUR::RouteGroup* route_group() const;
|
||||||
|
|
|
@ -1073,6 +1073,7 @@ Selection::get_state () const
|
||||||
XMLNode* t = node->add_child (X_("AutomationView"));
|
XMLNode* t = node->add_child (X_("AutomationView"));
|
||||||
t->set_property (X_("id"), atv->parent_stripable()->id ());
|
t->set_property (X_("id"), atv->parent_stripable()->id ());
|
||||||
t->set_property (X_("parameter"), EventTypeMap::instance().to_symbol (atv->parameter ()));
|
t->set_property (X_("parameter"), EventTypeMap::instance().to_symbol (atv->parameter ()));
|
||||||
|
t->set_property (X_("ctrl_id"), atv->control()->id())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1302,30 +1303,28 @@ Selection::set_state (XMLNode const & node, int)
|
||||||
|
|
||||||
} else if ((*i)->name() == X_("AutomationView")) {
|
} else if ((*i)->name() == X_("AutomationView")) {
|
||||||
|
|
||||||
#if 0
|
// XXX is this even used? -> StripableAutomationControl
|
||||||
std::string param;
|
std::string param;
|
||||||
|
PBD::ID ctrl_id (0);
|
||||||
|
|
||||||
if (!(*i)->get_property (X_("id"), id) || !(*i)->get_property (X_("parameter"), param)) {
|
if (!(*i)->get_property (X_("id"), id) || !(*i)->get_property (X_("parameter"), param)) {
|
||||||
assert (false);
|
assert (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO we need additional information Evoral::Parmeter does not uniquely identify an Automation Lane
|
|
||||||
|
|
||||||
StripableTimeAxisView* stv = editor->get_stripable_time_axis_by_id (id);
|
StripableTimeAxisView* stv = editor->get_stripable_time_axis_by_id (id);
|
||||||
|
|
||||||
if (stv) {
|
if (stv && (*i)->get_property (X_("control_id"), ctrl_id)) {
|
||||||
boost::shared_ptr<AutomationTimeAxisView> atv = stv->automation_child (EventTypeMap::instance().from_symbol (param));
|
boost::shared_ptr<AutomationTimeAxisView> atv = stv->automation_child (EventTypeMap::instance().from_symbol (param), ctrl_id);
|
||||||
|
|
||||||
/* the automation could be for an entity that was never saved
|
/* the automation could be for an entity that was never saved
|
||||||
in the session file. Don't freak out if we can't find
|
* in the session file. Don't freak out if we can't find
|
||||||
it.
|
* it.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (atv) {
|
if (atv) {
|
||||||
add (atv.get());
|
add (atv.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
} else if ((*i)->name() == X_("Marker")) {
|
} else if ((*i)->name() == X_("Marker")) {
|
||||||
|
|
||||||
|
|
|
@ -191,7 +191,7 @@ StripableTimeAxisView::automation_track_hidden (Evoral::Parameter param)
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<AutomationTimeAxisView>
|
boost::shared_ptr<AutomationTimeAxisView>
|
||||||
StripableTimeAxisView::automation_child(Evoral::Parameter param)
|
StripableTimeAxisView::automation_child(Evoral::Parameter param, PBD::ID)
|
||||||
{
|
{
|
||||||
assert (param.type() != PluginAutomation);
|
assert (param.type() != PluginAutomation);
|
||||||
AutomationTracks::iterator i = _automation_tracks.find(param);
|
AutomationTracks::iterator i = _automation_tracks.find(param);
|
||||||
|
|
|
@ -36,7 +36,7 @@ public:
|
||||||
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
virtual Gtk::CheckMenuItem* automation_child_menu_item (Evoral::Parameter);
|
||||||
|
|
||||||
virtual void create_automation_child (const Evoral::Parameter& param, bool show) = 0;
|
virtual void create_automation_child (const Evoral::Parameter& param, bool show) = 0;
|
||||||
boost::shared_ptr<AutomationTimeAxisView> automation_child(Evoral::Parameter param);
|
virtual boost::shared_ptr<AutomationTimeAxisView> automation_child (Evoral::Parameter param, PBD::ID ctrl_id = PBD::ID(0));
|
||||||
|
|
||||||
virtual boost::shared_ptr<AutomationLine> automation_child_by_alist_id (PBD::ID);
|
virtual boost::shared_ptr<AutomationLine> automation_child_by_alist_id (PBD::ID);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue