clear waveform cache when shape changes - fixes #6525
[ardour.git] / libs / ardour / location.cc
index 1c08f8e2aebb224f5d8ad5474872e177b05d5245..c693e1f5d55034e3d84f421990a3206755fc7296 100644 (file)
@@ -759,9 +759,13 @@ Location::unlock ()
 void
 Location::set_scene_change (boost::shared_ptr<SceneChange>  sc)
 {
-       _scene_change = sc;
-
-       scene_changed (); /* EMIT SIGNAL */
+        if (_scene_change != sc) {
+                _scene_change = sc;
+                _session.set_dirty ();
+                
+                scene_changed (); /* EMIT SIGNAL */
+                SceneChangeChanged (); /* EMIT SIGNAL */
+        }
 }
 
 /*---------------------------------------------------------------------- */
@@ -824,8 +828,12 @@ Locations::next_available_name(string& result,string base)
                        const string& temp ((*i)->name());
                         
                        if (!temp.find (base,0)) {
-
-                               if ((suffix = atoi (temp.substr(l,3))) != 0) {
+                               /* grab what comes after the "base" as if it was
+                                  a number, and assuming that works OK,
+                                  store it in "taken" so that we know it
+                                  has been used.
+                               */
+                                if ((suffix = atoi (temp.substr(l))) != 0) {
                                        taken.insert (make_pair (suffix,true));
                                }
                        }