+1.3.18.jcn3
+===========
+
+* Moved decision for stacking staff spanners {[ from item-creation phase
+to post_processing (only then we know dimensions/visibility of items)
+
+* Separted bar-break-glyph-alist, see input/test/no-span.ly
+
1.3.18.jcn2
===========
MAJOR_VERSION=1
MINOR_VERSION=3
PATCH_LEVEL=18
-MY_PATCH_LEVEL=jcn2
+MY_PATCH_LEVEL=jcn3
# use the above to send patches: MY_PATCH_LEVEL is always empty for a
# released version.
-\header {
- filename = "pa.ly";
- title = "Wachet auf, ruft uns die Stimme";
- opus = "BWV";
- composer = "Johann Sebastian Bach 1685-1750 ";
- enteredby = "JCN";
- copyright = "public domain";
-}
-
-%% ?
+%% why non of this any effect?
#(define Span_bar_engraver-visibility #f)
#(define Staff_group_bar_engraver-visibility #f)
#(define Span_score_bar_engraver-visability #f)
+#(assoc-set! bar-break-glyph-alist "bracket" '(nil . nil))
-% these should be two separate scores...
\score{
\context Score <
\context StaffGroup<
>
\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";
+% this doesn't work
+ barType = #"|"
}
\translator {
\PianoStaffContext
SCM default_type = get_property ("defaultBarType", 0);
if (gh_string_p (default_type))
{
- bar_p_->set_elt_property ("glyph", default_type); // gu.h
+ bar_p_->set_elt_property ("default-glyph", default_type); // gu.h
}
#if 0
return;
}
- String current = ly_scm2string (bar_p_->get_elt_property ("glyph"));
+ String current = ly_scm2string (bar_p_->get_elt_property ("default-glyph"));
if ((requested_type == "|:" && current== ":|")
|| (requested_type == ":|" && current == "|:"))
requested_type = ":|:";
- bar_p_->set_elt_property ("glyph",
+ bar_p_->set_elt_property ("default-glyph",
ly_str02scm (requested_type.ch_C ()));
}
if (which.length_i ())
{
create_bar();
- bar_p_->set_elt_property ("glyph", ly_str02scm (which.ch_C ()));
+ bar_p_->set_elt_property ("default-glyph", ly_str02scm (which.ch_C ()));
}
if (!bar_p_)
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
+ bar_l_arr_[0]->get_elt_property ("default-glyph"));
}
}
}
*/
class Base_span_bar_engraver : public Engraver
{
- Span_bar * spanbar_p_;
Array<Bar*> bar_l_arr_;
public:
horizontal alignment priority, otherwise, hang the spanbar on the
acknowledged bar. */
bool use_priority_b_;
+ Span_bar * spanbar_p_;
virtual void acknowledge_element (Score_element_info);
virtual void do_pre_move_processing();
VIRTUAL_COPY_CONS (Translator);
virtual Span_bar * get_span_bar_p () const;
+ virtual void acknowledge_element (Score_element_info);
};
/**
Interval i(get_spanned_interval ());
translate_axis (i.center (), Y_AXIS);
+
+ /*
+ {[ stacking shift
+ ugh
+ */
+ SCM me = get_elt_property ("glyph");
+ if (gh_string_p (me) && ly_scm2string (me) == "bracket")
+ {
+ SCM e = get_elt_property ("other");
+ if (e != SCM_UNDEFINED)
+ {
+ assert (SMOB_IS_TYPE_B (Score_element, e));
+ Score_element* se = SMOB_TO_TYPE (Score_element, e);
+ SCM her = se->get_elt_property ("glyph");
+#if 0
+ // urg x-extent broken?
+ if (gh_string_p (her) && ly_scm2string (her) == "brace")
+ se->translate_axis (-extent (X_AXIS).length (), X_AXIS);
+#else
+ if (gh_string_p (her) && ly_scm2string (her) == "brace"
+ && !to_boolean (get_elt_property ("transparent")))
+ se->translate_axis (-paper_l ()->get_var ("interline"), X_AXIS);
+#endif
+ }
+ }
}
void
return s;
}
+void
+Piano_bar_engraver::acknowledge_element (Score_element_info i)
+{
+ Base_span_bar_engraver::acknowledge_element (i);
+
+ if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
+ {
+ SCM g = b->get_elt_property ("default-glyph");
+ if (gh_string_p (g) && (ly_scm2string (g) == "bracket"))
+ spanbar_p_->set_elt_property ("other", b->self_scm_);
+ }
+}
+
Span_bar*
Staff_group_bar_engraver::get_span_bar_p () const
{
Staff_group_bar_engraver::acknowledge_element (Score_element_info i)
{
Base_span_bar_engraver::acknowledge_element (i);
+
+ if (!spanbar_p_)
+ return;
+
if (Span_bar * b = dynamic_cast<Span_bar *> (i.elem_l_))
{
- SCM gl = b->get_elt_property ("glyph");
- if (gh_string_p (gl) && ly_scm2string (gl) == "brace")
- b->translate_axis ( -paper_l ()->get_var ("interline"),
- X_AXIS); // ugh
+ SCM g = b->get_elt_property ("default-glyph");
+ if (gh_string_p (g) && (ly_scm2string (g) == "brace"))
+ spanbar_p_->set_elt_property ("other", b->self_scm_);
}
}
-% these should be two separate scores...
\score{
\context Score <
\context StaffGroup<
>
\paper {
- %textheight = 280.0 \mm;
- % landscape:
- textheight = 160.0 \mm;
- linewidth = 290.0 \mm;
-%{
+ textheight = 280.0 \mm;
+ % landscape: -- does not work? ly2dvi -L
+ %textheight = 160.0 \mm;
+ %linewidth = 290.0 \mm;
\translator {
\OrchestralScoreContext
minVerticalAlign = 4.0*\staffheight;
maxVerticalAlign = 4.0*\staffheight;
}
-%}
\translator {
- \StaffGroupContext
- minVerticalAlign = 4.0*\staffheight;
- maxVerticalAlign = 4.0*\staffheight;
- }
- \translator {
\PianoStaffContext
- minVerticalAlign = 2.5*\staffheight;
- maxVerticalAlign = 2.5*\staffheight;
+ minVerticalAlign = 2.5*\staffheight;
+ maxVerticalAlign = 2.5*\staffheight;
}
}
\midi {
(define generic-bar-properties
(cons "Staff_bar" (list
(list 'barSize number? 'bar-size)
- ;(list 'glyph symbol? 'glyph)
+ (list 'barType symbol? 'glyph)
+ )
+ )
+ )
+
+(define generic-span-bar-properties
+ (cons "Span_bar" (list
+ (list 'barSize number? 'bar-size)
+ (list 'barType symbol? 'glyph)
)
)
)
;
; How should a bar line behave at a break?
;
-(define (break-barline glyph dir)
- (let ((result (assoc glyph
- '((":|:" . (":|" . "|:"))
- ("|" . ("|" . ""))
- ("|s" . (nil . "|"))
- ("|:" . ("|" . "|:"))
- ("|." . ("|." . nil))
- (":|" . (":|" . nil))
- ("||" . ("||" . nil))
- (".|." . (".|." . nil))
- ("scorebar" . (nil . "scorepostbreak"))
- ("brace" . (nil . "brace"))
- ("bracket" . (nil . "bracket"))
- )
- )))
+; move this to paper.scm?
+; to override, see input/test/no-span.ly
+(define bar-break-glyph-alist
+ '((":|:" . (":|" . "|:"))
+ ("|" . ("|" . ""))
+ ("|s" . (nil . "|"))
+ ("|:" . ("|" . "|:"))
+ ("|." . ("|." . nil))
+ (":|" . (":|" . nil))
+ ("||" . ("||" . nil))
+ (".|." . (".|." . nil))
+ ("scorebar" . (nil . "scorepostbreak"))
+ ("brace" . (nil . "brace"))
+ ("bracket" . (nil . "bracket"))
+ ))
+
+(define (break-barline glyph dir)
+ (let ((result (assoc glyph bar-break-glyph-alist)))
(if (equal? result #f)
(ly-warn (string-append "Unknown bar glyph: `" glyph "'"))
(index-cell (cdr result) dir))