From: David Kastrup <dak@gnu.org> Date: Wed, 26 Aug 2015 11:50:33 +0000 (+0200) Subject: Issue 4584: Add OneStaff context type X-Git-Tag: release/2.19.27-1~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=755a95aa391592ee1585189f7fa6b33e4f164610;p=lilypond.git Issue 4584: Add OneStaff context type --- diff --git a/input/regression/one-staff.ly b/input/regression/one-staff.ly new file mode 100644 index 0000000000..45ed449c2f --- /dev/null +++ b/input/regression/one-staff.ly @@ -0,0 +1,25 @@ +\version "2.19.26" + +\header { + texidoc = "@code{OneStaff} contexts can be used for letting several +contexts use the same vertical position. This example shows chords being +placed in a staff and immediately following it." +} + +\layout { + ragged-right = ##t +} + +\new OneStaff +{ + << % First element in <<>> so that it is not kept alive spuriously + \new Staff + { + c'4 d' e' f' + \chords \with { \override ChordName.Y-offset = -1 } + { d1:m7 b1:min7.5- } + } + >> + \chords \with { \override ChordName.Y-offset = -1 } + { d1:m7 b1:min7.5- } +} diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 1842de28a2..62559ca40f 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -150,6 +150,7 @@ \accepts "FiguredBass" \accepts "GrandStaff" \accepts "Lyrics" + \accepts "OneStaff" \accepts "PianoStaff" \accepts "RhythmicStaff" \accepts "Staff" @@ -385,6 +386,7 @@ together, never separately." \accepts "FretBoards" \accepts "GrandStaff" \accepts "Lyrics" + \accepts "OneStaff" \accepts "PianoStaff" \accepts "RhythmicStaff" \accepts "Staff" @@ -397,6 +399,35 @@ staves are connected vertically. @code{StaffGroup} only consists of a collection of staves, with a bracket in front and spanning bar lines." } +\context { + \type "Engraver_group" + \name "OneStaff" + \accepts "ChordNames" + \accepts "DrumStaff" + \accepts "Dynamics" + \accepts "FiguredBass" + \accepts "FretBoards" + \accepts "GregorianTranscriptionStaff" + \accepts "KievanStaff" + \accepts "Lyrics" + \accepts "MensuralStaff" + \accepts "NoteNames" + \accepts "PetrucciStaff" + \accepts "RhythmicStaff" + \accepts "Staff" + \accepts "TabStaff" + \accepts "VaticanaStaff" + \defaultchild "Staff" + \consists "Axis_group_engraver" + + \description "Provides a common axis for the contained staves, +making all of them appear in the same vertical space. This can be +useful for typesetting staves of different types in immediate succession +or for temporarily changing the character of one staff or overlaying +it with a different one. Often used with @code{\\stopStaff} and +@code{\\startStaff} for best results." +} + \context { \type "Engraver_group" \name "Dynamics" @@ -580,6 +611,7 @@ automatically when an output definition (a @code{\\score} or \accepts "Lyrics" \accepts "MensuralStaff" \accepts "NoteNames" + \accepts "OneStaff" \accepts "PetrucciStaff" \accepts "PianoStaff" \accepts "RhythmicStaff" diff --git a/ly/performer-init.ly b/ly/performer-init.ly index cccfc1d697..00c4bdf3da 100644 --- a/ly/performer-init.ly +++ b/ly/performer-init.ly @@ -247,6 +247,7 @@ \accepts MensuralStaff \accepts NoteNames \accepts NullVoice + \accepts OneStaff \accepts PetrucciStaff \accepts PianoStaff \accepts RhythmicStaff @@ -312,6 +313,7 @@ \accepts DrumStaff \accepts GrandStaff \accepts Lyrics + \accepts OneStaff \accepts PianoStaff \accepts RhythmicStaff \accepts Staff @@ -343,6 +345,7 @@ \accepts FretBoards \accepts GrandStaff \accepts Lyrics + \accepts OneStaff \accepts PianoStaff \accepts RhythmicStaff \accepts Staff @@ -351,6 +354,27 @@ \defaultchild Staff } +\context { + \type "Performer_group" + \name "OneStaff" + \accepts "ChordNames" + \accepts "DrumStaff" + \accepts "Dynamics" + \accepts "FiguredBass" + \accepts "FretBoards" + \accepts "GregorianTranscriptionStaff" + \accepts "KievanStaff" + \accepts "Lyrics" + \accepts "MensuralStaff" + \accepts "NoteNames" + \accepts "PetrucciStaff" + \accepts "RhythmicStaff" + \accepts "Staff" + \accepts "TabStaff" + \accepts "VaticanaStaff" + \defaultchild "Staff" +} + \context { \Staff \name RhythmicStaff