remove sanitize node function, and clear substitutions vector before recalling. Fixes issue with dangling ports

This commit is contained in:
Nikolaus Gullotta 2019-06-03 14:03:17 -05:00 committed by Nikolaus Gullotta
parent e42f5322b8
commit fa4fcd2e60
No known key found for this signature in database
GPG key ID: 565F60578092AA31
2 changed files with 3 additions and 40 deletions

View file

@ -139,15 +139,15 @@ void MixerSnapshotSubstitutionDialog::on_response(int r)
if(route_name != subst_name) {
if(route_state_exists && subst_state_exists) {
XMLNode copy (get_state_by_name(subst_name).node);
sanitize_node(copy, route_name);
state.node = copy;
state.name = route_name;
}
//state did *not* exist, make it and add the substitute node
if(!route_state_exists && subst_state_exists) {
//copy the substitute node
XMLNode copy (get_state_by_name(subst_name).node);
sanitize_node(copy, route_name);
MixerSnapshot::State s {
"",
route_name,
@ -179,7 +179,7 @@ void MixerSnapshotSubstitutionDialog::on_response(int r)
for(vector<MixerSnapshot::State>::iterator s = dirty.begin(); s != dirty.end(); s++) {
cout << (*s).name << endl;
}
substitutions.clear();
_snapshot->set_route_states(dirty);
_snapshot->recall();
_snapshot->set_route_states(clean);
@ -206,39 +206,3 @@ MixerSnapshot::State MixerSnapshotSubstitutionDialog::get_state_by_name(const st
}
}
}
XMLNode& MixerSnapshotSubstitutionDialog::sanitize_node(XMLNode& node, const string route_name)
{
//remove I/O
node.remove_node_and_delete("IO", "direction", "Input");
node.remove_node_and_delete("IO", "direction", "Output");
node.remove_node_and_delete("IO", "direction", "Output");
//remove diskwriter and reader
node.remove_node_and_delete("Processor", "type", "diskwriter");
node.remove_node_and_delete("Processor", "type", "diskreader");
//set node <Route name=""> to destination's name
node.set_property(X_("name"), route_name);
//unlink playlists
node.remove_property(X_("id"));
node.remove_property(X_("audio-playlist"));
XMLNode* pi_node = find_named_node(node, X_("PresentationInfo"));
if(pi_node) {
pi_node->remove_property(X_("order"));
}
//remove any sidechain stuff
XMLNodeList nlist = node.children();
for(XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); niter++) {
if((*niter)->name() != "Processor") {
continue;
}
(*niter)->remove_node_and_delete("Processor", "type", "sidechain");
}
return node;
}

View file

@ -38,7 +38,6 @@ private:
ARDOUR::MixerSnapshot::State get_state_by_name(const std::string);
void fill_combo_box(Gtk::ComboBoxText*, const std::string);
void on_response(int);
XMLNode& sanitize_node(XMLNode&, const std::string);
std::vector<route_combo> substitutions;