mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 23:05:04 +01:00
Use XMLNode::set_property API in copy-mixer Session utility
This commit is contained in:
parent
a6d71df0d0
commit
0c75813129
1 changed files with 7 additions and 9 deletions
|
|
@ -39,37 +39,35 @@ trim_state_for_mixer_copy (Session*s, XMLNode& node)
|
||||||
*/
|
*/
|
||||||
XMLProperty const * target = (*i)->property (X_("name"));
|
XMLProperty const * target = (*i)->property (X_("name"));
|
||||||
if (!target) {
|
if (!target) {
|
||||||
(*i)->add_property ("type", "dangling-aux-send");
|
(*i)->set_property ("type", "dangling-aux-send");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
boost::shared_ptr<Route> r = s->route_by_name (target->value ());
|
boost::shared_ptr<Route> r = s->route_by_name (target->value ());
|
||||||
if (!r || boost::dynamic_pointer_cast<Track> (r)) {
|
if (!r || boost::dynamic_pointer_cast<Track> (r)) {
|
||||||
(*i)->add_property ("type", "dangling-aux-send");
|
(*i)->set_property ("type", "dangling-aux-send");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
(*i)->add_property ("target", r->id ().to_s ());
|
(*i)->set_property ("target", r->id ().to_s ());
|
||||||
}
|
}
|
||||||
if (role && role->value () == X_("Listen")) {
|
if (role && role->value () == X_("Listen")) {
|
||||||
(*i)->remove_property (X_("bitslot"));
|
(*i)->remove_property (X_("bitslot"));
|
||||||
}
|
}
|
||||||
else if (role && (role->value () == X_("Send") || role->value () == X_("Aux"))) {
|
else if (role && (role->value () == X_("Send") || role->value () == X_("Aux"))) {
|
||||||
char buf[32];
|
|
||||||
Delivery::Role xrole;
|
Delivery::Role xrole;
|
||||||
uint32_t bitslot = 0;
|
uint32_t bitslot = 0;
|
||||||
xrole = Delivery::Role (string_2_enum (role->value (), xrole));
|
xrole = Delivery::Role (string_2_enum (role->value (), xrole));
|
||||||
std::string name = Send::name_and_id_new_send (*s, xrole, bitslot, false);
|
std::string name = Send::name_and_id_new_send (*s, xrole, bitslot, false);
|
||||||
snprintf (buf, sizeof (buf), "%" PRIu32, bitslot);
|
|
||||||
(*i)->remove_property (X_("bitslot"));
|
(*i)->remove_property (X_("bitslot"));
|
||||||
(*i)->remove_property (X_("name"));
|
(*i)->remove_property (X_("name"));
|
||||||
(*i)->add_property ("bitslot", buf);
|
(*i)->set_property ("bitslot", bitslot);
|
||||||
(*i)->add_property ("name", name);
|
(*i)->set_property ("name", name);
|
||||||
}
|
}
|
||||||
else if (type && type->value () == X_("intreturn")) {
|
else if (type && type->value () == X_("intreturn")) {
|
||||||
// ignore, in case bus existed in old session,
|
// ignore, in case bus existed in old session,
|
||||||
// tracks in old session may be connected to it.
|
// tracks in old session may be connected to it.
|
||||||
// if the bus is new, new_route_from_template()
|
// if the bus is new, new_route_from_template()
|
||||||
// will have re-created an ID.
|
// will have re-created an ID.
|
||||||
(*i)->add_property ("type", "ignore-aux-return");
|
(*i)->set_property ("type", "ignore-aux-return");
|
||||||
}
|
}
|
||||||
else if (type && type->value () == X_("return")) {
|
else if (type && type->value () == X_("return")) {
|
||||||
// Return::set_state() generates a new one
|
// Return::set_state() generates a new one
|
||||||
|
|
@ -78,7 +76,7 @@ trim_state_for_mixer_copy (Session*s, XMLNode& node)
|
||||||
else if (type && type->value () == X_("port")) {
|
else if (type && type->value () == X_("port")) {
|
||||||
// PortInsert::set_state() handles the bitslot
|
// PortInsert::set_state() handles the bitslot
|
||||||
(*i)->remove_property (X_("bitslot"));
|
(*i)->remove_property (X_("bitslot"));
|
||||||
(*i)->add_property ("ignore-name", "1");
|
(*i)->set_property ("ignore-name", "1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue