From 9181e0a843165e1e6afd0a61b3d9710d518e0089 Mon Sep 17 00:00:00 2001 From: fred Date: Fri, 4 Oct 1996 21:12:14 +0000 Subject: [PATCH] lilypond-0.0.1 --- item.cc | 49 ++++++++++++++++++++++++++++++++++++++++ item.hh | 47 +++++++++++++++++++++++++++++++++++++++ line.hh | 52 +++++++++++++++++++++++++++++++++++++++++++ proto.hh | 76 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ pstaff.cc | 13 +++++++++++ pstaff.hh | 19 ++++++++++++++++ 6 files changed, 256 insertions(+) create mode 100644 item.cc create mode 100644 item.hh create mode 100644 line.hh create mode 100644 proto.hh create mode 100644 pstaff.cc create mode 100644 pstaff.hh diff --git a/item.cc b/item.cc new file mode 100644 index 0000000000..5856156a66 --- /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 index 0000000000..15a8e88724 --- /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 index 0000000000..cfa3b631a4 --- /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 cols; + + // need to store height of each staff. + PointerList staffs; + const PScore * score; // needed to generate staffs + + /****************/ + + Line_of_score(svec 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 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 index 0000000000..0721e19fd4 --- /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 index 0000000000..c922fe9996 --- /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 index 0000000000..de535a6518 --- /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 spans; + List its; + + void add(Item*i); + PStaff(); + virtual ~PStaff() {} +}; + +#endif -- 2.11.4.GIT