]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.1
authorfred <fred>
Fri, 4 Oct 1996 21:18:56 +0000 (21:18 +0000)
committerfred <fred>
Fri, 4 Oct 1996 21:18:56 +0000 (21:18 +0000)
item.cc [new file with mode: 0644]
item.hh [new file with mode: 0644]
line.hh [new file with mode: 0644]
proto.hh [new file with mode: 0644]
pstaff.cc [new file with mode: 0644]
pstaff.hh [new file with mode: 0644]

diff --git a/item.cc b/item.cc
new file mode 100644 (file)
index 0000000..5856156
--- /dev/null
+++ b/item.cc
@@ -0,0 +1,49 @@
+#include "line.hh"
+
+
+#include "cols.hh"
+String
+Spanner::TeXstring() const
+{
+    assert(right->line);
+    Real w = left->hpos - right->hpos;
+    return (*strets)(w);
+}
+
+Spanner *
+Spanner::broken_at(const PCol *c1, const PCol *c2) const
+{
+    Spanner *sp = new Spanner(*this);
+    sp->left = c1;
+    sp->right = c2;
+    return sp;
+}
+
+Spanner::Spanner()
+{
+    pstaff_=0;
+    strets=0;
+    left = right = 0;
+}
+
+/****************************************************************/
+String
+Item::TeXstring() const
+{
+    return output->TeXstring();
+}
+
+Interval
+Item::width() const
+{
+    return output->extent().x;
+}
+
+/****************************************************************/
+
+Item::Item()
+{
+    col = 0;
+    output = 0;
+    pstaff_ = 0;
+}
diff --git a/item.hh b/item.hh
new file mode 100644 (file)
index 0000000..15a8e88
--- /dev/null
+++ b/item.hh
@@ -0,0 +1,47 @@
+#ifndef ITEM_HH
+#define ITEM_HH
+
+#include "glob.hh"
+#include "boxes.hh"
+#include "string.hh"
+#include "tex.hh"
+
+/// a symbol which is attached between two columns.
+struct Spanner {
+    const PCol *left, *right;
+    Stretchable_symbol *strets;
+    PStaff * pstaff_;
+    ///      clone a piece of  this spanner.
+    Spanner *broken_at(const PCol *c1, const PCol *c2) const; 
+    /**
+    PRE
+    c1 >= start, c2  <= stop
+    */
+    String TeXstring () const ;
+    Spanner();
+};
+/** Spanner should know about the items which it should consider:
+    e.g. slurs should be steep enough to "enclose" all those items. This
+    is absolutely necessary for beams, since they have to adjust the
+    length of stems of notes they encompass.
+
+    */
+    
+/// a fixed size element of the score
+struct Item {
+    virtual Interval width() const;    
+
+    const PCol * col;
+    Output *output;
+    
+    PStaff *pstaff_;
+    /** needed for knowing at which staff to output this item
+    */
+    String TeXstring () const ;
+    Item();
+};
+/** An item must be part of a Column
+*/
+
+#endif
diff --git a/line.hh b/line.hh
new file mode 100644 (file)
index 0000000..cfa3b63
--- /dev/null
+++ b/line.hh
@@ -0,0 +1,52 @@
+#ifndef LINE_HH
+#define LINE_HH
+
+/*
+    horizontal structures for broken scores.
+*/
+
+#include "real.hh"
+#include "list.hh"
+#include "vray.hh"
+#include "glob.hh"
+#include "pstaff.hh"
+
+
+
+/// the columns of a score that form one line.
+struct
+Line_of_score {
+    List<const PCol *> cols;
+
+    // need to store height of each staff.
+    PointerList<Line_of_staff*> staffs;
+    const PScore * score;      // needed to generate staffs
+
+    /****************/
+    
+    Line_of_score(svec<const PCol *> sv, const PScore *);
+
+    String TeXstring() const;
+
+    // is #c# contained in #*this#?
+    bool element(const PCol *c);
+};
+
+/// one broken line of staff.
+struct Line_of_staff {
+    Real height;
+
+    /// y-pos of the baseline, measured from the top.
+    Real base;
+    
+    PointerList<Spanner *> brokenspans;    
+    Line_of_score const * scor;
+    const PStaff *pstaff_;
+
+    /****************/
+    
+    String TeXstring() const;
+    Line_of_staff(Line_of_score*, PStaff *);
+};
+
+#endif
diff --git a/proto.hh b/proto.hh
new file mode 100644 (file)
index 0000000..0721e19
--- /dev/null
+++ b/proto.hh
@@ -0,0 +1,76 @@
+#include "real.hh"
+
+class Vector;
+class Matrix;
+class Line_of_score;
+class Line_of_staff;
+class PCol;
+class PStaff;
+class Staff;
+class Staff_column;
+class Score;
+class Score_column;
+class Voice;
+class Voice_element;
+class Voicegroup;
+class Request;
+class Command;
+class Request;
+class Stem_req;
+class Span_req;
+class Slur_req;
+class Decresc_req;
+class Cresc_req;
+class Bracket_req;
+class Script_req;
+class Rest_req;
+class Note_req;
+class Lyric_req;
+class Chord;
+class Absdynamic_req;
+struct Offset;
+struct Interval;
+struct Box;
+struct PCol;
+struct Idealspacing;
+struct Spanner;
+struct Item;
+struct Line_of_staff;
+struct Colinfo;
+struct Linestaff;
+struct Atom;
+struct Molecule;
+struct PScore;
+struct Request;
+struct Note_req;
+struct Lyric_req;
+struct Script_req;
+struct Rest_req;
+struct Chord;
+struct Stem_req;
+struct Span_req;
+struct Beam_req;
+struct Bracket_req;
+struct Slur_req;
+struct Dynamic;
+struct Cresc_req;
+struct Decresc_req;
+struct Absdynamic_req;
+struct Score_column;
+struct Score;
+struct Staff_column;
+struct Staff;
+struct Command;
+struct Symbol;
+struct Stretchable_symbol;
+struct Output;
+struct Text_gob;
+struct Voice;
+struct Voicegroup;
+struct Voice_element;
+struct String;
+struct Tex_stream;
+struct Identifier;
+struct Keyword;
+class Mixed_qp;
+typedef  Mixed_qp Optimisation_problem;
diff --git a/pstaff.cc b/pstaff.cc
new file mode 100644 (file)
index 0000000..c922fe9
--- /dev/null
+++ b/pstaff.cc
@@ -0,0 +1,13 @@
+#include "pstaff.hh"
+
+PStaff::PStaff()
+{
+    stafsym = 0;
+}
+
+void
+PStaff::add(Item *i )
+{
+    its.bottom().add(i);
+    i->pstaff_ = this;
+}
diff --git a/pstaff.hh b/pstaff.hh
new file mode 100644 (file)
index 0000000..de535a6
--- /dev/null
+++ b/pstaff.hh
@@ -0,0 +1,19 @@
+#ifndef PSTAFF_HH
+#define PSTAFF_HH
+
+#include "list.hh"
+#include "item.hh"
+
+/// items grouped vertically.
+class PStaff {
+public:
+    Stretchable_symbol *stafsym;
+    List<const Spanner*> spans;
+    List<Item*> its;
+
+    void add(Item*i);
+    PStaff();
+    virtual ~PStaff() {}
+};
+
+#endif