]> git.donarmstrong.com Git - lilypond.git/blobdiff - src/melodicstaff.cc
release: 0.0.26
[lilypond.git] / src / melodicstaff.cc
index 17916d2f228df22d559a269c731d5d806ce67bfb..849a64b2094bbaa43441f0fdd4dcd4990afb3716 100644 (file)
@@ -1,59 +1,65 @@
 #include "melodicstaff.hh"
+#include "keyitem.hh"
 #include "stem.hh"
 #include "rest.hh"
 #include "notehead.hh"
 #include "paper.hh"
 #include "molecule.hh"
-#include "linestaff.hh"
-#include "rhythmstaff.hh"
+#include "linepstaff.hh"
+//#include "rhythmstaff.hh"
 #include "sccol.hh" 
+#include "localkeyitem.hh"
+#include "request.hh"
 
 const int NO_LINES=5;
-const int BOTTOM_POSITION=2;   // e is on bottom line of 5-staff...
+
 
 void
 Melodic_staff::set_output(PScore*ps)
 {
-    theline = new Linestaff(NO_LINES,ps);
+    theline_l_ = new Linestaff(NO_LINES,ps); // theline_l_ is added to pscore later.
     Simple_staff::set_output(ps);
 }
 
 
 Notehead*
-Melodic_staff::get_notehead(Note_req *rq)
+Melodic_staff::get_notehead(Note_req *rq, int bottom)
 {        
-    int b  = rq->rhythmic()->balltype;
-    int d  = rq->rhythmic()->dots;
-    
     Notehead *n =new Notehead((NO_LINES-1)*2);
-    n->balltype =b;
-    n->dots = d;
-    n->position = rq->note()->height() - BOTTOM_POSITION;
+    n->set_rhythmic(rq->rhythmic());
+    n->position = rq->note()->height() + bottom;
     return n;
 }
 
+Item *
+Melodic_staff::get_TYPESET_item(Command*com)
+{
+    if (com->args[0] == "KEY") {
+       return new Keyitem(NO_LINES);   // urgh. depends on clef.
+    } else
+       return Simple_staff::get_TYPESET_item(com);
+}
 
 Stem *
 Melodic_staff::get_stem(Stem_req*rq)
 {
     Stem * s = new Stem(NO_LINES-1);
-    s->flag = rq->stem_number;
+    s->flag = rq->balltype;
     return s;
 }
 
-/*
-  creation
-  */
-Staff *
-get_new_melodicstaff()
+Rest*
+Melodic_staff::get_rest(Rest_req*rq)
 {
-    return new Melodic_staff;
+    Rest*r = Simple_staff::get_rest(rq);
+    if (rq->balltype <= 2)
+       r->translate(Offset(0, NO_LINES * paper()->internote()));
+    return r;
 }
 
-
-
-Melodic_staff*
-Melodic_staff::clone()const
+Local_key_item*
+Melodic_staff::get_local_key_item()
 {
-    return new Melodic_staff(*this);
+    return new Local_key_item(-2);
 }
+