mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-17 04:06:26 +01:00
Fix multiple creation of identical automation tracks. Fixes #3482.
git-svn-id: svn://localhost/ardour2/branches/3.0@7848 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8000b39c8c
commit
74cc8f6067
6 changed files with 16 additions and 12 deletions
|
|
@ -193,9 +193,7 @@ AutomationTimeAxisView::AutomationTimeAxisView (Session* s, boost::shared_ptr<Ro
|
||||||
controls_base_unselected_name = X_("AutomationTrackControlsBase");
|
controls_base_unselected_name = X_("AutomationTrackControlsBase");
|
||||||
controls_ebox.set_name (controls_base_unselected_name);
|
controls_ebox.set_name (controls_base_unselected_name);
|
||||||
|
|
||||||
XMLNode* xml_node = get_parent_with_state()->get_automation_child_xml_node (
|
XMLNode* xml_node = get_parent_with_state()->get_automation_child_xml_node (_control->parameter());
|
||||||
_control->parameter(), Stateful::loading_state_version
|
|
||||||
);
|
|
||||||
|
|
||||||
if (xml_node) {
|
if (xml_node) {
|
||||||
set_state (*xml_node, Stateful::loading_state_version);
|
set_state (*xml_node, Stateful::loading_state_version);
|
||||||
|
|
@ -404,7 +402,7 @@ AutomationTimeAxisView::set_height (uint32_t h)
|
||||||
|
|
||||||
TimeAxisView* state_parent = get_parent_with_state ();
|
TimeAxisView* state_parent = get_parent_with_state ();
|
||||||
assert(state_parent);
|
assert(state_parent);
|
||||||
XMLNode* xml_node = state_parent->get_automation_child_xml_node (_control->parameter(), Stateful::loading_state_version);
|
XMLNode* xml_node = state_parent->get_automation_child_xml_node (_control->parameter());
|
||||||
|
|
||||||
TimeAxisView::set_height (h);
|
TimeAxisView::set_height (h);
|
||||||
_base_rect->property_y2() = h;
|
_base_rect->property_y2() = h;
|
||||||
|
|
@ -995,7 +993,7 @@ AutomationTimeAxisView::get_state_node ()
|
||||||
TimeAxisView* state_parent = get_parent_with_state ();
|
TimeAxisView* state_parent = get_parent_with_state ();
|
||||||
|
|
||||||
if (state_parent) {
|
if (state_parent) {
|
||||||
return state_parent->get_automation_child_xml_node (_control->parameter(), Stateful::loading_state_version);
|
return state_parent->get_automation_child_xml_node (_control->parameter());
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ public:
|
||||||
|
|
||||||
/* make sure we get the right version of this */
|
/* make sure we get the right version of this */
|
||||||
|
|
||||||
XMLNode* get_automation_child_xml_node (Evoral::Parameter param, int version) { return RouteUI::get_automation_child_xml_node (param, version); }
|
XMLNode* get_automation_child_xml_node (Evoral::Parameter param) { return RouteUI::get_automation_child_xml_node (param); }
|
||||||
|
|
||||||
typedef std::map<Evoral::Parameter, boost::shared_ptr<AutomationTimeAxisView> > AutomationTracks;
|
typedef std::map<Evoral::Parameter, boost::shared_ptr<AutomationTimeAxisView> > AutomationTracks;
|
||||||
AutomationTracks automation_tracks() { return _automation_tracks; }
|
AutomationTracks automation_tracks() { return _automation_tracks; }
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ RouteUI::init ()
|
||||||
{
|
{
|
||||||
self_destruct = true;
|
self_destruct = true;
|
||||||
xml_node = 0;
|
xml_node = 0;
|
||||||
|
_xml_node_version = Stateful::current_state_version;
|
||||||
mute_menu = 0;
|
mute_menu = 0;
|
||||||
solo_menu = 0;
|
solo_menu = 0;
|
||||||
sends_menu = 0;
|
sends_menu = 0;
|
||||||
|
|
@ -1266,12 +1267,15 @@ RouteUI::ensure_xml_node ()
|
||||||
if ((xml_node = _route->extra_xml ("GUI")) == 0) {
|
if ((xml_node = _route->extra_xml ("GUI")) == 0) {
|
||||||
xml_node = new XMLNode ("GUI");
|
xml_node = new XMLNode ("GUI");
|
||||||
_route->add_extra_xml (*xml_node);
|
_route->add_extra_xml (*xml_node);
|
||||||
|
} else {
|
||||||
|
/* the Route has one, so it must have been loaded */
|
||||||
|
_xml_node_version = Stateful::loading_state_version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
XMLNode*
|
XMLNode*
|
||||||
RouteUI::get_automation_child_xml_node (Evoral::Parameter param, int version)
|
RouteUI::get_automation_child_xml_node (Evoral::Parameter param)
|
||||||
{
|
{
|
||||||
ensure_xml_node ();
|
ensure_xml_node ();
|
||||||
|
|
||||||
|
|
@ -1282,15 +1286,16 @@ RouteUI::get_automation_child_xml_node (Evoral::Parameter param, int version)
|
||||||
|
|
||||||
for (iter = kids.begin(); iter != kids.end(); ++iter) {
|
for (iter = kids.begin(); iter != kids.end(); ++iter) {
|
||||||
|
|
||||||
if (version < 3000) {
|
if (_xml_node_version < 3000) {
|
||||||
if ((*iter)->name() == sym) {
|
if ((*iter)->name() == sym) {
|
||||||
return *iter;
|
return *iter;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ((*iter)->name() == AutomationTimeAxisView::state_node_name) {
|
if ((*iter)->name() == AutomationTimeAxisView::state_node_name) {
|
||||||
XMLProperty* type = (*iter)->property("automation-id");
|
XMLProperty* type = (*iter)->property("automation-id");
|
||||||
if (type && type->value() == sym)
|
if (type && type->value() == sym) {
|
||||||
return *iter;
|
return *iter;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,9 @@ class RouteUI : public virtual AxisView
|
||||||
|
|
||||||
XMLNode *xml_node;
|
XMLNode *xml_node;
|
||||||
void ensure_xml_node ();
|
void ensure_xml_node ();
|
||||||
|
int _xml_node_version;
|
||||||
|
|
||||||
virtual XMLNode* get_automation_child_xml_node (Evoral::Parameter, int);
|
virtual XMLNode* get_automation_child_xml_node (Evoral::Parameter);
|
||||||
|
|
||||||
bool mute_press(GdkEventButton*);
|
bool mute_press(GdkEventButton*);
|
||||||
bool mute_release(GdkEventButton*);
|
bool mute_release(GdkEventButton*);
|
||||||
|
|
|
||||||
|
|
@ -206,7 +206,7 @@ class TimeAxisView : public virtual AxisView, public PBD::Stateful
|
||||||
|
|
||||||
/* call this on the parent */
|
/* call this on the parent */
|
||||||
|
|
||||||
virtual XMLNode* get_automation_child_xml_node (Evoral::Parameter, int) { return 0; }
|
virtual XMLNode* get_automation_child_xml_node (Evoral::Parameter) { return 0; }
|
||||||
|
|
||||||
virtual LayerDisplay layer_display () const { return Overlaid; }
|
virtual LayerDisplay layer_display () const { return Overlaid; }
|
||||||
virtual StreamView* view () const { return 0; }
|
virtual StreamView* view () const { return 0; }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue