[beast: 5/9] BSE: Song: save 'bpm' and 'musical_tuning' properties to undo



commit 91e35d6faf43b3554a422aa2c05093a8b9271bbb
Author: Tim Janik <timj gnu org>
Date:   Thu Nov 19 13:23:15 2015 +0100

    BSE: Song: save 'bpm' and 'musical_tuning' properties to undo
    
    Signed-off-by: Tim Janik <timj gnu org>

 bse/bsesong.cc |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/bse/bsesong.cc b/bse/bsesong.cc
index a657262..d308d5a 100644
--- a/bse/bsesong.cc
+++ b/bse/bsesong.cc
@@ -925,9 +925,13 @@ void
 SongImpl::bpm (double val)
 {
   BseSong *self = as<BseSong*>();
-  self->bpm = val;
-  bse_song_update_tpsi_SL (self);
-  // changed ("bpm");
+  if (self->bpm != val)
+    {
+      push_property_undo ("bpm");
+      self->bpm = val;
+      bse_song_update_tpsi_SL (self);
+      // changed ("bpm");
+    }
 }
 
 MusicalTuningType
@@ -941,8 +945,9 @@ void
 SongImpl::musical_tuning (MusicalTuningType tuning)
 {
   BseSong *self = as<BseSong*>();
-  if (!BSE_SOURCE_PREPARED (self))
+  if (!BSE_SOURCE_PREPARED (self) && self->musical_tuning != tuning)
     {
+      push_property_undo ("musical_tuning");
       self->musical_tuning = tuning;
       SfiRing *ring;
       for (ring = self->parts; ring; ring = sfi_ring_walk (ring, self->parts))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]