CVSROOT: /cvsroot/lilypond
Module name: lilypond
Branch:
Changes by: Han-Wen Nienhuys <[EMAIL PROTECTED]> 05/07/20 14:23:41
Modified files:
. : ChangeLog
lily : chord-name.cc grob-property.cc
ledger-line-spanner.cc note-column.cc
script-column.cc slur-scoring.cc
spacing-loose-columns.cc spacing-spanner.cc
spanner.cc tie-column.cc
lily/include : paper-column.hh
scm : output-socket.scm
Log message:
* lily/note-column.cc (dir): idem.
* lily/spacing-spanner.cc (Module): idem.
* lily/script-column.cc (before_line_breaking): use extract_grob_set()
* lily/include/paper-column.hh (class Paper_column): add
non-static get_rank() member.
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/ChangeLog.diff?tr1=1.3901&tr2=1.3902&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/chord-name.cc.diff?tr1=1.56&tr2=1.57&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/grob-property.cc.diff?tr1=1.26&tr2=1.27&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/ledger-line-spanner.cc.diff?tr1=1.25&tr2=1.26&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/note-column.cc.diff?tr1=1.109&tr2=1.110&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/script-column.cc.diff?tr1=1.80&tr2=1.81&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/slur-scoring.cc.diff?tr1=1.55&tr2=1.56&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/spacing-loose-columns.cc.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/spacing-spanner.cc.diff?tr1=1.141&tr2=1.142&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/spanner.cc.diff?tr1=1.135&tr2=1.136&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/tie-column.cc.diff?tr1=1.47&tr2=1.48&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/lily/include/paper-column.hh.diff?tr1=1.32&tr2=1.33&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/lilypond/lilypond/scm/output-socket.scm.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
Patches:
Index: lilypond/ChangeLog
diff -u lilypond/ChangeLog:1.3901 lilypond/ChangeLog:1.3902
--- lilypond/ChangeLog:1.3901 Wed Jul 20 12:05:34 2005
+++ lilypond/ChangeLog Wed Jul 20 14:23:40 2005
@@ -1,3 +1,17 @@
+
+2005-07-20 Han-Wen Nienhuys <[EMAIL PROTECTED]>
+
+ * lily/note-column.cc (dir): idem.
+
+ * lily/spacing-spanner.cc (Module): idem.
+
+ * lily/script-column.cc (before_line_breaking): use extract_grob_set()
+
+ * lily/include/paper-column.hh (class Paper_column): add
+ non-static get_rank() member.
+
+ * scm/framework-null.scm: new file, used for benchmarking.
+
2005-07-20 Heikki Junes <[EMAIL PROTECTED]>
* Documentation/topdocs/INSTALL.texi, configure.in: fix
@@ -9,10 +23,6 @@
* stepmake/bin/add-html-footer.py: add missing </p>.
-2005-07-20 Han-Wen Nienhuys <[EMAIL PROTECTED]>
-
- * scm/framework-null.scm: new file, used for benchmarking.
-
2005-07-19 Han-Wen Nienhuys <[EMAIL PROTECTED]>
* scm/define-markup-commands.scm (beam): use polygon in beam
@@ -28,7 +38,7 @@
link to libstdc++
* lily/GNUmakefile (static-gxx-libs): new target
- static-gxx-libs. Create link to libstdc++.a
+ static-gxx-libs. Create symlink to libstdc++.a
* lily/new-lyric-combine-music-iterator.cc: rename to
Lyric_combine_music_iterator
Index: lilypond/lily/chord-name.cc
diff -u lilypond/lily/chord-name.cc:1.56 lilypond/lily/chord-name.cc:1.57
--- lilypond/lily/chord-name.cc:1.56 Tue Jun 7 15:13:06 2005
+++ lilypond/lily/chord-name.cc Wed Jul 20 14:23:41 2005
@@ -25,7 +25,7 @@
SCM s = me->get_property ("begin-of-line-visible");
if (to_boolean (s))
{
- if (Paper_column::get_rank (me->get_column ())
+ if (me->get_column ()->get_rank ()
- me->get_system ()->spanned_rank_iv ()[LEFT] > 1)
me->suicide ();
}
Index: lilypond/lily/grob-property.cc
diff -u lilypond/lily/grob-property.cc:1.26 lilypond/lily/grob-property.cc:1.27
--- lilypond/lily/grob-property.cc:1.26 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/grob-property.cc Wed Jul 20 14:23:41 2005
@@ -93,6 +93,7 @@
mutable_property_alist_ = scm_assq_set_x (mutable_property_alist_, sym, v);
}
+#ifdef DEBUG_PROFILE_ACCESSES
Protected_scm property_lookup_table;
LY_DEFINE(ly_property_lookup_stats, "ly:property-lookup-stats",
0,0,0, (),
@@ -100,7 +101,7 @@
{
return (SCM) property_lookup_table;
}
-
+#endif
SCM
Grob::internal_get_property (SCM sym) const
@@ -118,7 +119,7 @@
}
#endif
-#if 0
+#ifdef DEBUG_PROFILE_ACCESSES
/*
Statistics: which properties are looked up?
*/
@@ -136,7 +137,6 @@
scm_set_cdr_x (hashhandle, scm_from_int (scm_to_int (scm_cdr (hashhandle)) +
1));
#endif
-
SCM s = scm_sloppy_assq (sym, mutable_property_alist_);
if (s != SCM_BOOL_F)
Index: lilypond/lily/include/paper-column.hh
diff -u lilypond/lily/include/paper-column.hh:1.32
lilypond/lily/include/paper-column.hh:1.33
--- lilypond/lily/include/paper-column.hh:1.32 Thu Mar 10 14:36:12 2005
+++ lilypond/lily/include/paper-column.hh Wed Jul 20 14:23:41 2005
@@ -14,11 +14,15 @@
class Paper_column : public Item
{
-public:
int rank_;
/// if lines are broken then this column is in #line#
System *system_;
+
+ // ugh: friend declarations.
+ friend void set_loose_columns (System *which, Column_x_positions const
*posns);
+ friend class System;
+public:
Paper_column (SCM, Object_key const *);
Paper_column (Paper_column const &, int count);
@@ -30,7 +34,8 @@
virtual System *get_system () const;
static int get_rank (Grob *);
-
+ int get_rank () const { return rank_; }
+
DECLARE_SCHEME_CALLBACK (print, (SCM));
DECLARE_SCHEME_CALLBACK (before_line_breaking, (SCM));
Index: lilypond/lily/ledger-line-spanner.cc
diff -u lilypond/lily/ledger-line-spanner.cc:1.25
lilypond/lily/ledger-line-spanner.cc:1.26
--- lilypond/lily/ledger-line-spanner.cc:1.25 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/ledger-line-spanner.cc Wed Jul 20 14:23:41 2005
@@ -242,7 +242,7 @@
ledger_extent.widen (length_fraction * head_extent.length ());
Direction vdir = Direction (sign (pos));
- int rank = Paper_column::get_rank (h->get_column ());
+ int rank = h->get_column ()->get_rank ();
reqs[rank][vdir].ledger_extent_.unite (ledger_extent);
reqs[rank][vdir].head_extent_.unite (head_extent);
@@ -307,7 +307,7 @@
Interval ledger_size = head_size;
ledger_size.widen (ledger_size.length () * length_fraction);
- Interval max_size = reqs[Paper_column::get_rank (h->get_column
())][Direction (sign (pos))].ledger_extent_;
+ Interval max_size = reqs[h->get_column ()->get_rank ()][Direction
(sign (pos))].ledger_extent_;
ledger_size.intersect (max_size);
Real left_shorten = 0.0;
Index: lilypond/lily/note-column.cc
diff -u lilypond/lily/note-column.cc:1.109 lilypond/lily/note-column.cc:1.110
--- lilypond/lily/note-column.cc:1.109 Mon Jul 18 23:37:25 2005
+++ lilypond/lily/note-column.cc Wed Jul 20 14:23:41 2005
@@ -73,9 +73,13 @@
Grob *stem = unsmob_grob (me->get_object ("stem"));
if (stem && Stem::has_interface (stem))
return Stem::get_direction (stem);
- else if (scm_is_pair (me->get_object ("note-heads")))
- return (Direction)sign (head_positions_interval (me).center ());
-
+ else
+ {
+ extract_grob_set (me, "note-heads", heads);
+ if (heads.size ())
+ return (Direction)sign (head_positions_interval (me).center ());
+ }
+
programming_error ("note column without heads and stem");
return CENTER;
}
Index: lilypond/lily/script-column.cc
diff -u lilypond/lily/script-column.cc:1.80 lilypond/lily/script-column.cc:1.81
--- lilypond/lily/script-column.cc:1.80 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/script-column.cc Wed Jul 20 14:23:41 2005
@@ -42,12 +42,13 @@
Script_column::before_line_breaking (SCM smob)
{
Grob *me = unsmob_grob (smob);
- Drul_array<SCM> scripts (SCM_EOL, SCM_EOL);
+ Drul_array<SCM> scripts_drul (SCM_EOL, SCM_EOL);
Link_array<Grob> staff_sided;
- for (SCM s = me->get_property ("scripts"); scm_is_pair (s); s = scm_cdr (s))
+ extract_grob_set (me, "scripts", scripts);
+ for (int i = 0; i < scripts.size (); i++)
{
- Grob *sc = unsmob_grob (scm_car (s));
+ Grob *sc = scripts[i];
/*
Don't want to consider scripts horizontally next to notes.
@@ -68,13 +69,13 @@
g->set_property ("direction", scm_int2num (d));
}
- scripts[d] = scm_cons (g->self_scm (), scripts[d]);
+ scripts_drul[d] = scm_cons (g->self_scm (), scripts_drul[d]);
}
Direction d = DOWN;
do
{
- SCM ss = scm_reverse_x (scripts[d], SCM_EOL);
+ SCM ss = scm_reverse_x (scripts_drul[d], SCM_EOL);
ss = scm_stable_sort_x (ss, ly_grob_script_priority_less_proc);
Grob *last = 0;
Index: lilypond/lily/slur-scoring.cc
diff -u lilypond/lily/slur-scoring.cc:1.55 lilypond/lily/slur-scoring.cc:1.56
--- lilypond/lily/slur-scoring.cc:1.55 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/slur-scoring.cc Wed Jul 20 14:23:41 2005
@@ -498,8 +498,8 @@
Direction d = LEFT;
do
{
- b1[d] = s1->get_bound (d)->get_column ()->rank_;
- b2[d] = s2->get_bound (d)->get_column ()->rank_;
+ b1[d] = s1->get_bound (d)->get_column ()->get_rank ();
+ b2[d] = s2->get_bound (d)->get_column ()->get_rank ();
}
while (flip (&d) != LEFT);
Index: lilypond/lily/spacing-loose-columns.cc
diff -u lilypond/lily/spacing-loose-columns.cc:1.3
lilypond/lily/spacing-loose-columns.cc:1.4
--- lilypond/lily/spacing-loose-columns.cc:1.3 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/spacing-loose-columns.cc Wed Jul 20 14:23:41 2005
@@ -25,7 +25,7 @@
Item *loose = dynamic_cast<Item *> (posns->loose_cols_[i]);
Paper_column *col = dynamic_cast<Paper_column *> (loose);
- if (col->system_)
+ if (col->get_system ())
continue;
Item *left = 0;
@@ -94,17 +94,7 @@
distance_to_next = my_extent[RIGHT] + 1.0;
right_point = right->extent (common, X_AXIS)[LEFT];
}
-#if 0
- Real left_point = left->extent (common, X_AXIS)[RIGHT];
- Real space_left = ((right_point - left_point) >? 0.0)
- - (my_extent.is_empty () ? 0.0 : my_extent.length ());
-
- Real padding = (space_left / 2) <? 1.0;
- /*
- Put it just left of the right column, with a bit of extra space
- */
-#endif
Real my_offset = right_point - distance_to_next;
col->system_ = which;
Index: lilypond/lily/spacing-spanner.cc
diff -u lilypond/lily/spacing-spanner.cc:1.141
lilypond/lily/spacing-spanner.cc:1.142
--- lilypond/lily/spacing-spanner.cc:1.141 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/spacing-spanner.cc Wed Jul 20 14:23:41 2005
@@ -510,7 +510,6 @@
Spacing_spanner::do_measure (Rational global_shortest, Grob *me,
Link_array<Grob> *cols)
{
-
Real headwid = robust_scm2double (me->get_property ("spacing-increment"), 1);
for (int i = 0; i < cols->size () - 1; i++)
{
@@ -520,33 +519,37 @@
Paper_column *lc = dynamic_cast<Paper_column *> (l);
Paper_column *rc = dynamic_cast<Paper_column *> (r);
- if (!Paper_column::is_musical (l))
+ if (Paper_column::is_musical (l))
+ {
+ musical_column_spacing (me, lc, rc, headwid, global_shortest);
+ if (Item *rb = r->find_prebroken_piece (LEFT))
+ musical_column_spacing (me, lc, rb, headwid, global_shortest);
+ }
+ else
{
- breakable_column_spacing (me, l, r, global_shortest);
-
/*
The case that the right part is broken as well is rather
rare, but it is possible, eg. with a single empty measure,
or if one staff finishes a tad earlier than the rest.
-
*/
Item *lb = l->find_prebroken_piece (RIGHT);
Item *rb = r->find_prebroken_piece (LEFT);
- if (lb)
+ if (i == 0 && Paper_column::get_rank (l) == 0)
+ l = 0;
+
+ if (l && r)
+ breakable_column_spacing (me, l, r, global_shortest);
+
+ if (lb && r)
breakable_column_spacing (me, lb, r, global_shortest);
- if (rb)
+ if (l && rb)
breakable_column_spacing (me, l, rb, global_shortest);
+
if (lb && rb)
breakable_column_spacing (me, lb, rb, global_shortest);
}
- else
- {
- musical_column_spacing (me, lc, rc, headwid, global_shortest);
- if (Item *rb = r->find_prebroken_piece (LEFT))
- musical_column_spacing (me, lc, rb, headwid, global_shortest);
- }
}
}
@@ -564,16 +567,16 @@
Real compound_fixed_note_space = 0.0;
int wish_count = 0;
- SCM seq = lc->get_object ("right-neighbors");
+ extract_grob_set (lc, "right-neighbors", neighbors);
/*
We adjust the space following a note only if the next note
happens after the current note (this is set in the grob
property SPACING-SEQUENCE.
*/
- for (SCM s = seq; scm_is_pair (s); s = scm_cdr (s))
+ for (int i = 0; i < neighbors.size (); i++)
{
- Grob *wish = unsmob_grob (scm_car (s));
+ Grob *wish = neighbors[i];
Item *wish_rcol = Note_spacing::right_column (wish);
if (Note_spacing::left_column (wish) != lc
@@ -728,10 +731,11 @@
if (dt == Moment (0, 0))
{
- for (SCM s = l->get_object ("spacing-wishes");
- scm_is_pair (s); s = scm_cdr (s))
+ extract_grob_set (l, "spacing-wishes", wishes);
+
+ for (int i = 0; i < wishes.size (); i++)
{
- Item *spacing_grob = dynamic_cast<Item *> (unsmob_grob (scm_car (s)));
+ Item *spacing_grob = dynamic_cast<Item *> (wishes[i]);
if (!spacing_grob || !Staff_spacing::has_interface (spacing_grob))
continue;
Index: lilypond/lily/spanner.cc
diff -u lilypond/lily/spanner.cc:1.135 lilypond/lily/spanner.cc:1.136
--- lilypond/lily/spanner.cc:1.135 Tue Jul 19 00:41:14 2005
+++ lilypond/lily/spanner.cc Wed Jul 20 14:23:41 2005
@@ -153,9 +153,9 @@
Interval_t<int> iv (0, 0);
if (spanned_drul_[LEFT] && spanned_drul_[LEFT]->get_column ())
- iv[LEFT] = Paper_column::get_rank (spanned_drul_[LEFT]->get_column ());
+ iv[LEFT] = spanned_drul_[LEFT]->get_column ()->get_rank ();
if (spanned_drul_[RIGHT] && spanned_drul_[RIGHT]->get_column ())
- iv[RIGHT] = Paper_column::get_rank (spanned_drul_[RIGHT]->get_column ());
+ iv[RIGHT] = spanned_drul_[RIGHT]->get_column ()->get_rank ();
return iv;
}
Index: lilypond/lily/tie-column.cc
diff -u lilypond/lily/tie-column.cc:1.47 lilypond/lily/tie-column.cc:1.48
--- lilypond/lily/tie-column.cc:1.47 Sat Jul 16 12:23:33 2005
+++ lilypond/lily/tie-column.cc Wed Jul 20 14:23:41 2005
@@ -162,8 +162,8 @@
Direction dir = LEFT;
do
{
- if (dir * Paper_column::get_rank (tie->get_bound (dir)->get_column ())
- > dir * Paper_column::get_rank (me->get_bound (dir)->get_column
()))
+ if (dir * tie->get_bound (dir)->get_column ()->get_rank ()
+ > dir * me->get_bound (dir)->get_column ()->get_rank ())
{
me->set_bound (dir, Tie::head (tie, dir));
}
Index: lilypond/scm/output-socket.scm
diff -u lilypond/scm/output-socket.scm:1.7 lilypond/scm/output-socket.scm:1.8
--- lilypond/scm/output-socket.scm:1.7 Wed Jul 13 20:24:49 2005
+++ lilypond/scm/output-socket.scm Wed Jul 20 14:23:41 2005
@@ -54,7 +54,7 @@
(cond
((ly:music? cause) cause)
- ((ly:grob? cause) (music-cause cause))
+; ((ly:grob? cause) (music-cause cause))
(else
#f))))
_______________________________________________
Lilypond-cvs mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-cvs