lilypond-devel
[Top][All Lists]
Advanced

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

Re: PATCH: Allow setting of arpeggio type for spanned arpeggios


From: Chris Snyder
Subject: Re: PATCH: Allow setting of arpeggio type for spanned arpeggios
Date: Sat, 20 Dec 2008 15:16:57 -0500
User-agent: Thunderbird 2.0.0.18 (X11/20081125)

Han-Wen Nienhuys wrote:
You should use get_property("stencil") unless you're doing something
special.  Still better is to use a callback in the spanner which
copies the stencil from its children.

I originally tried get_property, but the result was that the spanned arpeggio copied the exact stencil from the child arpeggio, resulting in only part of the spanned arpeggio being drawn. It appears to me that get_property causes the stencil callback to be executed (using the data from the child arpeggio), while get_property_data got a reference the callback, allowing it to be run later. I looked for documentation or mailing list posts to figure out what was going on, but couldn't find anything that explained to me the difference between the two functions. Looking at the code in grob-property.cc, it appears to me that my analysis is correct, but I wouldn't be surprised if I'm oversimplifying things or just plain wrong.

The second option you gave does not appear to me to be possible without changing the way that spanned arpeggios are constructed. Unless I'm mistaken, spanned arpeggios are not aware of their children - the Span_arpeggio_engraver steals the stems and side-support-elements from the children and feeds them to the spanned arpeggio. It seems to me that the strategy I implemented (stealing the stencil property from a child and feeding it to the spanned arpeggio) fits this pattern.

I did realize that the ly_symbol2scm call was not needed. I've attached a new patch that does not include it.

Thanks.

-Chris
>From 327618ff4ee5e1e275dfb461aa325510e3f21c97 Mon Sep 17 00:00:00 2001
From: Chris Snyder <address@hidden>
Date: Sat, 20 Dec 2008 15:14:44 -0500
Subject: [PATCH] Altered spanned arpeggios to inherit the stencil property of 
an included arpeggio
 (it isn't very smart - it just gets the property from the first arpeggio it 
finds)

---
 lily/span-arpeggio-engraver.cc |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lily/span-arpeggio-engraver.cc b/lily/span-arpeggio-engraver.cc
index 07958a8..9b5f0d6 100644
--- a/lily/span-arpeggio-engraver.cc
+++ b/lily/span-arpeggio-engraver.cc
@@ -61,6 +61,7 @@ Span_arpeggio_engraver::process_acknowledged ()
     {
       span_arpeggio_ = make_item ("Arpeggio", SCM_EOL);
       span_arpeggio_->set_property ("cross-staff", SCM_BOOL_T);
+      span_arpeggio_->set_property ("stencil", 
arpeggios_[0]->get_property_data ("stencil"));
     }
 }
 
-- 
1.5.6.3


reply via email to

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