From: fred Date: Sun, 24 Mar 2002 19:34:15 +0000 (+0000) Subject: lilypond-0.0.38 X-Git-Tag: release/1.5.59~5247 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b44afbbdb892e318268d03a69df3d5dd52b36670;p=lilypond.git lilypond-0.0.38 --- diff --git a/TODO b/TODO index a00bad0be1..e9824ff756 100644 --- a/TODO +++ b/TODO @@ -2,23 +2,25 @@ before 0.1 * remove spurious/outdated comments in .ly - * more control in Register_groups - * pushgroup, popgroup. * basic dynamics - * basic syntax + * basic syntax & parser/lexer cleanup. * decent TeX page layout * clean split for m2m of sources. + * caching of Register_group_register hierarchies. + This is an assorted collection of stuff that will be done, might be done, or is an idea that I want to think about BUGS + * plet bugs: scales.ly + * key at clef change. * key undo @@ -57,6 +59,8 @@ SMALLISH PROJECTS * parshape + * a pure parser. + * bar numbers/repetition marks * read from mmap directly: study yy_scan_buffer @@ -135,6 +139,8 @@ IDEAS * create libmudela, or liblily_frontend + * Horizontal_align_item, Vertical_align_item. + * move MIDI io to a ANSI C libmidi library. * fold indentifiers and notenames? diff --git a/input/scales.ly b/input/scales.ly index d98c1bba43..11568c9ea6 100644 --- a/input/scales.ly +++ b/input/scales.ly @@ -4,15 +4,15 @@ staff {melodic music{ $ \duration { 8 } \octave{ } - |[ a a a a a a a a a ] + |[ a a a a a a a a a ]8/9 \octave{ ' } - |[ a a a a a a a a a ] + |[ a a a a a a a a a ]8/9 \octave { ` } - [ `c `g d a 'e 'b ''f '''c '''g ] - [ '''g '''c ''f 'b 'e a d `g `c ] + [ `c `g d a 'e 'b ''f '''c '''g ] 8/9 + [ '''g '''c ''f 'b 'e a d `g `c ] 8/9 \octave{ ' } - [ `c `g d a 'e 'b ''f '''c '''g ] - [ '''g '''c ''f 'b 'e a d `g `c ] + [ `c `g d a 'e 'b ''f '''c '''g ] 8/9 + [ '''g '''c ''f 'b 'e a d `g `c ] 8/9 \octave { } [ c g 'd ]2/3 [ 'd g c ]2/3 @@ -54,7 +54,7 @@ score { } commands { meter {6*8} - skip 36*8 + skip {36*8} meter {4*4} } } diff --git a/src/clef-reg.cc b/src/clef-reg.cc new file mode 100644 index 0000000000..2d9dcc112b --- /dev/null +++ b/src/clef-reg.cc @@ -0,0 +1,107 @@ +/* + clef.cc -- implement Clef_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys , + Mats Bengtsson +*/ + +#include "clef-reg.hh" +#include "clef-item.hh" +#include "debug.hh" +#include "commandrequest.hh" +#include "time-description.hh" +#include "staff-column.hh" + +Clef_register::Clef_register() +{ + clef_p_ = 0; + + /* ugly hack to prevent segfault (daddy_reg_l_ == 0 at construction) */ + clef_type_str_ = ""; +} + +bool +Clef_register::set_type(String s) +{ + clef_type_str_ = s; + if (clef_type_str_ == "violin") { + c0_position_i_= -2; + } else if (clef_type_str_ == "alto") { + c0_position_i_= 4; + } else if (clef_type_str_ == "tenor") { + c0_position_i_= 6; + } else if (clef_type_str_ == "bass") { + c0_position_i_= 10; + }else + return false; + *get_staff_info().c0_position_i_ = c0_position_i_; + + return true; +} + +void +Clef_register::read_req(Clef_change_req*c_l) +{ + if (!set_type(c_l->clef_str_)) + error("unknown clef type ", c_l->defined_ch_c_l_); +} + +bool +Clef_register::try_request(Request * r_l) +{ + Command_req* creq_l= r_l->command(); + if (!creq_l || !creq_l->clefchange()) + return false; + + clef_req_l_ = creq_l->clefchange(); + + // do it now! Others have to read c0_pos. + read_req(creq_l->clefchange()); + return true; +} + +void +Clef_register::process_requests() +{ + const Time_description *time_l = get_staff_info().time_c_l_; + if (!clef_req_l_ && (!time_l->whole_in_measure_|| !time_l->when_)) { + clef_p_ = new Clef_item; + clef_p_->change = false; + } else if (clef_req_l_) { + clef_p_ = new Clef_item; + clef_p_->change = true; + } + if (clef_p_) { + clef_p_->read(*this); + announce_element(Staff_elem_info(clef_p_, + clef_req_l_)); + } +} + +void +Clef_register::pre_move_processing() +{ + if (!clef_p_) + return; + if (clef_p_->change) { + Clef_item* post_p = new Clef_item(*clef_p_); + post_p->change = false; + typeset_breakable_item(new Clef_item(*clef_p_), + clef_p_, post_p); + } else { + typeset_breakable_item(0, 0, clef_p_); + } + clef_p_ = 0; +} + +void +Clef_register::post_move_processing() +{ + clef_req_l_ = 0; + /* not in ctor, since the reg might not be linked in.*/ + if (clef_type_str_ == "") { + set_type("violin"); + } +} diff --git a/src/voiceelt.cc b/src/voiceelt.cc index 670dcdfaaa..501ffbc89b 100644 --- a/src/voiceelt.cc +++ b/src/voiceelt.cc @@ -8,6 +8,7 @@ #include "debug.hh" #include "voice.hh" +#include "voice-element.hh" #include "musicalrequest.hh" #include "commandrequest.hh" @@ -59,8 +60,6 @@ Voice_element::find_plet_start_bo(char c, Moment& moment_r) assert( c == ']' ); moment_r += duration; for ( PCursor req_l_pcur( reqs.top() ); req_l_pcur.ok(); req_l_pcur++ ) { - if (req_l_pcur->melodic()) - mtor << (char)('c' + req_l_pcur->melodic()->height()) << "\n"; if (req_l_pcur->beam() && req_l_pcur->beam()->spantype == Span_req::START ) return true; } @@ -79,7 +78,8 @@ Voice_element::set_default_group(String s) } void -Voice_element::set_plet_backwards(Moment& now_moment_r, Moment until_moment, int num_i, int den_i) +Voice_element::set_plet_backwards(Moment& now_moment_r, + Moment until_moment, int num_i, int den_i) { now_moment_r += duration; if ( now_moment_r > until_moment ) @@ -91,7 +91,5 @@ Voice_element::set_plet_backwards(Moment& now_moment_r, Moment until_moment, int req_l_pcur->rhythmic()->plet_factor = Moment(num_i, den_i); if (req_l_pcur->stem()) req_l_pcur->stem()->plet_factor = Moment(num_i, den_i); - if (req_l_pcur->melodic()) - mtor << (char)('c' + req_l_pcur->melodic()->height()) << "\n"; } }