add display name to processors (so that it can differ from the "real name"); pay...
[ardour.git] / libs / ardour / processor.cc
index 84fb43d68c75468a276402079625fd0f6ca51905..e3a2b0b15ef5caf361e821d6f5326be75d5b4546 100644 (file)
 
 */
 
+#ifdef WAF_BUILD
+#include "libardour-config.h"
+#endif
+
 #include <string>
 
 #include <sigc++/bind.h>
@@ -64,17 +68,21 @@ Processor::Processor(Session& session, const string& name)
        , _active(false)
        , _next_ab_is_active(false)
        , _configured(false)
-       , _sort_key (0)
        , _gui(0)
 {
 }
 
-void
-Processor::set_sort_key (uint32_t key)
+Processor::Processor (Session& session, const XMLNode& node)
+       : SessionObject(session, "renameMe")
+       , AutomatableControls(session)
+       , _active(false)
+       , _next_ab_is_active(false)
+       , _configured(false)
+       , _gui(0)
 {
-       _sort_key = key;
+       set_state (node);
 }
-       
+
 XMLNode&
 Processor::get_state (void)
 {
@@ -102,14 +110,10 @@ Processor::state (bool full_state)
        stringstream sstr;
        char buf[64];
        
-       // NOTE: This conflicts with "id" used by plugin for name in legacy sessions
-
        id().print (buf, sizeof (buf));
        node->add_property("id", buf);
        node->add_property("name", _name);
        node->add_property("active", active() ? "yes" : "no");  
-       snprintf (buf, sizeof (buf), "%u", _sort_key);
-       node->add_property("sort-key", buf);
 
        if (_extra_xml){
                node->add_child_copy (*_extra_xml);
@@ -142,7 +146,6 @@ Processor::set_state (const XMLNode& node)
 {
        const XMLProperty *prop;
        const XMLProperty *legacy_active = 0;
-       const XMLProperty *legacy_placement = 0;
 
        // may not exist for legacy 3.0 sessions
        if ((prop = node.property ("name")) != 0) {
@@ -152,7 +155,7 @@ Processor::set_state (const XMLNode& node)
        // may not exist for legacy 3.0 sessions
        if ((prop = node.property ("id")) != 0) {
                _id = prop->value();
-       }
+       } 
 
        XMLNodeList nlist = node.children();
        XMLNodeIterator niter;
@@ -192,9 +195,6 @@ Processor::set_state (const XMLNode& node)
                        if ( !(legacy_active = (*niter)->property("active"))) {
                                error << string_compose(_("No %1 property flag in element %2"), "active", (*niter)->name()) << endl;
                        }
-                       if ( !(legacy_placement = (*niter)->property("placement"))) {
-                               error << string_compose(_("No %1 property flag in element %2"), "placement", (*niter)->name()) << endl;
-                       }
                }
        }
 
@@ -222,7 +222,8 @@ Processor::configure_io (ChanCount in, ChanCount out)
 {
        /* This class assumes 1:1 input:output.static output stream count.
           Derived classes must override and set _configured_output appropriately
-          if this is not the case */
+          if this is not the case 
+       */
 
        _configured_input = in; 
        _configured_output = out;