]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.8
authorfred <fred>
Tue, 5 Nov 1996 17:39:44 +0000 (17:39 +0000)
committerfred <fred>
Tue, 5 Nov 1996 17:39:44 +0000 (17:39 +0000)
notehead.cc [new file with mode: 0644]
tstream.cc

diff --git a/notehead.cc b/notehead.cc
new file mode 100644 (file)
index 0000000..fe026b1
--- /dev/null
@@ -0,0 +1,67 @@
+#include "notehead.hh"
+#include "dimen.hh" 
+#include "debug.hh"
+#include "pstaff.hh"
+#include "pscore.hh"
+#include "paper.hh"
+#include "lookupsyms.hh"
+#include "molecule.hh"
+
+
+Notehead::Notehead(int ss)
+{
+    staff_size=ss;
+    position = 0;
+    balltype = 0;
+    dots = 0;
+}
+
+void
+Notehead::print()const
+{
+    mtor << "Head "<<balltype<<", position = "<< position << "dots " << dots;
+    Item::print();
+}
+
+void
+Notehead::preprocess()
+{
+    brew_molecole();
+}
+
+void
+Notehead::brew_molecole()
+{
+    assert(pstaff_);
+    assert(!output);
+
+    Paperdef *p = pstaff_->pscore_->paper_;
+
+    Real dy = p->interline()/2;
+    Symbol s = p->lookup_->ball(balltype);
+    
+    output = new Molecule(Atom(s));
+    if (dots) {
+       Symbol d = p->lookup_->dots(dots);
+       Molecule dm;
+       dm.add(Atom(d));
+       if (!(position %2))
+           dm.translate(Offset(0,dy));
+       output->add_right(dm);
+    }
+    bool streepjes = (position<-1)||(position > staff_size+1);
+    if (streepjes) {
+       int dir = sgn(position);
+       int s =(position<-1) ? -((-position)/2): (position-staff_size)/2;
+       Symbol str = p->lookup_->streepjes(s);
+       Molecule sm;
+       sm.add(Atom(str));
+       if (position % 2)
+           sm.translate(Offset(0,-dy* dir));
+       output->add(sm);            
+    }
+    
+
+    output->translate(Offset(0,dy*position));
+}
+
index b7c88f1b0bc7a379d6c1c1be9e3bf84e512da2b3..05e2e9c93e5839c24aed96aa2d221ff26abad767 100644 (file)
@@ -32,7 +32,8 @@ Tex_stream::~Tex_stream()
 // print string. don't forget indent.
 Tex_stream &
 Tex_stream::operator<<(String s)
-{       
+{
+    
     for (const char *cp = s; *cp; cp++) {
        if (outputting_comment) {
            *os << *cp;
@@ -56,7 +57,7 @@ Tex_stream::operator<<(String s)
                nest_level--;           
                *os << *cp;
                assert (nest_level >= 0);
-               /* FALTHROUGH */
+               /* FALTHROUGH */
                
            case '\n':
                *os << "%\n";