X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fexport_preset.cc;h=d18c80d872abc528346bfde4432f90c4291c8ce5;hb=3d366053e2719ca0f129c16575ce481fcd214f61;hp=093803daa6d8d0884d194b9771ba5a1ef04fdc2f;hpb=3b89d9eaa03406a5e03648f47734211f09b89d62;p=ardour.git diff --git a/libs/ardour/export_preset.cc b/libs/ardour/export_preset.cc index 093803daa6..d18c80d872 100644 --- a/libs/ardour/export_preset.cc +++ b/libs/ardour/export_preset.cc @@ -29,15 +29,15 @@ ExportPreset::ExportPreset (string filename, Session & s) : session (s), global (filename), local (0) { XMLNode * root; + std::string str; if ((root = global.root())) { - XMLProperty * prop; - if ((prop = root->property ("id"))) { - set_id (prop->value()); + if (root->get_property ("id", str)) { + set_id (str); } - if ((prop = root->property ("name"))) { - set_name (prop->value()); + if (root->get_property ("name", str)) { + set_name (str); } - + XMLNode * instant_xml = get_instant_xml (); if (instant_xml) { XMLNode * instant_copy = new XMLNode (*instant_xml); @@ -56,12 +56,12 @@ ExportPreset::set_name (string const & name) { _name = name; - XMLNode * node; + XMLNode * node; if ((node = global.root())) { - node->add_property ("name", name); + node->set_property ("name", name); } if (local) { - local->add_property ("name", name); + local->set_property ("name", name); } } @@ -72,10 +72,10 @@ ExportPreset::set_id (string const & id) XMLNode * node; if ((node = global.root())) { - node->add_property ("id", id); + node->set_property ("id", id); } if (local) { - local->add_property ("id", id); + local->set_property ("id", id); } } @@ -84,7 +84,7 @@ ExportPreset::set_global_state (XMLNode & state) { delete global.root (); global.set_root (&state); - + set_id (_id.to_s()); set_name (_name); } @@ -94,7 +94,7 @@ ExportPreset::set_local_state (XMLNode & state) { delete local; local = &state; - + set_id (_id.to_s()); set_name (_name); } @@ -103,6 +103,7 @@ void ExportPreset::save (std::string const & filename) { save_instant_xml (); + if (global.root()) { global.set_filename (filename); global.write (); @@ -119,17 +120,17 @@ XMLNode * ExportPreset::get_instant_xml () const { XMLNode * instant_xml; - + if ((instant_xml = session.instant_xml ("ExportPresets"))) { XMLNodeList children = instant_xml->children ("ExportPreset"); for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) { - XMLProperty * prop; + XMLProperty const * prop; if ((prop = (*it)->property ("id")) && _id == PBD::UUID(prop->value())) { return *it; } } } - + return 0; } @@ -139,9 +140,9 @@ ExportPreset::save_instant_xml () const if (!local) { return; } /* First remove old, then add new */ - + remove_instant_xml (); - + XMLNode * instant_xml; if ((instant_xml = session.instant_xml ("ExportPresets"))) { instant_xml->add_child_copy (*local);