clear_history -> clear_changes and some comments.
[ardour.git] / libs / pbd / pbd / stateful.h
index 5585b5c13b41196c6035042b4bec140a2024ef4a..5c1f079bc6d47240e1d9b0d47a9882dbd6545502 100644 (file)
@@ -48,12 +48,10 @@ class Stateful {
 
        virtual XMLNode& get_state (void) = 0;
        virtual int set_state (const XMLNode&, int version) = 0;
-       /* derived types do not have to implement this, but probably should
-          give it serious attention.
-       */
-       virtual bool set_property (const PropertyBase&) { return false; }
 
-       PropertyChange set_properties (const PropertyList&);
+       virtual bool apply_changes (PropertyBase const &);
+       PropertyChange apply_changes (PropertyList const &);
+       
         const OwnedPropertyList& properties() const { return *_properties; }
 
        void add_property (PropertyBase& s);
@@ -69,13 +67,15 @@ class Stateful {
 
         /* history management */
 
-       void clear_history ();
-        void diff (PropertyList&, PropertyList&) const;
+       void clear_changes ();
+       virtual void clear_owned_changes ();
+        PropertyList* get_changes_as_properties (Command *) const;
+       virtual void rdiff (std::vector<StatefulDiffCommand*> &) const;
         bool changed() const;
 
         /* create a property list from an XMLNode
          */
-        virtual PropertyList* property_factory(const XMLNode&) const { return 0; }
+        virtual PropertyList* property_factory (const XMLNode&) const;
 
        /* How stateful's notify of changes to their properties
         */
@@ -95,10 +95,8 @@ class Stateful {
        void add_instant_xml (XMLNode&, const sys::path& directory_path);
        XMLNode *instant_xml (const std::string& str, const sys::path& directory_path);
        void add_properties (XMLNode &);
-       /* derived types can call this from ::set_state() (or elsewhere)
-          to get basic property setting done.
-       */
-       PropertyChange set_properties (XMLNode const &);
+
+       PropertyChange set_values (XMLNode const &);
        
        /* derived classes can implement this to do cross-checking
           of property values after either a PropertyList or XML