From a9b526c1c5af64882cae8de1b892d2af13a776f3 Mon Sep 17 00:00:00 2001 From: fred Date: Tue, 26 Mar 2002 23:09:45 +0000 Subject: [PATCH] lilypond-1.3.11 --- input/bugs/c.ly | 24 --- input/bugs/cr.ly | 2 - lily/axis-group-item.cc | 41 ----- lily/axis-group-spanner.cc | 166 -------------------- lily/file-results.cc | 1 - lily/include/chord-tremolo.hh | 28 ---- lily/include/glob.hh | 9 -- lily/include/graphical-element.hh | 27 ---- lily/include/new-beaming.hh | 2 - lily/include/new-repeated-music.hh | 2 - lily/include/parseconstruct.hh | 2 - lily/include/staff-side.hh | 43 ----- lily/include/staff-sym-engraver.hh | 32 ---- lily/include/stem-staff-side.hh | 42 ----- lily/include/symbols.hh | 1 - lily/specialty-engraver.cc | 35 ----- lily/staff-side.cc | 244 ----------------------------- lily/staff-sym-engraver.cc | 75 --------- lily/staff-sym.cc | 74 --------- lily/stem-info.cc | 138 ---------------- lily/stem-staff-side.cc | 1 - 21 files changed, 989 deletions(-) delete mode 100644 input/bugs/c.ly delete mode 100644 input/bugs/cr.ly delete mode 100644 lily/axis-group-item.cc delete mode 100644 lily/axis-group-spanner.cc delete mode 100644 lily/file-results.cc delete mode 100644 lily/include/chord-tremolo.hh delete mode 100644 lily/include/glob.hh delete mode 100644 lily/include/graphical-element.hh delete mode 100644 lily/include/new-beaming.hh delete mode 100644 lily/include/new-repeated-music.hh delete mode 100644 lily/include/parseconstruct.hh delete mode 100644 lily/include/staff-side.hh delete mode 100644 lily/include/staff-sym-engraver.hh delete mode 100644 lily/include/stem-staff-side.hh delete mode 100644 lily/include/symbols.hh delete mode 100644 lily/specialty-engraver.cc delete mode 100644 lily/staff-side.cc delete mode 100644 lily/staff-sym-engraver.cc delete mode 100644 lily/staff-sym.cc delete mode 100644 lily/stem-info.cc delete mode 100644 lily/stem-staff-side.cc diff --git a/input/bugs/c.ly b/input/bugs/c.ly deleted file mode 100644 index 0f605aa829..0000000000 --- a/input/bugs/c.ly +++ /dev/null @@ -1,24 +0,0 @@ -% core dumps - -global = \notes { - \key a \minor; - \time 6/4; -} - -\score{ - \notes \context PianoStaff < - \global - \context Staff=up { c } - %\context Staff=down { \autochange Staff c } -% \context Staff=down { c } - > - \paper { - \translator{ - \StaffContext - - % other core dump when this is removed? -% \remove "Time_signature_engraver"; - } - } -} - diff --git a/input/bugs/cr.ly b/input/bugs/cr.ly deleted file mode 100644 index 6392a695c0..0000000000 --- a/input/bugs/cr.ly +++ /dev/null @@ -1,2 +0,0 @@ - -\score { \notes { c1 \< \break \! c1 }} diff --git a/lily/axis-group-item.cc b/lily/axis-group-item.cc deleted file mode 100644 index fdbcf9cf29..0000000000 --- a/lily/axis-group-item.cc +++ /dev/null @@ -1,41 +0,0 @@ -/* - axis-item.cc -- implement Axis_group_item - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ -#include "axis-group-item.hh" -#include "paper-column.hh" - - - -void -Axis_group_item::do_breakable_col_processing() -{ -#if 0 - if (!breakable_b ()) // ugh should merge with Item code - return; - - OK(); - copy_breakable_items(); - - - Link_array elems = elem_l_arr (); - for (int i=0; i < elems.size(); i++) - { - Item* it_l = dynamic_cast (elems[i]); - Direction j=LEFT; - do - { - Axis_group_item * my_brok - = dynamic_cast (find_broken_piece(j)); - Item *new_l = it_l->find_broken_piece (j); - my_brok->add_element (new_l); - } - while (flip(&j)!=LEFT); - } -#endif - Item::do_breakable_col_processing(); -} - diff --git a/lily/axis-group-spanner.cc b/lily/axis-group-spanner.cc deleted file mode 100644 index 7af3118a11..0000000000 --- a/lily/axis-group-spanner.cc +++ /dev/null @@ -1,166 +0,0 @@ -/* - axis-group-spanner.cc -- implement Axis_group_spanner - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "axis-group-spanner.hh" -#include "debug.hh" -#include "item.hh" -#include "paper-column.hh" - -/** Do stuff if we're not broken. In this case the last and first - columns usually are pre- and postbreak respectively, - so the items from these columns need adjusting. - */ -void -Axis_group_spanner::do_break_processing_if_unbroken() -{ -#if 0 - Link_array elems = elem_l_arr (); - Line_of_score *my_line = line_l(); - for (int i=0; i < elems.size(); i++) - { - if (!elems[i]->line_l()) - { - Item * item_l = dynamic_cast (elems[i]); - if (item_l - && item_l->breakable_b () - && item_l->break_status_dir() == 0) - { - // last two checks are paranoia - Score_element * broken_item_l = - item_l->find_broken_piece (my_line); - add_element (broken_item_l); - } - - Spanner *spanner_l = dynamic_cast (elems[i]); - if (spanner_l) - { - Score_element *broken_spanner_l = - spanner_l->find_broken_piece (my_line); - add_element (broken_spanner_l); - } - remove_element (elems[i]); - } - - } -#endif -} - -void -Axis_group_spanner::do_break_processing() -{ - Spanner::do_break_processing (); - - bool breaking_self_b = ! Spanner::line_l(); - if (!breaking_self_b) - { - do_break_processing_if_unbroken(); - Spanner::do_break_processing(); - return; - } - -#if 0 - break_into_pieces (); - Link_array loose_elems = elem_l_arr (); - - Array axeses; - - for (int i=0; i < loose_elems.size (); i++) - { - Score_element* elt = loose_elems[i]; - /* - with which axes do we have to meddle? - */ - int j =0; - int as [2]; - for (int a = X_AXIS; a < NO_AXES; ++a) - if (elt->parent_l (Axis (a)) == this) - as[j++] = a; - if (j == 1) - as[j++] = as[0]; - - axeses.push (as[0]); - axeses.push (as[1]); - } - - remove_all(); - - for (int i=0; i < loose_elems.size(); i++) - { - Score_element * elt = loose_elems[i]; - Line_of_score *elt_line = elt->line_l(); - - Axis a1= (Axis)axeses[2*i]; // ugh. - Axis a2= (Axis)axeses[2*i+1]; // ugh. - if (! elt_line) - { - /* this piece doesn't know where it belongs. - Find out if it was broken, and use the broken remains - */ - - - Item *it = dynamic_cast (elt) ; - if (Spanner * sp =dynamic_cast (elt)) - { - for (int j =0; j < sp->broken_into_l_arr_.size(); j++) - { - Line_of_score *l = sp->broken_into_l_arr_[j]->line_l (); - - Axis_group_spanner * my_broken_l - = dynamic_cast(find_broken_piece (l)); - - Score_element * broken_span_l - = sp->find_broken_piece (l); - - if (broken_span_l) - my_broken_l->add_element (broken_span_l, a1, a2); - } - } - else if (it && it->broken_original_b ()) - { - // broken items - Direction j=LEFT; - do - { - Item * broken_item = it->find_broken_piece (j); - Line_of_score * item_line_l = broken_item->line_l() ; - if (! item_line_l) - continue; - - Axis_group_spanner * v - = dynamic_cast(find_broken_piece (item_line_l)); - if (v) - v->add_element (broken_item, a1, a2); - else - { - broken_item->set_elt_property ("transparent", SCM_BOOL_T); - broken_item->set_empty (X_AXIS); // UGH. - broken_item->set_empty (Y_AXIS); - } - - } - while (flip(&j) != LEFT); - } - } - else - { - /* this piece *does* know where it belongs. - Put it in appropriate piece of this spanner - */ - Axis_group_spanner * my_broken_l - = dynamic_cast (find_broken_piece (elt->line_l())); - my_broken_l->add_element (elt, a1, a2); - } - } - - Spanner::do_break_processing(); -#endif -} - - - - diff --git a/lily/file-results.cc b/lily/file-results.cc deleted file mode 100644 index 8b13789179..0000000000 --- a/lily/file-results.cc +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lily/include/chord-tremolo.hh b/lily/include/chord-tremolo.hh deleted file mode 100644 index 67c67c76fe..0000000000 --- a/lily/include/chord-tremolo.hh +++ /dev/null @@ -1,28 +0,0 @@ -/* - chord-tremolo-engraver.hh -- declare Chord_tremolo_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys - Jan Nieuwenhuizen -*/ - -#ifndef Chord_tremolo_HH -#define Chord_tremolo_HH - -#include "beam.hh" - -/** a beam connects multiple stems Beam adjusts the stems its owns to - make sure that they reach the beam and that point in the correct - direction */ -class Chord_tremolo : public Beam { -public: - VIRTUAL_COPY_CONS(Score_element); - -protected: - virtual Molecule stem_beams (Stem *here, Stem *next, Stem *prev) const; -}; - -#error -#endif // Chord_tremolo_HH - diff --git a/lily/include/glob.hh b/lily/include/glob.hh deleted file mode 100644 index 3bb2fe7601..0000000000 --- a/lily/include/glob.hh +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef GLOB_HH -#define GLOB_HH -#include -#include -#include "real.hh" - -#include "lily-proto.hh" -#include "const.hh" -#endif diff --git a/lily/include/graphical-element.hh b/lily/include/graphical-element.hh deleted file mode 100644 index eab17f40b7..0000000000 --- a/lily/include/graphical-element.hh +++ /dev/null @@ -1,27 +0,0 @@ -/* - graphical-element.hh -- declare Graphical_element - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef GRAPHICAL_ELEMENT_HH -#define GRAPHICAL_ELEMENT_HH - -#include "offset.hh" -#include "lily-proto.hh" -#include "interval.hh" -#include "virtual-methods.hh" -#error - - -/** The 2d geometric aspects of a score-element. - */ -class Graphical_element -{ -}; - -#endif // GRAPHICAL_ELEMENT_HH - diff --git a/lily/include/new-beaming.hh b/lily/include/new-beaming.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/new-beaming.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/include/new-repeated-music.hh b/lily/include/new-repeated-music.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/new-repeated-music.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/include/parseconstruct.hh b/lily/include/parseconstruct.hh deleted file mode 100644 index 65296f8106..0000000000 --- a/lily/include/parseconstruct.hh +++ /dev/null @@ -1,2 +0,0 @@ - -#error diff --git a/lily/include/staff-side.hh b/lily/include/staff-side.hh deleted file mode 100644 index 42c1e00289..0000000000 --- a/lily/include/staff-side.hh +++ /dev/null @@ -1,43 +0,0 @@ -/* - staff-side.hh -- declare Staff_side_{element,spanner,item} - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - -#ifndef STAFF_SIDE_HH -#define STAFF_SIDE_HH - - -#include "spanner.hh" -#include "item.hh" -#include "staff-symbol-referencer.hh" -#include "directional-element.hh" - -struct Side_position_interface -{ - Score_element * elt_l_; -public: - Side_position_interface (Score_element*); - static Real side_position (Dimension_cache const *); - static Real self_alignment (Dimension_cache const *); - static Real aligned_side (Dimension_cache const *); - static Real quantised_position (Dimension_cache const*); - void set_axis (Axis); - void set_quantised (Axis); - Axis get_axis () const; - - bool supported_b () const; - bool is_staff_side_b () const; - void add_support (Score_element*); - - Direction get_direction () const; - void set_direction (Direction); -}; - - - -#endif /* STAFF_SIDE_HH */ - diff --git a/lily/include/staff-sym-engraver.hh b/lily/include/staff-sym-engraver.hh deleted file mode 100644 index 18d2efceab..0000000000 --- a/lily/include/staff-sym-engraver.hh +++ /dev/null @@ -1,32 +0,0 @@ -/* - staff-sym-engraver.hh -- declare Staff_symbol_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - - -#ifndef STAFF_SYMBOL_GRAV_HH -#define STAFF_SYMBOL_GRAV_HH -#include "engraver.hh" -#include "moment.hh" - -/** - Manage the staff symbol. - */ -class Staff_symbol_engraver : public Engraver { - Staff_symbol *span_p_; -public: - VIRTUAL_COPY_CONS(Translator); - Staff_symbol_engraver(); - -protected: - virtual ~Staff_symbol_engraver(); - - virtual void acknowledge_element (Score_element_info); - virtual void do_removal_processing(); - virtual void do_creation_processing(); - -}; -#endif // STAFF_SYMBOL_GRAV_HH diff --git a/lily/include/stem-staff-side.hh b/lily/include/stem-staff-side.hh deleted file mode 100644 index 7e649c96ec..0000000000 --- a/lily/include/stem-staff-side.hh +++ /dev/null @@ -1,42 +0,0 @@ -/* - stem-staff-side.hh -- declare Stem_staff_side - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - -#ifndef Stem_STAFF_SIDE_HH -#define Stem_STAFF_SIDE_HH - -#error - -#include "staff-side.hh" -/** - Position self, analogous to Staff_side_item, but use Stem direction - for determining direction. - - Properties: - - padding :: Real - - Padding in staffline leading - - */ -class Stem_staff_side_item : public Staff_side_item -{ - Stem *stem_l_; -public: - Direction relative_dir_; - - void set_stem (Stem*); - Stem_staff_side_item (); -protected: - virtual Direction get_default_direction ()const; - virtual void do_pre_processing (); - virtual void do_post_processing (); -}; - -#endif /* Stem_STAFF_SIDE_HH */ - diff --git a/lily/include/symbols.hh b/lily/include/symbols.hh deleted file mode 100644 index 8b13789179..0000000000 --- a/lily/include/symbols.hh +++ /dev/null @@ -1 +0,0 @@ - diff --git a/lily/specialty-engraver.cc b/lily/specialty-engraver.cc deleted file mode 100644 index 5f87859db6..0000000000 --- a/lily/specialty-engraver.cc +++ /dev/null @@ -1,35 +0,0 @@ -#if 0 -// not finished yet. -/* - specialty-engraver.cc -- implement Specialty_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1999 Han-Wen Nienhuys - - */ - - -#include "engraver.hh" - -class Specialty_engraver : public Engraver -{ - -public: - VIRTUAL_COPY_CONS(Translator); -protected: - void acknowledge_element (Score_element_info); -}; - - -void -Specialty_engraver::acknowledge_element (Score_element_info ) -{ - /* - We could do groovy stuff, by inserting our own custom (FUNC,FONT) - pairs (Atoms in fact) into acknowledged elements. - - But not yet. This would be cleaner if we had SCM as properties. - */ -} -#endif diff --git a/lily/staff-side.cc b/lily/staff-side.cc deleted file mode 100644 index 068ff7b2c2..0000000000 --- a/lily/staff-side.cc +++ /dev/null @@ -1,244 +0,0 @@ -/* - staff-side.cc -- implement Staff_side_element - - source file of the GNU LilyPond music typesetter - - (c) 1998--1999 Han-Wen Nienhuys - - */ - -#include "staff-side.hh" -#include "staff-symbol.hh" -#include "debug.hh" -#include "warn.hh" -#include "dimensions.hh" -#include "dimension-cache.hh" - -Side_position_interface::Side_position_interface (Score_element *e) -{ - elt_l_ = e; -} - - -void -Side_position_interface::add_support (Score_element*e) -{ - SCM sup = elt_l_->get_elt_property ("side-support"); - elt_l_->set_elt_property ("side-support", - gh_cons (e->self_scm_,sup)); -} - - - -Direction -Side_position_interface::get_direction () const -{ - SCM d = elt_l_->get_elt_property ("direction"); - if (isdir_b (d)) - return to_dir (d) ? to_dir (d) : DOWN; - - Direction relative_dir = UP; - SCM reldir = elt_l_->get_elt_property ("side-relative-direction"); // should use a lambda. - if (isdir_b (reldir)) - { - relative_dir = to_dir (reldir); - } - - SCM other_elt = elt_l_->get_elt_property ("direction-source"); - Score_element * e = unsmob_element(other_elt); - if (e) - { - return relative_dir * Side_position_interface (e).get_direction (); - } - - return DOWN; -} - -/** - Callback that does the aligning. - */ -Real -Side_position_interface::side_position (Dimension_cache const * c) -{ - Score_element * me = dynamic_cast (c->element_l ()); - - Interval dim; - Axis axis = c->axis (); - Score_element *common = me->parent_l (axis); - SCM support = me->get_elt_property ("side-support"); - for (SCM s = support; s != SCM_EOL; s = gh_cdr (s)) - { - Score_element * e = unsmob_element ( gh_car (s)); - if (e) - common = common->common_refpoint (e, axis); - } - - for (SCM s = support; s != SCM_EOL; s = gh_cdr (s)) - { - - Score_element * e = unsmob_element ( gh_car (s)); - if (e) - { - Real coord = e->relative_coordinate (common, axis); - - dim.unite (coord + e->extent (axis)); - } - } - - if (dim.empty_b ()) - { - dim = Interval(0,0); - } - - Real off = me->parent_l (axis)->relative_coordinate (common, axis); - - - Direction dir = Side_position_interface (me).get_direction (); - - SCM pad = me->remove_elt_property ("padding"); - if (pad != SCM_UNDEFINED) - { - off += gh_scm2double (pad) * dir; - } - Real total_off = dim[dir] + off; - - if (fabs (total_off) > 100 CM) - programming_error ("Huh ? Improbable staff side dim."); - - return total_off; -} - -Real -Side_position_interface::self_alignment (Dimension_cache const *c) -{ - String s ("self-alignment-"); - Axis ax = c->axis (); - s += (ax == X_AXIS) ? "X" : "Y"; - Score_element *elm = dynamic_cast (c->element_l ()); - SCM align (elm->get_elt_property (s)); - if (isdir_b (align)) - { - Direction d = to_dir (align); - Interval ext(elm->extent (ax)); - if (d) - { - return - ext[d]; - } - return - ext.center (); - } - else - return 0.0; -} - - -Real -directed_round (Real f, Direction d ) -{ - if (d < 0) - return floor (f); - else - return ceil (f); -} - -Real -Side_position_interface::quantised_position (Dimension_cache const *c) -{ - Score_element * me = dynamic_cast (c->element_l ()); - Side_position_interface s(me); - Direction d = s.get_direction (); - - Staff_symbol_referencer *ref = dynamic_cast (me); - if (ref) - { - Real p = ref->position_f (); - Real rp = directed_round (d, p); - - int ip = int (p); - if (!(ip % 2)) - { - ip += d; - rp += d; - } - - return (rp - p) * ref->staff_line_leading_f (); - } - return 0.0; -} - -Real -Side_position_interface::aligned_side (Dimension_cache const *c) -{ - Score_element * me = dynamic_cast (c->element_l ()); - Side_position_interface s(me); - Direction d = s.get_direction (); - Axis ax = c->axis (); - Real o = side_position (c); - - Interval iv = me->extent (ax); - - if (!iv.empty_b ()) - { - o += - iv[-d]; - - SCM pad = me->get_elt_property ("padding"); - if (gh_number_p (pad)) - o += d *gh_scm2double (pad) ; - } - return o; -} - - - - -void -Side_position_interface::set_axis (Axis a) -{ - // prop transparent ? - if (elt_l_->get_elt_property ("side-support") == SCM_UNDEFINED) - elt_l_->set_elt_property ("side-support" ,SCM_EOL); - - elt_l_->dim_cache_[a]->off_callbacks_.push (aligned_side); -} - - -void -Side_position_interface::set_quantised (Axis a) -{ - Dimension_cache * c = elt_l_->dim_cache_[a]; - for (int i=0; i < c->off_callbacks_.size (); i++) - if (c->off_callbacks_[i] == aligned_side) - c->off_callbacks_[i] = side_position ; - c->off_callbacks_.push (quantised_position); -} - -Axis -Side_position_interface::get_axis () const -{ - Dimension_cache * c = elt_l_->dim_cache_[X_AXIS]; - for (int i=0 ; i < c->off_callbacks_.size();i ++) - if (c->off_callbacks_[i] == side_position - ||c->off_callbacks_[i] == aligned_side) - return X_AXIS; - - - return Y_AXIS; -} - -void -Side_position_interface::set_direction (Direction d) -{ - elt_l_->set_elt_property ("direction", gh_int2scm (d)); -} - -bool -Side_position_interface::is_staff_side_b () const -{ - return elt_l_->get_elt_property ("side-support") != SCM_UNDEFINED; -} - -bool -Side_position_interface::supported_b () const -{ - SCM s =elt_l_->get_elt_property ("side-support"); - return s != SCM_UNDEFINED && s != SCM_EOL; -} diff --git a/lily/staff-sym-engraver.cc b/lily/staff-sym-engraver.cc deleted file mode 100644 index 369df2928f..0000000000 --- a/lily/staff-sym-engraver.cc +++ /dev/null @@ -1,75 +0,0 @@ -/* - staff-sym-reg.cc -- implement Staff_symbol_engraver - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ - -#include "staff-sym-engraver.hh" -#include "staff-symbol.hh" -#include "score.hh" -#include "paper-column.hh" -#include "staff-symbol-referencer.hh" -#include "paper-def.hh" -#include "staff-side.hh" - -Staff_symbol_engraver::~Staff_symbol_engraver() -{ - assert (!span_p_); -} - -Staff_symbol_engraver::Staff_symbol_engraver() -{ - span_p_ = 0; -} - -void -Staff_symbol_engraver::do_creation_processing() -{ - span_p_ = new Staff_symbol; - span_p_->set_bounds(LEFT,get_staff_info().command_pcol_l ()); - announce_element (Score_element_info (span_p_, 0)); -} - -void -Staff_symbol_engraver::do_removal_processing() -{ - SCM l (get_property ("numberOfStaffLines", 0)); - if (gh_number_p(l)) - { - span_p_->no_lines_i_ = gh_scm2int (l); - } - - SCM sz (get_property ("staffLineLeading", 0)); - if (gh_number_p(sz)) - { - span_p_->staff_line_leading_f_ = gh_scm2double (sz); - } - else - { - span_p_->staff_line_leading_f_ = paper_l ()->get_var ("interline"); - } - span_p_->set_bounds(RIGHT,get_staff_info().command_pcol_l ()); - typeset_element (span_p_); - span_p_ =0; -} - -void -Staff_symbol_engraver::acknowledge_element (Score_element_info s) -{ - s.elem_l_->set_elt_property ("staff-symbol", span_p_->self_scm_); - s.elem_l_->add_dependency (span_p_); // UGH. UGH. UGH - - SCM ss =s.elem_l_->remove_elt_property ("staff-support"); - if (gh_boolean_p (ss) && gh_scm2bool (ss)) - { - Side_position_interface si (s.elem_l_); - if (si.is_staff_side_b ()) - si.add_support (span_p_); - } -} - - -ADD_THIS_TRANSLATOR(Staff_symbol_engraver); - diff --git a/lily/staff-sym.cc b/lily/staff-sym.cc deleted file mode 100644 index 2bc87b2321..0000000000 --- a/lily/staff-sym.cc +++ /dev/null @@ -1,74 +0,0 @@ -/* - staffsym.cc -- implement Staff_symbol - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Han-Wen Nienhuys -*/ -#include "staff-symbol.hh" -#include "lookup.hh" -#include "dimensions.hh" -#include "paper-def.hh" -#include "molecule.hh" -#include "debug.hh" -#include "item.hh" - - -Staff_symbol::Staff_symbol () -{ - no_lines_i_ = 5; - staff_line_leading_f_ = 5.0 PT; -} - -void -Staff_symbol::do_print() const -{ -#ifndef NPRINT - Spanner::do_print(); - DEBUG_OUT << "lines: " << no_lines_i_; -#endif -} - - -Molecule* -Staff_symbol::do_brew_molecule_p() const -{ - Score_element * common - = spanned_drul_[LEFT]->common_refpoint (spanned_drul_[RIGHT], X_AXIS); - -#if 0 - Interval r = spanned_drul_[RIGHT]->extent (X_AXIS); - Interval l = spanned_drul_[LEFT]->extent (X_AXIS); - - Real left_shift =l.empty_b () ? 0.0: l[LEFT]; - Real right_shift =r.empty_b () ? 0.0: r[RIGHT]; -#endif - Real width = - // right_shift - left_shift - + spanned_drul_[RIGHT]->relative_coordinate (common , X_AXIS) - - spanned_drul_[LEFT]->relative_coordinate (common, X_AXIS) - ; - - Real t = paper_l ()->get_var ("stafflinethickness"); - Molecule rule = lookup_l ()->filledbox (Box (Interval (0,width), - Interval (-t/2, t/2))); - - Real height = (no_lines_i_-1) * staff_line_leading_f_ /2; - Molecule * m = new Molecule; - for (int i=0; i < no_lines_i_; i++) - { - Molecule a (rule); - a.translate_axis (height - i * staff_line_leading_f_, Y_AXIS); - m->add_molecule (a); - } - - // m->translate_axis (left_shift, X_AXIS); - return m; -} - - -int -Staff_symbol::steps_i() const -{ - return no_lines_i_*2; -} diff --git a/lily/stem-info.cc b/lily/stem-info.cc deleted file mode 100644 index ee0faf9721..0000000000 --- a/lily/stem-info.cc +++ /dev/null @@ -1,138 +0,0 @@ -/* - stem-info.cc -- implement Stem_info - - source file of the GNU LilyPond music typesetter - - (c) 1997--1999 Jan Nieuwenhuizen - -*/ - -#include "proto.hh" -#include "misc.hh" -#include "cross-staff.hh" -#include "debug.hh" -#include "stem.hh" -#include "paper-def.hh" -#include "lookup.hh" -#include "stem-info.hh" -#include "beam.hh" - - -Stem_info::Stem_info () -{ -} - - -/* - FIXME: y dims should not be in internote. - - - GURG UGRGINRG INA UG R - - JUNKME -> this should set elt properties of STEM. -*/ -Stem_info::Stem_info (Stem*s, int mult) -{ - mult_i_ =mult; - stem_l_ = s; - Beam* beam_l = stem_l_->beam_l (); - - x_ = stem_l_->hpos_f (); - set_direction (stem_l_->get_direction ()); - SCM bd = stem_l_->remove_elt_property ("beam-dir"); - - if (gh_number_p (bd)) - { - beam_dir_ = gh_scm2int (bd); - } - else - { - programming_error ("Beam direction not set."); - beam_dir_ = UP; // GURAUGRNAGURAGU! urg ! - } - - Paper_def* paper_l = stem_l_->paper_l (); - Real internote_f = stem_l_->staff_line_leading_f ()/2; - Real interbeam_f = paper_l->interbeam_f (mult_i_); - Real beam_f = gh_scm2double (beam_l->get_elt_property ("beam-thickness")); - - - // strangely enough, dim(chord_start_f) == pt (and not internote!) - idealy_f_ = stem_l_->chord_start_f () / internote_f; - - // calculate using dim(y) == pt - idealy_f_ *= internote_f; - - // for simplicity, we calculate as if dir == UP - idealy_f_ *= beam_dir_; - - bool grace_b = stem_l_->get_elt_property ("grace") != SCM_UNDEFINED; - bool no_extend_b = stem_l_->get_elt_property ("no-stem-extend") - != SCM_UNDEFINED; - - int stem_max = (int)rint(paper_l->get_var ("stem_max")); - String type_str = grace_b ? "grace_" : ""; - Real min_stem_f = paper_l->get_var (type_str + "minimum_stem_length" - + to_str (mult_i_ get_var (type_str + "stem_length" - + to_str (mult_i_ ? 0; - //lowest beam of (UP) beam must never be lower than second staffline - miny_f_ = miny_f_ >? (- 2 * internote_f - beam_f - + (mult_i_ > 0) * beam_f + interbeam_f * (mult_i_ - 1)); - } - } - else - /* knee */ - { - idealy_f_ -= beam_f; - maxy_f_ = idealy_f_; - miny_f_ = -INT_MAX; - - idealy_f_ -= stem_f; - maxy_f_ -= min_stem_f; - } - - // set dim(y) == internote - idealy_f_ /= internote_f; - miny_f_ /= internote_f; - maxy_f_ /= internote_f; - - idealy_f_ = maxy_f_ ? idealy_f_; - - interstaff_f_ = calc_interstaff_dist (stem_l_, beam_l) / internote_f; - idealy_f_ += interstaff_f_* beam_dir_; - miny_f_ += interstaff_f_ * beam_dir_; - maxy_f_ += interstaff_f_ * beam_dir_; -} - - diff --git a/lily/stem-staff-side.cc b/lily/stem-staff-side.cc deleted file mode 100644 index 8b13789179..0000000000 --- a/lily/stem-staff-side.cc +++ /dev/null @@ -1 +0,0 @@ - -- 2.39.5