From: fred Date: Tue, 26 Mar 2002 22:00:08 +0000 (+0000) Subject: lilypond-1.1.28 X-Git-Tag: release/1.5.59~2334 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=5dfb19930d417d4e6994d985ece7cd4584c12c21;p=lilypond.git lilypond-1.1.28 --- diff --git a/input/test/chord-preserve.ly b/input/test/chord-preserve.ly deleted file mode 100644 index b7e3998134..0000000000 --- a/input/test/chord-preserve.ly +++ /dev/null @@ -1,27 +0,0 @@ -koorden = \chords{ - c1-2/d c-2.3/d -} - - -\score{ - < - \property Score.chordInversion = "1" - \type ChordNames { - \property Score.chordInversionPreserve = "0" - \koorden - \property Score.chordInversionPreserve = "1" - \koorden - } - \type Staff \notes\transpose c''{ - \property Score.chordInversionPreserve = "0" - \koorden - % preserving doesn't work for staff yet - % see lily/chord.cc - \property Score.chordInversionPreserve = "1" - \koorden - } - > - \paper{ - linewidth = -1.; - } -} diff --git a/lily/grouping.cc b/lily/grouping.cc deleted file mode 100644 index af7d234bf4..0000000000 --- a/lily/grouping.cc +++ /dev/null @@ -1,383 +0,0 @@ -/* - grouping.cc -- implement Rhythmic_grouping - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - -#include "debug.hh" -#include "grouping.hh" -#include "interval.hh" - -void -Rhythmic_grouping::init() -{ - interval_ = 0; - children.clear(); -} - -void -Rhythmic_grouping::OK() const -{ -#ifndef NDEBUG - assert (bool (children.size()) != bool (interval_)); - - for (int i= 0; i < children.size(); i++) - { - children[i]->OK(); - if (i>0) - assert (children[i-1]->interval().right == - children[i]->interval().left); - } -#endif -} - -Moment -Rhythmic_grouping::length() const -{ - return interval().length (); -} - -MInterval -Rhythmic_grouping::interval() const -{ - if (interval_) - return *interval_; - else - return - MInterval (children[0]->interval().left, - children.top()->interval ().right); -} - -void -Rhythmic_grouping::split (Rhythmic_grouping r) -{ - if (interval_) - return ; - - r.intersect (interval()); - split (r.intervals()); - - for (int i= 0; i < children.size(); i++) - { - if (!children[i]->interval_) - { - Rhythmic_grouping here (r); - children[i]->split (here); - } - } -} - - -Array -Rhythmic_grouping::intervals() -{ - Array r; - if (interval_ || children.size() == 1) - { - MInterval i (interval()); - MInterval r1(i), r2(i); - r1.right = r2.left = i.center(); - r.push (r1); r.push (r2); - } - else - { - for (int i=0; i < children.size(); i++) - r.push (children[i]->interval()); - } - return r; -} - -void -Rhythmic_grouping::intersect (MInterval t) -{ - if (interval_) - { - interval_->intersect (t); - return; - } - - for (int i=0; i < children.size(); i++) - { - MInterval inter = intersection (t, children[i]->interval()); - if (inter.empty_b() || inter.length () <= Rational (0)) - { - delete children[i]; - children[i] =0; - } - else - { - children[i]->intersect (t); - } - } - for (int i=0; i < children.size();) - { - if (!children[i]) - children.del (i); - else - i++; - } - -} - -/** - Put our children in branches of #this#. - The min and max time intervals coincide with elements of #splitpoints# - - I really should be documenting what is happening here, but I find - that difficult, since I don't really understand what's going on here. - - */ -void -Rhythmic_grouping::split (Array splitpoints) -{ - //check on splitpoints.. - int j = 0, i = 0, starti = 0, startj = 0; - - Array ch; - while (1) - { - if (i >= children.size() || j >= splitpoints.size ()) - break; - - assert ( - children[starti]->interval().left== splitpoints[startj].left); - if (children[i]->interval().right < splitpoints[j].right) - { - i ++; - } - else if (children[i]->interval().right > splitpoints[j].right) - { - j ++; - } - else - { - - if (i == starti) - { - ch.push (children[i]); - } - else - { - Rhythmic_grouping *newchild=new Rhythmic_grouping ( - children.slice (starti, i+1)); - - ch.push (newchild); - } - i ++; - j++; - starti = i; - startj = j; - - - } - } - if (ch.size() != 1) - children = ch; -} - - -Rhythmic_grouping::Rhythmic_grouping (MInterval t, int n) -{ - init(); - if (n == 1 || !n) - { - interval_ = new MInterval (t); - return; - } - Moment dt = t.length()/Rational (n); - MInterval basic = MInterval (t.left, t.left+dt); - for (int i= 0; i < n; i++) - children.push (new Rhythmic_grouping (dt*Rational (i) + basic)); -} - - -Rhythmic_grouping::Rhythmic_grouping (Array r) - :children (r) -{ - interval_ =0; -} - -Rhythmic_grouping::~Rhythmic_grouping() -{ - junk(); -} - -void -Rhythmic_grouping::copy (Rhythmic_grouping const&s) -{ - interval_ = (s.interval_)? new MInterval (*s.interval_) : 0; - for (int i=0; i < s.children.size(); i++) - children.push (new Rhythmic_grouping (*s.children[i])); -} - -void -Rhythmic_grouping::operator=(Rhythmic_grouping const &s) -{ - junk(); - copy (s); -} - -Rhythmic_grouping::Rhythmic_grouping (Rhythmic_grouping const&s) -{ - init(); - copy (s); -} - -void -Rhythmic_grouping::junk() -{ - delete interval_; - for (int i=0; i < children.size(); i++) - delete children[i]; - init(); -} - -void -Rhythmic_grouping::print() const -{ -#ifndef NPRINT - DOUT << "{ \n"; - if (interval_) - DOUT <<" Interval "<< interval_->str(); - for (int i=0; i < children.size(); i++) - { - children[i]->print(); - } - DOUT << "}\n"; -#endif -} - -bool -Rhythmic_grouping::child_fit_b (Moment start) -{ - if (children.size()) - return (children.top()->interval ().right== start); - - return true; -} - -void -Rhythmic_grouping::add_child (Moment start, Moment len) -{ - Moment stop = start+len; - assert (child_fit_b (start)); - children.push (new Rhythmic_grouping (MInterval (start, stop))); -} - -Rhythmic_grouping::Rhythmic_grouping() -{ - interval_ =0; -} - -int -min_elt (Array v) -{ - int i = 1000; // ugh - for (int j = 0 ; j < v.size(); j++) - i = i -Rhythmic_grouping::generate_beams (Array flags, int &flagidx) -{ - assert (!interval_) ; - - Array< Array > children_beams; - for (int i=0; i < children.size(); i++) - { - Array child_beams; - if (children[i]->interval_) - { - int f = flags[flagidx++]; - child_beams.push (f); - } - else - { - child_beams = children[i]-> - generate_beams (flags, flagidx); - } - children_beams.push (child_beams); - } - Array beams; - int lastm, m, nextm; - for (int i=0; i < children_beams.size(); i++) - { - bool add_left = (i >0); - bool add_right = (i < children_beams.size() -1); - - if (!i) - m = min_elt (children_beams[i]); - if (add_right) - nextm = min_elt (children_beams[i+1]); - - if (children_beams[i].size() == 1) - { - if (add_right) - beams.push (m); - if (add_left) - beams.push (m); - } - else - { - if (add_left) - beams.push (lastm translate (m); -} - -void -Rhythmic_grouping::extend (MInterval m) const -{ - assert (m.left >= interval().left); - while (m.right >interval().right) - { - Array a (children); - for (int i=0; i < a.size(); i++) - { - a[i] =new Rhythmic_grouping (*children[i]); - a[i]->translate (children.top()->interval ().right); - } - ((Rhythmic_grouping*)this)->children.concat (a); - } - assert (m.right <= interval().right); - OK(); -} - -Rhythmic_grouping -parse_grouping (Array beat_i_arr, Array elt_length_arr) -{ - Moment here =0; - assert (beat_i_arr.size() == elt_length_arr.size ()); - - Array children; - for (int i=0; i < beat_i_arr.size(); i++) - { - Moment last = here; - here += elt_length_arr[i] * Moment (beat_i_arr[i]); - children.push ( - new Rhythmic_grouping (MInterval (last, here), - beat_i_arr[i])); - } - return Rhythmic_grouping (children); -} - diff --git a/lily/include/grouping.hh b/lily/include/grouping.hh deleted file mode 100644 index ada7b4ab5c..0000000000 --- a/lily/include/grouping.hh +++ /dev/null @@ -1,60 +0,0 @@ -/* - grouping.hh -- part of GNU LilyPond - - (c) 1996--1998 Han-Wen Nienhuys -*/ - -#ifndef GROUPING_HH -#define GROUPING_HH - -#include "minterval.hh" -#include "array.hh" - -/** data structure which represents rhythmic units this is a tree. It groupes notes according to rules - - TODO Documentation. Unhairing - */ -struct Rhythmic_grouping { - Array children; - MInterval *interval_; - - - Array intervals(); - MInterval interval() const; - Moment length() const; - void intersect (MInterval); - - void operator=(Rhythmic_grouping const&); - Rhythmic_grouping (Rhythmic_grouping const&); - Rhythmic_grouping (MInterval, int n=1); - Rhythmic_grouping(); - Rhythmic_grouping (Array); - ~Rhythmic_grouping(); - - void add_child (Moment start, Moment len); - bool child_fit_b (Moment start); - void split (Rhythmic_grouping r); - void split (Array); - void split (int n); - - void print() const; - void OK() const; - - Array generate_beams (Array, int&); - - /** multiply self to span #i#. - In implementation, this isn't really const, but conceptually it is. - */ - void extend (MInterval i) const; - void translate (Moment); -private: - void init(); - void junk(); - void copy (Rhythmic_grouping const&); -}; - - -Rhythmic_grouping parse_grouping (Array beat_i_arr, Array elt_length_arr); - - -#endif diff --git a/lily/include/piano-brace.hh b/lily/include/piano-brace.hh deleted file mode 100644 index c16ed213ec..0000000000 --- a/lily/include/piano-brace.hh +++ /dev/null @@ -1,33 +0,0 @@ -/* - piano-brace.hh -- declare Piano_brace - - source file of the GNU LilyPond music typesetter - - (c) 1998 Han-Wen Nienhuys - - */ - -#ifndef PIANO_BRACE_HH -#define PIANO_BRACE_HH - -#include "span-score-bar.hh" - -class Piano_brace : public Span_score_bar -{ -public: - - VIRTUAL_COPY_CONS(Score_element); - - /** make room for Staff_bracket. Ugh. Should use some kind of - relation thingy. */ - Real extra_move_left_f_; - Piano_brace (); -protected: - virtual Interval do_width() const; - virtual void do_post_processing(); - virtual Molecule get_bar_sym (Real) const; -}; - - -#endif /* PIANO_BRACE_HH */ - diff --git a/lily/include/score-bar.hh b/lily/include/score-bar.hh deleted file mode 100644 index 741f1412b9..0000000000 --- a/lily/include/score-bar.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - score-bar.hh -- declare Score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys - - */ - -#ifndef SCORE_BAR_HH -#define SCORE_BAR_HH - -#include "bar.hh" - -/** - Score_bars are at the start of the line only, and - they come before normal bars. - */ -class Score_bar : public virtual Bar { -public: - - VIRTUAL_COPY_CONS(Score_element); -protected: - void do_pre_processing (); -}; - -#endif /* SCORE_BAR_HH */ - diff --git a/lily/include/span-bar-engraver.hh b/lily/include/span-bar-engraver.hh deleted file mode 100644 index dc467a193d..0000000000 --- a/lily/include/span-bar-engraver.hh +++ /dev/null @@ -1,39 +0,0 @@ -/* - span-bar-engraver.hh -- declare Span_bar_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - - -#ifndef SPAN_BAR_GRAV_HH -#define SPAN_BAR_GRAV_HH - -#include "engraver.hh" - -/** - - Make bars that span multiple "staffs". Catch bars, and span a - Span_bar over them if we find more than 2 bars - - */ -class Span_bar_engraver : public Engraver -{ - Span_bar * spanbar_p_; - Array bar_l_arr_; - Vertical_align_spanner * valign_l_; -public: - VIRTUAL_COPY_CONS(Translator); - - - Span_bar_engraver(); -protected: - virtual void do_creation_processing (); - virtual void do_removal_processing (); - virtual void acknowledge_element (Score_element_info); - virtual void do_pre_move_processing(); - virtual Span_bar* get_span_bar_p() const; -}; - -#endif // SPAN_BAR_GRAV_HH diff --git a/lily/include/staff-bracket.hh b/lily/include/staff-bracket.hh deleted file mode 100644 index 3360ac32cd..0000000000 --- a/lily/include/staff-bracket.hh +++ /dev/null @@ -1,28 +0,0 @@ - -/* - staff-bracket.hh -- declare Staff_bracket - - source file of the GNU LilyPond music typesetter - - (c) 1998 Han-Wen Nienhuys - - */ - -#ifndef STAFF_BRACKET_HH -#define STAFF_BRACKET_HH -#include "span-score-bar.hh" -class Staff_bracket : public Span_score_bar -{ -public: - - VIRTUAL_COPY_CONS(Score_element); - -protected: - virtual Interval do_width() const; - virtual void do_post_processing(); - virtual Molecule get_bar_sym (Real) const; -}; - - -#endif /* STAFF_BRACKET_HH */ - diff --git a/lily/piano-brace.cc b/lily/piano-brace.cc deleted file mode 100644 index a1094140a2..0000000000 --- a/lily/piano-brace.cc +++ /dev/null @@ -1,54 +0,0 @@ - -/* - span-score-bar.cc -- implement Span_score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - -#include "piano-brace.hh" -#include "atom.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "main.hh" - -Piano_brace::Piano_brace () -{ - extra_move_left_f_ = 0.0; -} - -Molecule -Piano_brace::get_bar_sym (Real dy) const -{ - Atom a = lookup_l ()->vbrace (dy); - a.translate_axis (-extra_move_left_f_, X_AXIS); - - - return a; -} - -Interval -Piano_brace::do_width() const -{ - return Interval (0,0); -} - -void -Piano_brace::do_post_processing () -{ - Span_score_bar::do_post_processing(); - Interval i = Span_score_bar::do_height (); - Real staffheight_f = paper ()->staffheight_f (); - - // don't set braces that span only one staff - if (i.length () <= 2.0 * staffheight_f) - { - set_empty (true); - transparent_b_ = true; - } -} - - - - diff --git a/lily/score-bar.cc b/lily/score-bar.cc deleted file mode 100644 index a25e7ed3c4..0000000000 --- a/lily/score-bar.cc +++ /dev/null @@ -1,23 +0,0 @@ -/* - score-bar.cc -- implement Score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys - - */ - -#include "score-bar.hh" - - - -void -Score_bar::do_pre_processing () -{ - type_str_ = "|"; - if (break_status_dir() != RIGHT) - { - set_empty (true); - transparent_b_ = true; - } -} diff --git a/lily/span-score-bar.cc b/lily/span-score-bar.cc deleted file mode 100644 index 0e80464e42..0000000000 --- a/lily/span-score-bar.cc +++ /dev/null @@ -1,32 +0,0 @@ -/* - span-score-bar.cc -- implement Span_score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - -#include "span-score-bar.hh" -#include "atom.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "main.hh" - -Span_score_bar::Span_score_bar() -{ -} - - -void -Span_score_bar::do_pre_processing() -{ - /* - duh. The order of these two is subtle. - */ - Score_bar::do_pre_processing (); - // Span_bar::do_pre_processing(); -} - - - - diff --git a/lily/staff-bracket.cc b/lily/staff-bracket.cc deleted file mode 100644 index 2e1bd73419..0000000000 --- a/lily/staff-bracket.cc +++ /dev/null @@ -1,46 +0,0 @@ -/* - span-score-bar.cc -- implement Span_score_bar - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - -#include "staff-bracket.hh" -#include "atom.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "main.hh" - -Molecule -Staff_bracket::get_bar_sym (Real dy) const -{ - Atom a = lookup_l ()->vbracket (dy); - a.translate_axis (- 1.33 * a.extent ().x ().length (), X_AXIS); - return Molecule (a); -} - -Interval -Staff_bracket::do_width() const -{ - return Interval (0,0); -} - - -void -Staff_bracket::do_post_processing () -{ - Span_score_bar::do_post_processing(); - Interval i = Span_score_bar::do_height (); - // don't set bracket that spans less than one staff - Real staffheight_f = paper ()->staffheight_f (); - if (i.length () < 0.5 * staffheight_f) - { - transparent_b_ = true; - set_empty (true); - } -} - - - - diff --git a/lily/template3.cc b/lily/template3.cc deleted file mode 100644 index eb9417c5e8..0000000000 --- a/lily/template3.cc +++ /dev/null @@ -1,15 +0,0 @@ -/* - template3.cc -- instantiate Atom - - source file of the GNU LilyPond music typesetter - - (c) 1997--1998 Han-Wen Nienhuys -*/ - -#include "atom.hh" -#include "molecule.hh" -#include "cursor.tcc" -#include "pcursor.tcc" -#include "plist.tcc" - -POINTERLIST_INSTANTIATE(Atom);