along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id$
*/
#include <fstream>
#include <sigc++/bind.h>
#include <pbd/xml++.h>
+#include <pbd/enumwriter.h>
#include <ardour/redirect.h>
#include <ardour/session.h>
}
}
-void
-Redirect::set_placement (const string& str, void *src)
-{
- if (str == _("pre")) {
- set_placement (PreFader, this);
- } else if (str == _("post")) {
- set_placement (PostFader, this);
- } else {
- error << string_compose(_("Redirect: unknown placement string \"%1\" (ignored)"), str) << endmsg;
- }
-}
-
/* NODE STRUCTURE
<Automation [optionally with visible="...." ]>
stringstream sstr;
node->add_property("active", active() ? "yes" : "no");
- node->add_property("placement", placement_as_string (placement()));
+ node->add_property("placement", enum_2_string (_placement));
node->add_child_nocopy (IO::state (full_state));
if (_extra_xml){
}
if (_active != (prop->value() == "yes")) {
- _active = !_active;
- active_changed (this, this); /* EMIT_SIGNAL */
+ if (!(_session.state_of_the_state() & Session::Loading) ||
+ !Session::get_disable_all_loaded_plugins()) {
+ _active = !_active;
+ active_changed (this, this); /* EMIT_SIGNAL */
+ }
}
if ((prop = node.property ("placement")) == 0) {
return -1;
}
- set_placement (prop->value(), this);
+ /* hack to handle older sessions before we only used EnumWriter */
+
+ string pstr;
+
+ if (prop->value() == "pre") {
+ pstr = "PreFader";
+ } else if (prop->value() == "post") {
+ pstr = "PostFader";
+ } else {
+ pstr = prop->value();
+ }
+
+ Placement p = Placement (string_2_enum (pstr, p));
+ set_placement (p, this);
return 0;
}