diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-02 17:36:38 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-01-02 17:36:38 +0000 |
commit | 8fabcf4f760e68e10573efc0ef1da9d6d8453885 (patch) | |
tree | e7362b6dbb266b639c5e4855bd9eadf522d58911 /libs/ardour/redirect.cc | |
parent | b529cbc5dc0b92f01ff01d5f40786ff025fbb63b (diff) |
finish use of EnumWriter for saving flags etc. throughout the session file
git-svn-id: svn://localhost/ardour2/trunk@1259 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/redirect.cc')
-rw-r--r-- | libs/ardour/redirect.cc | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/libs/ardour/redirect.cc b/libs/ardour/redirect.cc index ba81252511..a5f6031f30 100644 --- a/libs/ardour/redirect.cc +++ b/libs/ardour/redirect.cc @@ -28,6 +28,7 @@ #include <sigc++/bind.h> #include <pbd/xml++.h> +#include <pbd/enumwriter.h> #include <ardour/redirect.h> #include <ardour/session.h> @@ -97,18 +98,6 @@ Redirect::set_placement (Placement p, void *src) } } -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="...." ]> @@ -195,7 +184,7 @@ Redirect::state (bool full_state) 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){ @@ -295,7 +284,20 @@ Redirect::set_state (const XMLNode& node) 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; } |