]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.7
authorfred <fred>
Mon, 4 Nov 1996 21:21:01 +0000 (21:21 +0000)
committerfred <fred>
Mon, 4 Nov 1996 21:21:01 +0000 (21:21 +0000)
Sources.make
make_patch
stem.cc [new file with mode: 0644]

index deb1a524c45e2918d6d73925115ed9efc87bd58d..fcc62df96c5c4c0a8e3bf02d557dbf225091c110 100644 (file)
@@ -10,7 +10,7 @@ hdr=    qlp.hh linespace.hh qlpsolve.hh\
        misc.hh score.hh notename.hh lexer.hh symtable.hh\
        symbol.hh main.hh dimen.hh paper.hh lookupsyms.hh\
        sccol.hh stcol.hh scommands.hh melodicstaff.hh\
-       identifier.hh simplestaff.hh
+       identifier.hh simplestaff.hh spanner.hh stem.hh
 
 mycc=   qlp.cc qlpsolve.cc \
        break.cc linespace.cc molecule.cc line.cc\
@@ -19,9 +19,11 @@ mycc=   qlp.cc qlpsolve.cc \
        symbol.cc request.cc notename.cc  voice.cc\
        keyword.cc linestaff.cc table.cc command.cc\
        warn.cc debug.cc symtable.cc boxes.cc\
-       pstaff.cc  tstream.cc version.cc\
+       pstaff.cc  tstream.cc\
        calcideal.cc scores.cc identifier.cc \
        dimen.cc paper.cc lookupsyms.cc scommands.cc\
        sccol.cc stcol.cc getcommands.cc simplestaff.cc\
-       melodicstaff.cc simpleprint.cc\
-       template1.cc template2.cc template3.cc
+       melodicstaff.cc simpleprint.cc stem.cc\
+       spanner.cc\
+       template1.cc template2.cc template3.cc\
+       version.cc
\ No newline at end of file
index c2a1e50f8a44027f0132b9c36f6f5544ea911ed0..2e9246f4d759b7c3fd94647b288acd86d98b5c92 100755 (executable)
@@ -2,27 +2,30 @@
 old=$1
 new=$2
 nm=$3-
+
 newarc=$nm$new.tar.gz
 oldarc=$nm$old.tar.gz
-if [ ! -f $newarc ]
-then
-       echo cant find $newarc
-       exit
-fi
-if [ ! -f $oldarc ]
-then
-       echo cant find oldarc
-       exit
-fi
+
+
 if [ ! -x  $nm$new ]
 then
    echo untarring ..
   tar zfxv $nm$new.tar.gz
+  if [ ! -f $newarc ]
+  then
+       echo cant find $newarc
+       exit
+  fi
 fi
 if [ ! -x  $nm$old ]
 then
    echo untarring
    tar zfxv $nm$old.tar.gz
+  if [ ! -f $oldarc ]
+  then
+       echo cant find oldarc
+       exit
+  fi
 fi
 
 #(cd $nm$old; touch depend; make clean)
diff --git a/stem.cc b/stem.cc
new file mode 100644 (file)
index 0000000..33198ad
--- /dev/null
+++ b/stem.cc
@@ -0,0 +1,90 @@
+#include "stem.hh"
+#include "dimen.hh" 
+#include "debug.hh"
+#include "pstaff.hh"
+#include "pscore.hh"
+#include "paper.hh"
+#include "lookupsyms.hh"
+#include "molecule.hh"
+
+const int STEMLEN=7;
+
+Stem::Stem(int c)
+{
+    minnote = maxnote = 0;
+    bot = top = 0;
+    flag = 4;
+    staff_center=c;
+}
+
+void
+Stem::print()const
+{
+    mtor << "Stem minmax=["<< minnote<<","<<maxnote<<"], flag: "<<flag;
+    Item::print();
+}
+
+void
+Stem::calculate()
+{
+    assert(minnote<=maxnote);
+    int stafftop = 2*staff_center;
+
+    if (maxnote < -2){
+       bot = minnote;
+       top = staff_center - staff_center/2; // uhh... how about non 5-line staffs?
+       
+    }else if (minnote > stafftop + 2) {
+       top = maxnote;
+       bot = staff_center + staff_center/2;
+       flag = -flag;
+    }else {
+       Real mean = (minnote+maxnote)/2;
+       
+       top = (mean > staff_center) ? maxnote : maxnote+STEMLEN;
+       bot = (mean > staff_center) ? minnote-STEMLEN : minnote;
+       flag = (mean > staff_center) ? -flag : flag;
+    }
+}
+
+Interval
+Stem::width()const
+{
+    if (ABS(flag) <= 4)
+       return Interval(0,0);   // TODO!
+    Paperdef*p= pstaff_->pscore_->paper_;
+    return p->lookup_->flag(flag).dim.x;
+}
+
+void
+Stem::brew_molecole()
+{
+    assert(pstaff_);
+    Paperdef *p = pstaff_->pscore_->paper_;
+    Parametric_symbol *stem = p->lookup_->stem();
+
+    assert(bot!=top);
+    assert(!output);
+    
+    Real dy = p->interline()/2;
+    String y1 =print_dimen( dy * bot);
+    String y2 = print_dimen(dy * top);
+    Symbol ss =stem->eval(y1,y2);
+    output = new Molecule(Atom(ss));
+
+    if (ABS(flag) > 4){
+       Symbol fl = p->lookup_->flag(flag);
+       Molecule m(fl);
+       if (flag < -4){         
+           output->add_bot(m);
+       } else if (flag > 4) {
+           output->add_top(m);
+       } else
+           assert(false); 
+    }
+
+    if (flag > 0){     
+       Real dx = pstaff_->pscore_->paper_->note_width(); // ugh
+       output->translate(Offset(dx,0));
+    }
+}