]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.4
authorfred <fred>
Tue, 22 Oct 1996 20:32:26 +0000 (20:32 +0000)
committerfred <fred>
Tue, 22 Oct 1996 20:32:26 +0000 (20:32 +0000)
calcideal.cc
command.cc
rhythmstaf.hh
staff.cc
staff.hh
template2.cc
template3.cc

index b1410aefc013e9974f28b622c750e2d74c885098..bddd4f28970f7b76ac0deb5b8c8eebc2b0fba4c3 100644 (file)
@@ -2,7 +2,9 @@
 #include "score.hh"
 #include "pscore.hh"
 #include "staff.hh"
+#include "paper.hh"
 #include "misc.hh"
+#include "sccol.hh"
 #include "debug.hh"
 
 
@@ -48,7 +50,7 @@ Score::calc_idealspacing()
        if (sc->musical)
            for (int i=0; i < sc->durations.sz(); i++) {
                Mtime d = sc->durations[i];
-               Real dist = duration_to_idealspace(d);
+               Real dist = duration_to_idealspace(d, paper->whole_width);
                PCol * c2 = find_col(sc->when + d,true)->pcol;
                connect_nonmus(sc->pcol, c2, dist);
                c2 = find_col(sc->when + d,false)->pcol;
index ebf993d239e1a7eeba8a087f93633a25707d9097..6375c7e6d3101fe915d9baf93ff3b068ebef8403 100644 (file)
@@ -1,7 +1,12 @@
-
 #include "string.hh"
+#include "debug.hh"
 #include "command.hh"
 
+bool
+Command::isbreak()const
+{
+    return (code >= BREAK_PRE&&code <= BREAK_END);
+}
 
 Command*
 get_bar_command(Real w)
@@ -13,3 +18,40 @@ get_bar_command(Real w)
     c->args.add( "|");
     return c;
 }
+
+Command *
+get_meter_command(Real w, int n, int m)
+{
+    Command*c = new Command;
+    
+    c->when = w;
+    c->code = TYPESET;
+    c->args.add( "METER");
+    c->args.add( n );
+    c->args.add( m );
+    return c;
+}
+
+
+
+Command::Command()
+{
+    code = NOP;
+    when = -1;
+}
+
+
+
+Command::Command(Real w)
+{
+    code = NOP;
+    when = w;
+}
+void
+Command::print() const
+{
+    mtor << "command code: " << code << " args: ";
+    for (int i = 0; i<args.sz(); i++)
+       mtor << args[i];
+    mtor << "\n";
+}
index 1e56355cd709a8b21017c398016cf93aed896d54..8e362146e33d96ee5bf76c0840a7fe0a07f25962 100644 (file)
@@ -1,3 +1,13 @@
+/*
+  rhythmstaf.hh -- part of LilyPond
+
+  (c) 1996 Han-Wen Nienhuys
+*/
+
+#ifndef RHYTHMSTAF_HH
+#define RHYTHMSTAF_HH
+#include "stcol.hh"
+
 struct Rhythmic_staff;
 
 /// column of Rhythmic_staff
@@ -29,3 +39,7 @@ struct Rhythmic_staff : Staff {
     Staff_column * create_col(Score_column*);
 };
 
+
+#endif // RHYTHMSTAF_HH
+
+
index 12bf074d04bb837e762212dcc3b93cdd549ec572..0827c953f015cc38bec5910e35c2abf0ef22beca 100644 (file)
--- a/staff.cc
+++ b/staff.cc
@@ -1,6 +1,8 @@
 #include "staff.hh"
+#include "stcol.hh"
+#include "sccol.hh"
 #include "debug.hh"
-#include "pscore.hh"
+
 
 void
 Staff::clean_cols()
@@ -14,11 +16,6 @@ Staff::clean_cols()
     }
 }
 
-/*
-    maak een staff column, met specs in args.
-
-    (sorry wat is het vroeg vandaag..)
-    */
 Staff_column *
 Staff::get_col(Mtime w, bool mus)
 {
@@ -106,7 +103,7 @@ Staff::add_commands(PointerList<Command*> const &cl)
     }
 
     // now integrate break commands with other commands.
-    // may be do this in derived functions.
+    // maybe do this in derived functions.
 }
 
 void
@@ -146,39 +143,14 @@ Staff::last() const {
 void
 Staff::print() const
 {
+        #ifndef NPRINT
+
     mtor << "Staff {\n";
     for (PCursor<Voice*> vc(voices); vc.ok(); vc++) {
        vc->print();
        
     }
     mtor <<"}\n";
+    #endif
 }
 
-/****************************************************************/
-
-bool
-Staff_column::mus() const
-{
-    return score_column->musical;
-}
-
-Mtime
-Staff_column::when() const
-{
-    return score_column->when;
-}
-
-void
-Staff_column::add(Voice_element*ve)
-{
-    Mtime d= ve->duration;
-    if (d){
-       score_column->durations.add(d);
-    }
-       
-    v_elts.add(ve);
-}
-
-Staff_column::Staff_column(Score_column*s) {
-    score_column = s;
-}
index 49439f373bfafc8c1419a0c2c6126b29e6614254..cca8c35266412d745ca8397dc92c174bcbfdf507 100644 (file)
--- a/staff.hh
+++ b/staff.hh
@@ -5,25 +5,6 @@
 #include "voice.hh"
 #include "command.hh"
 
-struct Staff_column {
-    Score_column *score_column;
-
-    /// fields to collect data vertically.
-    svec<Voice_element *> v_elts;
-    svec<Command *> s_commands;
-    
-    Staff_column(Score_column*s); 
-    bool mus() const ;
-    Mtime when() const;
-    void add(Voice_element*ve);
-    /****************************************************************
-      VIRTUAL
-    ****************************************************************/
-    virtual void process_requests()=0;
-    virtual void process_commands()=0;
-    virtual ~Staff_column() { }
-};
-
 
 /// base class for a collection of voices.
 struct Staff {
index 40cd5b9fbe99c76f6e614c6735792ef9e36c0210..08f2eea88042750f42d848785bebd37fe899c219 100644 (file)
@@ -3,6 +3,8 @@
 #include "voice.hh"
 
 #include "staff.hh"
+#include "sccol.hh"
+#include "stcol.hh"
 
 #include "list.cc"
 #include "cursor.cc"
index b647f185983e6d9c599f5b9c835059325e268a58..6f2e92104c2fe4ae917eef30d87aafb36d681524 100644 (file)
@@ -3,7 +3,7 @@
 #include "molecule.hh"
 #include "list.cc"
 #include "cursor.cc"
-L_instantiate(Atom);
+PL_instantiate(Atom);
 PL_instantiate(Command);
 PL_instantiate(Request);