No-op: rename a few variables and add/fix some comments.
[ardour.git] / libs / ardour / playlist.cc
index 5968f67f215353de7e719e58825dad61cd5f998c..c71d53deca6dc009d6ac769b66be5ed695847b64 100644 (file)
@@ -131,16 +131,18 @@ RegionListProperty::copy_for_history () const
 }
 
 void 
-RegionListProperty::diff (PropertyList& before, PropertyList& after) const
+RegionListProperty::diff (PropertyList& undo, PropertyList& redo) const
 {
-        if (_have_old) {
+        if (changed()) {
+               /* list of the removed/added regions since clear_history() was last called */
                 RegionListProperty* a = copy_for_history ();
-                RegionListProperty* b = copy_for_history ();
 
+               /* the same list, but with removed/added lists swapped (for undo purposes) */
+                RegionListProperty* b = copy_for_history ();
                 b->invert_changes ();
 
-                before.add (b);
-                after.add (a);
+                undo.add (b);
+                redo.add (a);
         }
 }
 
@@ -264,7 +266,7 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, framepos_t start, f
                        break;
                }
 
-               _session.region_name (new_name, region->name(), false);
+               RegionFactory::region_name (new_name, region->name(), false);
 
                PropertyList plist; 
 
@@ -693,7 +695,7 @@ Playlist::add_region (boost::shared_ptr<Region> region, framepos_t position, flo
        if (floor (times) != times) {
                length = (framecnt_t) floor (region->length() * (times - floor (times)));
                string name;
-               _session.region_name (name, region->name(), false);
+               RegionFactory::region_name (name, region->name(), false);
 
                {
                        PropertyList plist;
@@ -963,7 +965,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
                                if (!cutting) {
                                        /* "middle" ++++++ */
 
-                                       _session.region_name (new_name, current->name(), false);
+                                       RegionFactory::region_name (new_name, current->name(), false);
 
                                        PropertyList plist;
                                        
@@ -982,7 +984,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
 
                                /* "end" ====== */
 
-                               _session.region_name (new_name, current->name(), false);
+                               RegionFactory::region_name (new_name, current->name(), false);
 
                                PropertyList plist;
                                
@@ -1020,7 +1022,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
 
                                        /* end +++++ */
 
-                                       _session.region_name (new_name, current->name(), false);
+                                       RegionFactory::region_name (new_name, current->name(), false);
                                        
                                        PropertyList plist;
                                        
@@ -1063,7 +1065,7 @@ Playlist::partition_internal (framepos_t start, framepos_t end, bool cutting, Re
 
                                if (!cutting) {
                                        /* front **** */
-                                       _session.region_name (new_name, current->name(), false);
+                                       RegionFactory::region_name (new_name, current->name(), false);
 
                                        PropertyList plist;
                                        
@@ -1267,7 +1269,7 @@ Playlist::duplicate (boost::shared_ptr<Region> region, framepos_t position, floa
        if (floor (times) != times) {
                framecnt_t length = (framecnt_t) floor (region->length() * (times - floor (times)));
                string name;
-               _session.region_name (name, region->name(), false);
+               RegionFactory::region_name (name, region->name(), false);
                
                {
                        PropertyList plist;
@@ -1368,7 +1370,7 @@ Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_p
        before = playlist_position - region->position();
        after = region->length() - before;
 
-       _session.region_name (before_name, region->name(), false);
+       RegionFactory::region_name (before_name, region->name(), false);
 
        {
                PropertyList plist;
@@ -1381,7 +1383,7 @@ Playlist::_split_region (boost::shared_ptr<Region> region, framepos_t playlist_p
                left = RegionFactory::create (region, plist);
        }
 
-       _session.region_name (after_name, region->name(), false);
+       RegionFactory::region_name (after_name, region->name(), false);
 
        {
                PropertyList plist;