]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.20
authorfred <fred>
Sun, 24 Mar 2002 19:26:58 +0000 (19:26 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:26:58 +0000 (19:26 +0000)
Sources.make
hdr/spanner.hh
src/beam.cc
src/slur.cc
src/spanner.cc

index 53977c778b5f0974791a512f9a00d6e47e87d6fb..a04e3dd03c858316b908a46df354e83225a04329 100644 (file)
@@ -9,20 +9,22 @@ hdr=    qlp.hh linespace.hh qlpsolve.hh\
        parseconstruct.hh debug.hh globvars.hh keyword.hh\
        misc.hh score.hh notename.hh lexer.hh symtable.hh\
        symbol.hh main.hh dimen.hh paper.hh lookup.hh\
+       spanner.hh  beam.hh directionalspanner.hh slur.hh textspanner.hh\
        sccol.hh stcol.hh staffcommands.hh melodicstaff.hh\
-       identifier.hh simplestaff.hh spanner.hh stem.hh\
-       notehead.hh leastsquares.hh beam.hh rest.hh\
+       identifier.hh simplestaff.hh  stem.hh\
+       notehead.hh leastsquares.hh  rest.hh\
        swalker.hh bar.hh meter.hh accidental.hh\
        key.hh keyitem.hh localkeyitem.hh simplewalker.hh\
-       clef.hh clefitem.hh slur.hh inputcommands.hh\
-       getcommand.hh inputmusic.hh \
+       clef.hh clefitem.hh  inputcommands.hh\
+       getcommand.hh inputmusic.hh timedescription.hh\
        inputscore.hh inputstaff.hh identparent.hh\
-       inputcommand.hh grouping.hh moment.hh
+       inputcommand.hh grouping.hh moment.hh offset.hh
+
 
 mycc=   qlp.cc qlpsolve.cc leastsquares.cc\
        inputcommands.cc inputmusic.cc  \
-       inputscore.cc inputstaff.cc\
-       moment.cc\
+       inputscore.cc inputstaff.cc inputcommand.cc\
+       timedescription.cc\
        break.cc linespace.cc molecule.cc staffline.cc\
        pscore.cc tex.cc item.cc pcol.cc staff.cc \
        rhythmstaff.cc  score.cc note.cc  main.cc misc.cc\
@@ -34,15 +36,16 @@ mycc=   qlp.cc qlpsolve.cc leastsquares.cc\
        dimen.cc paper.cc lookup.cc staffcommands.cc\
        sccol.cc stcol.cc getcommands.cc simplestaff.cc\
        melodicstaff.cc simpleprint.cc\
-       spanner.cc \
+       spanner.cc textspanner.cc directionalspanner.cc \
        notehead.cc  stem.cc \
        rest.cc bar.cc meter.cc keyitem.cc localkeyitem.cc clefitem.cc\
        swalker.cc scoreline.cc\
        simplewalker.cc\
        texbeam.cc texslur.cc clef.cc key.cc slur.cc beam.cc\
-       idealspacing.cc inputcommand.cc grouping.cc identifier.cc\
+       idealspacing.cc  grouping.cc identifier.cc\
        lexerinit.cc mylexer.cc\
        template1.cc template2.cc template3.cc template4.cc\
+       template5.cc\
        version.cc
 
 
index cfaca3dec95263d4a575e404c27be9e1ebe8fa04..86d63527ae962d50ee4535af507715bbded3e545 100644 (file)
@@ -6,7 +6,9 @@
 
 #ifndef SPANNER_HH
 #define SPANNER_HH
+
 #include "proto.hh"
+#include "interval.hh"
 
 /// a symbol which is attached between two columns.
 struct Spanner {
@@ -18,14 +20,19 @@ struct Spanner {
 
     String TeXstring () const ;
     Spanner();
-    Paperdef*paper() const;
+    Paperdef *paper() const;
     virtual ~Spanner();
     virtual Interval height()const=0;
     /**
       PRE:
       processed
       */
-    virtual Interval width()const;
+  /// do calcs
+    virtual void calculate();
+    /**
+      It is safe to call calculate multiple times on one object
+      */
+   virtual Interval width()const;
     virtual void process();
     virtual void preprocess();
 
index 9cb43f57313e0d4f83a7896e2a164e2ba04f2f91..85d5cc4812d58dab92f001d9e83976f1d9360754 100644 (file)
@@ -27,13 +27,23 @@ Stem_info::Stem_info(const Stem*s)
 {
     x = s->hpos();
     int dir = s->dir;
-    idealy  = MAX(dir*s->top, dir*s->bot);
-    miny = MAX(dir*s->minnote, dir*s-> maxnote);
+    idealy  = max(dir*s->top, dir*s->bot);
+    miny = max(dir*s->minnote, dir*s-> maxnote);
     assert(miny <= idealy);
     no_beams = s->flag;
 }
 
 /****************/
+Offset
+Beam::center()const
+{
+    if(!dir)
+        ((Beam*)this)->calculate();
+    Real w=width().length()/2;
+    return Offset(w,
+                  (left_pos + w* slope)*paper()->interline());
+}
+
 
 Beam::Beam()
 {
@@ -143,7 +153,7 @@ Beam::set_grouping(Rhythmic_grouping def, Rhythmic_grouping cur)
        PCursor<Stem*> s(stems);
        svec<int> flags;
        for (; s.ok(); s++) {
-           int f = intlog2(ABS(s->flag))-2;
+           int f = intlog2(abs(s->flag))-2;
            assert(f>0);
            flags.add(f);
        }
index f795dc82847a037200f1e30ddbea44528f1a89f7..b16aae1f0a0adf0d728b7b1113735332ed4a2f4a 100644 (file)
@@ -7,6 +7,24 @@
 #include "molecule.hh"
 #include "debug.hh"
 #include "boxes.hh"
+void
+Slur::calculate()
+{
+    set_default_dir();
+}
+
+Offset
+Slur::center() const
+{
+        int pos1 = encompass.last()->position;
+    int pos2 = encompass[0]->position;
+
+    int dy =  pos1-pos2;
+
+    Real w = width().length();
+
+    return Offset(w/2,dy * paper()->internote());
+}
 
 void
 Slur::add(Notehead*n)
index a550227ea6958541863d796c26926156f986e3f3..9a8c1dc36fb4b243f74108b0de2e192d91a9429e 100644 (file)
@@ -5,7 +5,10 @@
 #include "symbol.hh"
 #include "molecule.hh"
 #include "pcol.hh"
-
+void
+Spanner::calculate()
+{
+}
 String
 Spanner::TeXstring() const
 {