]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.32
authorfred <fred>
Sun, 24 Mar 2002 19:32:24 +0000 (19:32 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:32:24 +0000 (19:32 +0000)
input/cadenza.ly
src/barreg.cc [new file with mode: 0644]

index 3f32d19de38c6b0c2308805b082f797c726586cb..6773143fea3eef97ab42958ab2280318dd53c67a 100644 (file)
@@ -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 (file)
index 0000000..03b4949
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+  barreg.cc -- implement Bar_register
+
+  source file of the LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+#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;
+}