]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/define-grob-properties.scm (all-user-grob-properties): add
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 26 Sep 2006 10:49:11 +0000 (10:49 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 26 Sep 2006 10:49:11 +0000 (10:49 +0000)
forced property.

* lily/accidental.cc (after_line_breaking): read forced property.

* lily/accidental-engraver.cc (process_acknowledged): set 'forced
property.

* input/regression/accidental-forced-tie.ly:  new file.

ChangeLog
input/regression/accidental-forced-tie.ly [new file with mode: 0644]
lily/accidental-engraver.cc
lily/accidental.cc
lily/part-combine-iterator.cc
scm/define-grob-properties.scm

index 2b9d591750da3210122c5dbcac9671e3e0ab009c..f35d6e6f0b2ae2af96628b491940cf83726af42d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2006-09-26  Han-Wen Nienhuys  <hanwen@lilypond.org>
+
+       * scm/define-grob-properties.scm (all-user-grob-properties): add
+       forced property.
+
+       * lily/accidental.cc (after_line_breaking): read forced property.
+
+       * lily/accidental-engraver.cc (process_acknowledged): set 'forced
+       property.
+
+       * input/regression/accidental-forced-tie.ly:  new file.
+
 2006-09-25  Han-Wen Nienhuys  <hanwen@lilypond.org>
 
        * ly/engraver-init.ly: set ignoreFiguredBassRest in Staff context.
@@ -23,7 +35,7 @@
        rename make_foo_from_properties to internal_make_foo and
        move it from context-property.cc to a member function of
        Engraver.
-
+       
        * lily/include/lily-guile-macros.hh:
        overload ly_symbol2scm macro so that there is no more need
        to use internal_foo
diff --git a/input/regression/accidental-forced-tie.ly b/input/regression/accidental-forced-tie.ly
new file mode 100644 (file)
index 0000000..6c5b605
--- /dev/null
@@ -0,0 +1,13 @@
+\version "2.9.18"
+
+\header {
+  texidoc = "Accidentals can be forced with ! and ? even if the notes are tied."
+}
+
+\layout {
+  ragged-right = ##t
+}
+
+\relative {
+  gis'4 ~ gis!~ gis?
+  }
index f1e0a270b722549cb1ff05262a9183016975fba4..e08d3b377186e4daaf4ede19403d89710070ddb9 100644 (file)
@@ -333,8 +333,8 @@ Accidental_engraver::process_acknowledged ()
                                             pitch, origin,
                                             cautionaries, barnum);
 
-         bool cautionary = to_boolean (note->get_property ("cautionary"));
 
+         bool cautionary = to_boolean (note->get_property ("cautionary"));
          if (num_caut > num)
            {
              num = num_caut;
@@ -342,7 +342,8 @@ Accidental_engraver::process_acknowledged ()
              cautionary = true;
            }
 
-         if (num == 0 && to_boolean (note->get_property ("force-accidental")))
+         bool forced = to_boolean (note->get_property ("force-accidental"));
+         if (num == 0 && forced)
            num = 1;
 
          /* Cannot look for ties: it's not guaranteed that they reach
@@ -350,6 +351,10 @@ Accidental_engraver::process_acknowledged ()
          if (num
              && !note->in_event_class ("trill-span-event"))
            create_accidental (&accidentals_[i], num > 1, cautionary);
+
+
+         if (forced || cautionary)
+           accidentals_[i].accidental_->set_property ("forced", SCM_BOOL_T);
        }
     }
 }
index d79c17a9e9af2f1e70de4726723e6c4bca0548df..0557883267e56497f28304e3b66813576d185eff 100644 (file)
@@ -47,8 +47,12 @@ Accidental_interface::after_line_breaking (SCM smob)
   Grob *me = unsmob_grob (smob);
   Grob *tie = unsmob_grob (me->get_object ("tie"));
 
-  if (tie && !tie->original ())
-    me->suicide ();
+  if (tie && !tie->original ()
+      && !to_boolean (me->get_property ("forced")))
+    {
+      me->suicide ();
+    }
   return SCM_UNSPECIFIED;
 }
 
@@ -256,6 +260,7 @@ ADD_INTERFACE (Accidental_interface, "accidental-interface",
               "avoid-slur "
               "cautionary "
               "cautionary-style "
+              "forced "
               "style "
               "tie "
               );
index 2a85da80375a877b3d7fb4990c487cbc7b6fac4f..3400dc8e88114906df9b25bad99f13922f37a9b8 100644 (file)
@@ -17,7 +17,9 @@
 
 typedef enum Outlet_type
   {
-    CONTEXT_ONE, CONTEXT_TWO, CONTEXT_SHARED, CONTEXT_SOLO, CONTEXT_NULL, NUM_OUTLETS
+    CONTEXT_ONE, CONTEXT_TWO,
+    CONTEXT_SHARED, CONTEXT_SOLO,
+    CONTEXT_NULL, NUM_OUTLETS
   };
 
 static const char *outlet_names_[NUM_OUTLETS] = 
index ccc8642ff926a5e340417ee8b36a06d8387b338e..6fe9dea48d8fe200111b3dc6e001b8932150b59f 100644 (file)
@@ -202,6 +202,7 @@ include @code{medium}, @code{bold}, @code{bold-narrow}, etc.")
      (font-shape ,symbol? "Select the shape of a font. Choices include @code{upright},
 @code{italic}, @code{caps}.")
 
+     (forced ,boolean? "manually forced accidental")
      (forced-distance ,ly:dimension? "A fixed distance between object
 reference points in an alignment.")