lilypond-devel
[Top][All Lists]
Advanced

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

Issue 4142: Make skipTypesetting skip time signatures (issue 148360043 b


From: nine . fierce . ballads
Subject: Issue 4142: Make skipTypesetting skip time signatures (issue 148360043 by address@hidden)
Date: Tue, 30 Sep 2014 12:32:26 +0000

Reviewers: ,

Message:
The problem was discovered while debugging
https://codereview.appspot.com/143450043/ .

Description:
Setting Score.skipTypesetting used to defer creating a time signature
rather than skip it entirely.  With this change, the temporal
placement of time signatures is not affected by Score.skipTypesetting.

The effect is evident in a few regression tests that set
Score.skipTypesetting at the beginning.

Please review this at https://codereview.appspot.com/148360043/

Affected files (+22, -17 lines):
  M lily/time-signature-engraver.cc


Index: lily/time-signature-engraver.cc
diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 8461a01058251f67425e2cb1bd16e335a02bc053..564a327086e197bb4d3ae5548a1e31106ab868b3 100644
--- a/lily/time-signature-engraver.cc
+++ b/lily/time-signature-engraver.cc
@@ -56,13 +56,29 @@ Time_signature_engraver::Time_signature_engraver ()
 void
 Time_signature_engraver::process_music ()
 {
-  /*
-    not rigorously safe, since the value might get GC'd and
-    reallocated in the same spot */
+  if (!time_signature_)
+    {
+      /*
+        not rigorously safe, since the value might get GC'd and
+        reallocated in the same spot */
+      SCM fr = get_property ("timeSignatureFraction");
+      if ((last_time_fraction_ != fr) && scm_is_pair (fr))
+        {
+          time_signature_ = make_item ("TimeSignature", SCM_EOL);
+          time_signature_->set_property ("fraction", fr);
+
+          if (last_time_fraction_ == SCM_BOOL_F)
+            time_signature_->set_property ("break-visibility",
+ get_property ("implicitTimeSignatureVisibility"));
+        }
+    }
+}
+
+void
+Time_signature_engraver::stop_translation_timestep ()
+{
   SCM fr = get_property ("timeSignatureFraction");
-  if (!time_signature_
-      && last_time_fraction_ != fr
-      && scm_is_pair (fr))
+  if ((last_time_fraction_ != fr) && scm_is_pair (fr))
     {
       int den = scm_to_int (scm_cdr (fr));
       if (den != (1 << intlog2 (den)))
@@ -77,20 +93,9 @@ Time_signature_engraver::process_music ()
                        den));
         }

-      time_signature_ = make_item ("TimeSignature", SCM_EOL);
-      time_signature_->set_property ("fraction", fr);
-
-      if (last_time_fraction_ == SCM_BOOL_F)
-        time_signature_->set_property ("break-visibility",
- get_property ("implicitTimeSignatureVisibility"));
-
       last_time_fraction_ = fr;
     }
-}

-void
-Time_signature_engraver::stop_translation_timestep ()
-{
   time_signature_ = 0;
 }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]