From 9a38b47c4a4589f2e7c413fcdfff83de454719e6 Mon Sep 17 00:00:00 2001 From: Rune Zedeler Date: Wed, 31 Jul 2002 06:42:48 +0000 Subject: [PATCH] 2002-07-31 Rune Zedeler * ly/engraver-init.ly: remove alias "Current" from all contexts. * lily/translator-group (find_existing_translator): If n=="Current", return this context. * lily/rest.cc: * lily/time-signature.cc: spacing for even number of staff lines. --- ChangeLog | 13 +++++++++++++ lily/rest.cc | 15 ++++++++++++--- lily/time-signature.cc | 14 ++++++++++---- lily/translator-group.cc | 2 +- ly/engraver-init.ly | 17 ----------------- 5 files changed, 36 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index d22ce13402..bae70b349a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2002-07-31 Rune Zedeler + + * ly/engraver-init.ly: remove alias "Current" from all contexts. + + * lily/translator-group (find_existing_translator): If + n=="Current", return this context. + + * lily/rest.cc: + * lily/time-signature.cc: spacing for even number of staff lines. + 2002-07-31 Han-Wen * input/bugs/: remove various files. @@ -14,6 +24,9 @@ * ly/property-init.ly: Use "Current" context in the accidental macros. TODO: Do the same in some of the other macros? + * scm/output-lib.scm (tablature-stem-attachment-function): add + duration argument. Now the function can be called again :-) + 2002-07-30 Han-Wen * lily/parse-scm.cc (parse_handler): add better error message, diff --git a/lily/rest.cc b/lily/rest.cc index 7375e107f5..9cdd9078c7 100644 --- a/lily/rest.cc +++ b/lily/rest.cc @@ -21,9 +21,18 @@ Rest::after_line_breaking (SCM smob) { Grob *me = unsmob_grob (smob); int bt = gh_scm2int (me->get_grob_property ("duration-log")); - if (bt == 0 && Staff_symbol_referencer::line_count (me) > 1) + int lc = Staff_symbol_referencer::line_count (me); + Real ss = Staff_symbol_referencer::staff_space (me); + if(lc % 2) { - me->translate_axis (Staff_symbol_referencer::staff_space (me) , Y_AXIS); + if (bt == 0 && lc > 1) + { + me->translate_axis (ss , Y_AXIS); + } + } + else + { + me->translate_axis (ss/2 , Y_AXIS); } Grob * d = unsmob_grob (me->get_grob_property ("dot")); @@ -93,7 +102,7 @@ Rest::brew_internal_molecule (SCM smob) Molecule res = Font_interface::get_default_font (me)->find_by_name (idx); if(res.empty_b() && style!="") style=""; - else + else return res.smobbed_copy(); } } diff --git a/lily/time-signature.cc b/lily/time-signature.cc index ef04a4f336..d3f496b611 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -14,6 +14,7 @@ #include "paper-def.hh" #include "font-interface.hh" #include "warn.hh" +#include "staff-symbol-referencer.hh" MAKE_SCHEME_CALLBACK (Time_signature,brew_molecule,1); /* @@ -33,21 +34,26 @@ Time_signature::brew_molecule (SCM smob) d = gh_scm2int (ly_cdr (frac)); } - + Molecule m; if (gh_symbol_p (st)) { String style (ly_scm2string (scm_symbol_to_string (st))); if (style[0]=='1') { - return time_signature (me, n, 0).smobbed_copy (); + m = time_signature (me, n, 0); } else { - return special_time_signature (me, style, n, d).smobbed_copy (); + m = special_time_signature (me, style, n, d); } } else - return time_signature (me, n,d).smobbed_copy (); + m = time_signature (me, n,d); + + if (Staff_symbol_referencer::line_count (me) % 2 == 0) + m.translate_axis (Staff_symbol_referencer::staff_space (me)/2 , Y_AXIS); + + return m.smobbed_copy (); } Molecule diff --git a/lily/translator-group.cc b/lily/translator-group.cc index 8a1e58d746..629d75c6f8 100644 --- a/lily/translator-group.cc +++ b/lily/translator-group.cc @@ -106,7 +106,7 @@ Translator_group::removable_b () const Translator_group * Translator_group::find_existing_translator (String n, String id) { - if (is_alias_b (n) && (id_string_ == id || id.empty_b ())) + if ((is_alias_b (n) && (id_string_ == id || id.empty_b ())) || n == "Current") return this; Translator_group* r = 0; diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 3cee9a56eb..6ef0c1e539 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -34,7 +34,6 @@ StaffContext=\translator { \consists "Forbid_line_break_engraver" \consistsend "Axis_group_engraver" - minimumVerticalExtent = #'(-6 . 6) extraVerticalExtent = ##f verticalExtent = ##f @@ -48,7 +47,6 @@ StaffContext=\translator { instr = ##f \accepts "Voice" - \alias "Current" } @@ -62,7 +60,6 @@ StaffContainerContext = \translator { \accepts Staff \name StaffContainer - \alias "Current" } InnerChoirStaffContext = \translator { @@ -79,7 +76,6 @@ InnerChoirStaffContext = \translator { \accepts "PianoStaff" \accepts "Lyrics" \accepts "ChordNames" - \alias "Current" } ChoirStaffContext = \translator { \InnerChoirStaffContext @@ -121,7 +117,6 @@ RhythmicStaffContext=\translator{ \consists "Instrument_name_engraver" \consistsend "Axis_group_engraver" \accepts "Voice" - \alias "Current" } @@ -172,7 +167,6 @@ VoiceContext = \translator { \consists "Skip_req_swallow_translator" \accepts Thread % bug if you leave out this! - \alias "Current" } ThreadContext = \translator{ @@ -187,7 +181,6 @@ ThreadContext = \translator{ \consists "Note_head_line_engraver" \consists "Output_property_engraver" - \alias "Current" } @@ -202,7 +195,6 @@ GrandStaffContext=\translator{ systemStartDelimiter = #'SystemStartBrace \accepts "Staff" - \alias "Current" } PianoStaffContext = \translator{ @@ -241,7 +233,6 @@ InnerStaffGroupContext= \translator { \accepts "TabStaff" \accepts "Lyrics" \accepts "ChordNames" - \alias "Current" } StaffGroupContext = \translator { \InnerStaffGroupContext @@ -269,7 +260,6 @@ LyricsVoiceContext= \translator{ \consists "Skip_req_swallow_translator" phrasingPunctuation = #".,:!?\"" - \alias "Current" } NoteNamesContext = \translator { \type "Engraver_group_engraver" @@ -283,7 +273,6 @@ NoteNamesContext = \translator { \consists "Note_name_engraver" \consists "Separating_line_group_engraver" - \alias "Current" } LyricsContext = \translator { @@ -298,7 +287,6 @@ LyricsContext = \translator { verticalExtent = ##f \accepts "LyricsVoice" - \alias "Current" } @@ -317,7 +305,6 @@ ChordNamesContext = \translator { minimumVerticalExtent = ##f extraVerticalExtent = ##f verticalExtent = ##f - \alias "Current" } @@ -326,7 +313,6 @@ StupidScore = \translator { \type "Score_engraver" \name Score \consists "Note_heads_engraver" - \alias "Current" } @@ -445,7 +431,6 @@ ScoreContext = \translator { barCheckSynchronize = ##t \grobdescriptions #all-grob-descriptions - \alias "Current" } OrchestralScoreContext= \translator { @@ -459,7 +444,6 @@ EasyNotation = \translator { % retain for compatibility reasons (FIXME: convert-ly) GraceContext = \translator { \type "Engraver_group_engraver" - \alias "Current" } FiguredBassContext = \translator { @@ -467,7 +451,6 @@ FiguredBassContext = \translator { \name FiguredBass \consists "Figured_bass_engraver" \consistsend "Axis_group_engraver" - \alias "Current" } -- 2.39.2