From: fred Date: Sun, 24 Mar 2002 19:32:24 +0000 (+0000) Subject: lilypond-0.0.32 X-Git-Tag: release/1.5.59~5352 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b47842f43549f21c41a76a47bfec34635ddbcf1c;p=lilypond.git lilypond-0.0.32 --- diff --git a/input/cadenza.ly b/input/cadenza.ly index 3f32d19de3..6773143fea 100644 --- a/input/cadenza.ly +++ b/input/cadenza.ly @@ -7,53 +7,50 @@ cad = music { $ \duration { 8} \textstyle "italic" - \command { \clef \violin } + \clef \violin 'c4._"f" g8 \textstyle "roman" ['e^"accel" ()'d 'c b] [b()'c] g-\fermata - \command { \bar \empty } + \bar \empty c [c_"rubato" e g 'c] \octave{'} e4. e [g ()f_"rit" e d] \duration{16} dis4()e4 - \command { \bar \empty } + \bar \empty r8 [c d] [e f g gis] \duration{4} a-> `f()`e g f-> `d()`cis e \duration{8} d4^\fermata - \command { \bar \empty } + \bar \empty r8 `a [`b cis] \duration{16} [d cis d e] f4()[f e d c] `b4 - \octave{} \plet{2/3} ['d8 'c8 a8] - \plet{1/1} + \octave{} \plet{2/3} ['d8 'c8 a8] \plet{1/1} g2 - \command { \bar \empty } + \bar \empty [g c e g] ['c e g 'c]\octave{'} [e `g c e] g4^\fermata %()% BUG! - \command { \bar \empty } + \bar \empty [g8.(_"a tempo" e g8. )e] a4. g8 [f8 e8 d8 c8] `g2 d2^"tr" c4 $} - score { +score { staff { melodic music { cad } - } commands { - meter 4*4 - cadenza 1 - grouping 1*4 + cadenza $1$ + grouping{1*4} } } diff --git a/src/barreg.cc b/src/barreg.cc new file mode 100644 index 0000000000..03b49497b7 --- /dev/null +++ b/src/barreg.cc @@ -0,0 +1,83 @@ +/* + barreg.cc -- implement Bar_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "barreg.hh" +#include "bar.hh" +#include "commandrequest.hh" +#include "complexwalker.hh" +#include "complexcolumn.hh" +#include "sccol.hh" + + +Bar_register::Bar_register(Complex_walker*w) + : Request_register(w) +{ + do_post_move_process(); +} + +bool +Bar_register::try_request(Request*r_l) +{ + if (!r_l->nonmus()->bar()) + return false; + + assert(!bar_req_l_); + bar_req_l_ = r_l->nonmus()->bar(); + + return true; +} + +void +Bar_register::process_request() +{ + + if (bar_req_l_ ) { + bar_p_ = new Bar(bar_req_l_->type); + } else if (!walk_l_->time_.whole_in_measure_) { + bar_p_ = new Bar("|"); + } + + if (bar_p_){ + walk_l_->allow_break(); + announce_element(Staff_elem_info(bar_p_, bar_req_l_, this) ); + } +} + +void +Bar_register::split_bar(Bar *& pre, Bar * no, Bar * &post) +{ + String s= no->type; + if (s == ":|:") { + pre = new Bar(":|"); + post = new Bar("|:"); + }else if (s=="|:") { + post = new Bar(s); + } else { + pre = new Bar(*no); + } +} + +void +Bar_register::do_pre_move_process() +{ + if (bar_p_) { + Bar * post_p =0; + Bar * pre_p =0; + split_bar(pre_p, bar_p_, post_p); + + typeset_breakable_item(pre_p, bar_p_, post_p); + bar_p_ =0; + } +} + +void +Bar_register::do_post_move_process() +{ + bar_req_l_ = 0; + bar_p_ =0; +}