/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 2008--2010 Han-Wen Nienhuys <hanwen@lilypond.org>
+ Copyright (C) 2008--2011 Han-Wen Nienhuys <hanwen@lilypond.org>
LilyPond is free software: you can redistribute it and/or modify
DECLARE_TRANSLATOR_LISTENER (break_span);
DECLARE_ACKNOWLEDGER (note_column);
DECLARE_ACKNOWLEDGER (dynamic);
+ DECLARE_ACKNOWLEDGER (footnote_spanner);
DECLARE_END_ACKNOWLEDGER (dynamic);
protected:
ADD_ACKNOWLEDGER (Dynamic_align_engraver, dynamic);
ADD_ACKNOWLEDGER (Dynamic_align_engraver, note_column);
+ADD_ACKNOWLEDGER (Dynamic_align_engraver, footnote_spanner);
ADD_END_ACKNOWLEDGER (Dynamic_align_engraver, dynamic);
void
ended_.push_back (info.spanner ());
}
+void
+Dynamic_align_engraver::acknowledge_footnote_spanner (Grob_info info)
+{
+ Grob *parent = info.grob ()->get_parent (Y_AXIS);
+ if (line_ && parent
+ && parent->internal_has_interface (ly_symbol2scm ("dynamic-interface")))
+ Axis_group_interface::add_element (line_, info.grob ());
+}
+
void
Dynamic_align_engraver::acknowledge_note_column (Grob_info info)
{
Stream_event *cause = info.event_cause ();
create_line_spanner (cause);
if (Spanner::has_interface (info.grob ()))
- started_.push_back (info.spanner ());
+ {
+ started_.push_back (info.spanner ());
+ /*
+ If we are using text spans instead of hairpins and the line
+ is hidden, end the alignment spanner early: this allows dynamics
+ to be spaced individually instead of being linked together.
+ */
+ if (info.grob ()->internal_has_interface (ly_symbol2scm ("dynamic-text-spanner-interface"))
+ && (info.grob ()->get_property ("style") == ly_symbol2scm ("none")))
+ early_end_ = true;
+ }
else if (info.item ())
scripts_.push_back (info.item ());
else