From 45355174e981d977aa0b073e6316e4833b2e57c7 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 28 Dec 1999 16:16:40 +0100 Subject: [PATCH] patch::: 1.3.18.jcn2 1.3.18.jcn2 =========== * try at getting glyph property from mudela --- CHANGES | 5 +++ VERSION | 2 +- input/test/no-span.ly | 56 +++++++++++++++++++++++++++++++++ lily/bar.cc | 7 +++++ lily/base-span-bar-engraver.cc | 18 ++++++++++- lily/include/bar.hh | 1 + lily/span-score-bar-engraver.cc | 7 ++--- scm/generic-property.scm | 4 ++- 8 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 input/test/no-span.ly diff --git a/CHANGES b/CHANGES index 5936819e7c..12163a631b 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +1.3.18.jcn2 +=========== + +* try at getting glyph property from mudela + 1.3.18.jcn1 =========== diff --git a/VERSION b/VERSION index 9df66aa37d..2a45430e42 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=18 -MY_PATCH_LEVEL=jcn1 +MY_PATCH_LEVEL=jcn2 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/input/test/no-span.ly b/input/test/no-span.ly new file mode 100644 index 0000000000..e027434bb6 --- /dev/null +++ b/input/test/no-span.ly @@ -0,0 +1,56 @@ +\header { + filename = "pa.ly"; + title = "Wachet auf, ruft uns die Stimme"; + opus = "BWV"; + composer = "Johann Sebastian Bach 1685-1750 "; + enteredby = "JCN"; + copyright = "public domain"; +} + +%% ? +#(define Span_bar_engraver-visibility #f) +#(define Staff_group_bar_engraver-visibility #f) +#(define Span_score_bar_engraver-visability #f) + + +% these should be two separate scores... +\score{ + \context Score < + \context StaffGroup< + \context PianoStaff < + \context Staff = treble { + \property Score.midiInstrument = "church organ" + < + \context Voice=i \notes\relative c { c c c c } + > + } + \context Staff = bass \notes\relative c { c c c c } + > + \context Staff = pedal \notes\relative c { c c c c } + > + > +\paper { + textheight = 280.0 \mm; +%{ + \translator { + \OrchestralScoreContext + minVerticalAlign = 4.0*\staffheight; + maxVerticalAlign = 4.0*\staffheight; + } +%} + \translator { + \StaffGroupContext + minVerticalAlign = 4.0*\staffheight; + maxVerticalAlign = 4.0*\staffheight; + glyph = "brace"; + } + \translator { + \PianoStaffContext + minVerticalAlign = 2.5*\staffheight; + maxVerticalAlign = 2.5*\staffheight; + } + } + \midi { + \tempo 4 = 69; + } +} diff --git a/lily/bar.cc b/lily/bar.cc index 1fea0a1b3e..c3dc7684b8 100644 --- a/lily/bar.cc +++ b/lily/bar.cc @@ -44,7 +44,14 @@ Bar::do_brew_molecule_p () const void Bar::do_pre_processing () { + SCM def = remove_elt_property ("default-glyph"); SCM g = get_elt_property ("glyph"); + if (!gh_string_p (g) && gh_string_p (def)) + { + set_elt_property ("glyph", def); + g = get_elt_property ("glyph"); + } + SCM breakdir = gh_int2scm (break_status_dir ()); if (gh_string_p (g)) diff --git a/lily/base-span-bar-engraver.cc b/lily/base-span-bar-engraver.cc index 880d458988..9ef6b8fc1a 100644 --- a/lily/base-span-bar-engraver.cc +++ b/lily/base-span-bar-engraver.cc @@ -51,7 +51,7 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) --hwn */ { - spanbar_p_ = get_span_bar_p(); + spanbar_p_ = get_span_bar_p (); spanbar_p_->set_parent (bar_l_arr_[0], Y_AXIS); String visnam = String(name()) + "-visibility"; @@ -68,9 +68,25 @@ Base_span_bar_engraver::acknowledge_element (Score_element_info i) } announce_element (Score_element_info (spanbar_p_,0)); + +#if 0 + + // urg, elt-properties are not set until pre_processing (property-engraver) + if (!gh_string_p (spanbar_p_->get_elt_property ("glyph")) + && !gh_string_p (spanbar_p_->get_elt_property ("default-glyph"))) + spanbar_p_-> set_elt_property ("default-glyph", + bar_l_arr_[0]->get_elt_property ("glyph")); +#else + + if (!gh_string_p (spanbar_p_->get_elt_property ("glyph")) + && gh_string_p (spanbar_p_->get_elt_property ("default-glyph"))) + spanbar_p_-> set_elt_property ("glyph", spanbar_p_->get_elt_property ("default-glyph")); + if (!gh_string_p (spanbar_p_->get_elt_property ("glyph"))) spanbar_p_-> set_elt_property ("glyph", bar_l_arr_[0]->get_elt_property ("glyph")); + +#endif } } } diff --git a/lily/include/bar.hh b/lily/include/bar.hh index e884883fa7..a517fc4cdc 100644 --- a/lily/include/bar.hh +++ b/lily/include/bar.hh @@ -15,6 +15,7 @@ class Bar:public Item { public: VIRTUAL_COPY_CONS(Score_element); Bar(); + protected: virtual void do_pre_processing (); virtual Molecule* do_brew_molecule_p () const; diff --git a/lily/span-score-bar-engraver.cc b/lily/span-score-bar-engraver.cc index f2409d3391..cda87205a0 100644 --- a/lily/span-score-bar-engraver.cc +++ b/lily/span-score-bar-engraver.cc @@ -20,13 +20,12 @@ Span_bar* Span_score_bar_engraver::get_span_bar_p () const { Span_bar*s = new Span_bar; - s->set_elt_property ("glyph", gh_str02scm ("scorebar")); + s->set_elt_property ("default-glyph", gh_str02scm ("scorebar")); s->set_elt_property ("break-aligned",SCM_BOOL_T); return s; } - Span_score_bar_engraver::Span_score_bar_engraver () { use_priority_b_ = true; @@ -37,7 +36,7 @@ Piano_bar_engraver::get_span_bar_p () const { Span_bar *s= new Span_bar; s->set_empty (X_AXIS); - s->set_elt_property ("glyph", gh_str02scm ("brace")); + s->set_elt_property ("default-glyph", gh_str02scm ("brace")); return s; } @@ -46,7 +45,7 @@ Staff_group_bar_engraver::get_span_bar_p () const { Span_bar *s= new Span_bar; s->set_empty (X_AXIS); - s->set_elt_property ("glyph", gh_str02scm ("bracket")); + s->set_elt_property ("default-glyph", gh_str02scm ("bracket")); return s; } diff --git a/scm/generic-property.scm b/scm/generic-property.scm index 5c33765f14..498f05bc4a 100644 --- a/scm/generic-property.scm +++ b/scm/generic-property.scm @@ -61,7 +61,9 @@ (define generic-bar-properties (cons "Staff_bar" (list - (list 'barSize number? 'bar-size)) + (list 'barSize number? 'bar-size) + ;(list 'glyph symbol? 'glyph) + ) ) ) -- 2.39.5