-/*
- span-arpegio.hh -- declare Span_arpeggio
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#ifndef SPAN_ARPEGGIO_HH
-#define SPAN_ARPEGGIO_HH
-
-#include "lily-guile.hh"
-#include "lily-proto.hh"
-#include "interval.hh"
-
-class Span_arpeggio
-{
-public:
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM));
- static bool has_interface (Score_element*);
-};
-
-#endif /* SPAN_ARPEGGIO_HH */
-
/**
-
Make arpeggios that span multiple staffs. Catch arpeggios, and span a
Span_arpeggio over them if we find more than two arpeggios.
*/
void
Span_arpeggio_engraver::process_acknowledged ()
{
+ /*
+ connectArpeggios is slightly brusque; we should really read a elt
+ property of the caught non-span arpeggios. That way, we can have
+
+ both non-connected and connected arps in one pianostaff.
+
+
+ */
if (!span_arpeggio_ && arpeggios_.size () > 1
&& to_boolean (get_property ("connectArpeggios")))
{
- span_arpeggio_ = new Item (get_property ("SpanArpeggio"));
- span_arpeggio_->set_parent (arpeggios_[0], Y_AXIS);
- Side_position::set_axis (span_arpeggio_, X_AXIS);
- Pointer_group_interface pgi (span_arpeggio_, "arpeggios");
- for (int i = 0; i < arpeggios_.size () ; i++)
- {
- pgi.add_element (arpeggios_[i]);
- span_arpeggio_->add_dependency (arpeggios_[i]);
- }
-
- announce_element (span_arpeggio_, 0);
+ span_arpeggio_ = new Item (get_property ("Arpeggio"));
+ announce_element (span_arpeggio_, 0);
}
}
{
if (span_arpeggio_)
{
+ /*
+ we do this very late, to make sure we also catch `extra'
+ side-pos support like accidentals.
+ */
+ for (int i=0; i < arpeggios_.size (); i ++)
+ {
+ for (SCM s = arpeggios_[i]->get_elt_property ("stems");
+ gh_pair_p (s); s = gh_cdr (s))
+ Group_interface::add_thing (span_arpeggio_, "stems", gh_car (s));
+ for (SCM s = arpeggios_[i]->get_elt_property ("side-support-elements");
+ gh_pair_p (s); s = gh_cdr (s))
+ Group_interface::add_thing (span_arpeggio_, "side-support-elements", gh_car (s));
+
+ /*
+ we can't kill the children, since we don't want to the
+ previous note to bump into the span arpeggio; so we make
+ it transparent. */
+ arpeggios_[i]->set_elt_property ("molecule-callback", SCM_BOOL_T);
+ }
+
typeset_element (span_arpeggio_);
span_arpeggio_ = 0;
}
-/*
- span-arpeggio.cc -- implement Span_arpeggio
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2000 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-#include "axis-group-interface.hh"
-#include "molecule.hh"
-#include "paper-def.hh"
-#include "lookup.hh"
-#include "arpeggio.hh"
-#include "span-arpeggio.hh"
-#include "score-element.hh"
-#include "stem.hh"
-#include "staff-symbol-referencer.hh"
-
-bool
-Span_arpeggio::has_interface (Score_element* me)
-{
- return me && me->has_interface (ly_symbol2scm ("span-arpeggio-interface"));
-}
-
-/*
- We could collapse this with Arpeggio::brew_molecule, but that requires
- hairy scm callback hacking.
- */
-MAKE_SCHEME_CALLBACK (Span_arpeggio, brew_molecule, 1);
-SCM
-Span_arpeggio::brew_molecule (SCM smob)
-{
- Score_element *me = unsmob_element (smob);
-
- Interval iv;
- Score_element *common = me;
- for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
- {
- Score_element *arpeggio = unsmob_element (gh_car (s));
- common = arpeggio->common_refpoint (common, Y_AXIS);
- }
- // Hmm, nothing in common?
- if (0) //common)
- for (SCM s = me->get_elt_property ("arpeggios"); gh_pair_p (s); s = gh_cdr (s))
- {
- Score_element *arpeggio = unsmob_element (gh_car (s));
- Real c = common->relative_coordinate (arpeggio, Y_AXIS);
- //iv.unite (Arpeggio::head_positions (stem));
- iv.unite (Interval (c, c));
- }
- else
- iv = Interval (-23, 5);
-
- Molecule mol;
- Molecule arpeggio = me->paper_l ()->lookup_l (0)->afm_find ("scripts-arpeggio");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
- for (int i = (int)iv[MIN]/ 2; i < (int)(iv[MAX] - 1)/ 2; i++)
- {
- Molecule a (arpeggio);
- a.translate_axis (i * staff_space, Y_AXIS);
- mol.add_molecule (a);
- }
- mol.translate (Offset (-2 * staff_space, 0));
-
- return mol.create_scheme ();
-}
-
\consists "Rest_collision_engraver";
\consists "Local_key_engraver";
\consists "Piano_pedal_engraver";
- \consists "Arpeggio_engraver";
\consistsend "Axis_group_engraver";
Generic_property_list = #generic-voice-properties
\consists "Output_property_engraver";
+ \consists "Arpeggio_engraver";
\consists "Dynamic_engraver"; % must come before text_engraver.
+ \consists "Text_spanner_engraver";
\consists "Property_engraver";
\consists "Breathing_sign_engraver";
% staffspace (distances)
%
Arpeggio = #`(
- (interfaces . (arpeggio-interface))
+ (interfaces . (arpeggio-interface side-position-interface))
+ (X-extent-callback . ,Arpeggio::width_callback)
(molecule-callback . ,Arpeggio::brew_molecule)
- (name . "arpeggio")
+ (Y-offset-callbacks . (,Staff_symbol_referencer::callback))
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
+ (staff-position . 0.0)
+ (name . "Arpeggio")
)
BarLine = #`(
(interfaces . (bar-interface staff-bar-interface))
Accidentals = #`(
(molecule-callback . ,Local_key_item::brew_molecule)
+ (X-offset-callbacks . (,Side_position::aligned_side))
+ (direction . -1)
(left-padding . 0.2)
(right-padding . 0.4)
(interfaces . (accidentals-interface))
(self-alignment-X . 0)
(text . "8")
(visibility-lambda . ,begin-of-line-visible)
- (X-offset-callbacks .
- (,Side_position::centered_on_parent
- ,Side_position::aligned_on_self
- ,Side_position::aligned_side
- ))
+ (X-offset-callbacks . (,Side_position::centered_on_parent ,Side_position::aligned_on_self))
+ (Y-offset-callbacks . (,Side_position::aligned_side))
(molecule-callback . ,Text_item::brew_molecule)
(style . "italic")
(name . "OctavateEight")
(maximum-duration-for-spacing . ,(make-moment 1 8))
(name . "SpacingSpanner")
)
- SpanArpeggio = #`(
- (interfaces . (span-arpeggio-interface))
- (molecule-callback . ,Span_arpeggio::brew_molecule)
- (name . "SpanArpeggio")
- )
SpanBar = #`(
(interfaces . (bar-interface span-bar-interface))
(break-align-symbol . Staff_bar)
(molecule-callback . ,Text_item::brew_molecule)
(no-spacing-rods . #t)
(interfaces . (text-script-interface text-item-interface side-position-interface))
- (padding . 3.0)
+ (padding . 0.5)
(name . "TextScript")
)
-
+ TextSpanner = #`(
+ (interfaces . (text-spanner-interface))
+ (molecule-callback . ,Text_spanner::brew_molecule)
+ (type . "line")
+ (direction . 1)
+ (text-style . "italic")
+ (name . "TextSpanner")
+ )
Tie = #`(
(interfaces . (tie-interface))
(molecule-callback . ,Tie::brew_molecule)
(name . "SustainPedal")
)
-
UnaChordaPdeal = #`(
(molecule-callback . ,Text_item::brew_molecule)
(style . "italic")