From: Han-Wen Nienhuys Date: Sun, 28 Sep 2003 20:34:45 +0000 (+0000) Subject: * lily/midi-stream.cc (operator <<): rewrite. X-Git-Tag: release/2.0.1~6 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=75a8703aa16cee634e7c817036e3112584f332f5;p=lilypond.git * lily/midi-stream.cc (operator <<): rewrite. * lily/note-head.cc (internal_brew_molecule): only make ledgers when the Staff symbol has lines. --- diff --git a/ChangeLog b/ChangeLog index 0158c935a8..b498fc0e59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2003-09-28 Han-Wen Nienhuys + * lily/midi-stream.cc (operator <<): rewrite. + + * lily/note-head.cc (internal_brew_molecule): + only make ledgers when the Staff symbol has lines. + * ly/property-init.ly (arpeggioBracket): simplify * lily/translator-group.cc (execute_pushpop_property): use diff --git a/Documentation/user/refman.itely b/Documentation/user/refman.itely index 1a00120e02..7ea49d592e 100644 --- a/Documentation/user/refman.itely +++ b/Documentation/user/refman.itely @@ -1197,10 +1197,11 @@ small, short-lived voices or for single chords: } @end lilypond -The separator causes @internalsref{Voice} contexts to be -instantiated. They -bear the names @code{"1"}, @code{"2"}, etc. In each of these -contexts, vertical direction of slurs, stems, etc. is set +The separator causes @internalsref{Voice} contexts@footnote{Polyphonic +voices are sometimes called "layers" other notation packages} +@cindex layers +to be instantiated. They bear the names @code{"1"}, @code{"2"}, etc. In +each of these contexts, vertical direction of slurs, stems, etc. is set appropriately. This can also be done by instantiating @internalsref{Voice} contexts diff --git a/lily/key-signature-interface.cc b/lily/key-signature-interface.cc index 762e703fae..76817e5e4b 100644 --- a/lily/key-signature-interface.cc +++ b/lily/key-signature-interface.cc @@ -50,6 +50,8 @@ const int NATURAL_TOP_PITCH = 4; - lots of values trivially shared (key doesn't change very often). Compute those once, and use that as cache for the rest. + TODO: can we do without c0pos? it's partly musical. + */ int alteration_pos (SCM what, int alter, int c0p) diff --git a/lily/midi-item.cc b/lily/midi-item.cc index db6bdc12c1..2452a46951 100644 --- a/lily/midi-item.cc +++ b/lily/midi-item.cc @@ -231,14 +231,6 @@ Moment Midi_note::get_length () const { Moment m = audio_->length_mom_; -#if 0 - //junkme? - if (m < Moment (Rational (1, 1000))) - { - warning (_ ("silly duration")); - m = 1; - } -#endif return m; } diff --git a/lily/midi-stream.cc b/lily/midi-stream.cc index 221658a71d..d733305228 100644 --- a/lily/midi-stream.cc +++ b/lily/midi-stream.cc @@ -31,17 +31,16 @@ Midi_stream::~Midi_stream () Midi_stream& Midi_stream::operator << (String str) { - Byte *b = str.get_bytes (); -#if 0 - for (int sz = str.length (); sz--;) + size_t sz = sizeof (Byte); + size_t n = str.length (); + size_t written = fwrite (str.get_bytes (), + sz, n, out_file_); + + if (written != sz * n) { - fputc (*b, out_file_); - b++; + warning ("Could not write file. Disk full?"); } -#else - for (int i = 0, n = str.length (); i < n; i++) - fputc (b[i], out_file_); -#endif + return *this; } diff --git a/lily/note-head.cc b/lily/note-head.cc index 4c291ae32d..1bf1ed66c5 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -69,12 +69,12 @@ Note_head::brew_ledger_lines (Grob *me, bool take_space) { Real inter_f = Staff_symbol_referencer::staff_space (me)/2; - int lines_i = abs (pos) < interspaces + int line_count = (abs (pos) < interspaces) ? 0 : (abs (pos) - interspaces) / 2; Molecule molecule = Molecule(); - if (lines_i) + if (line_count) { Real ledgerlinethickness = (me->get_paper ()->get_realvar (ly_symbol2scm ("ledgerlinethickness"))); @@ -95,7 +95,7 @@ Note_head::brew_ledger_lines (Grob *me, Real offs = (Staff_symbol_referencer::on_staffline (me, pos)) ? 0.0 : -dir * inter_f; - for (int i = 0; i < lines_i; i++) + for (int i = 0; i < line_count; i++) { Molecule ledger_line (proto_ledger_line); ledger_line.translate_axis (-dir * inter_f * i * 2 + offs, Y_AXIS); @@ -129,7 +129,8 @@ internal_brew_molecule (Grob *me, bool ledger_take_space) int interspaces = Staff_symbol_referencer::line_count (me)-1; int pos = (int)rint (Staff_symbol_referencer::get_position (me)); - if (abs (pos) - interspaces > 1) + if (interspaces >= 0 + && abs (pos) - interspaces > 1) { Interval hd = out.extent (X_AXIS); Real left_ledger_protusion = hd.length ()/4; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index 7135a0d92a..b71c5787fc 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -741,7 +741,7 @@ (RepeatSlash . ( - (molecule-callback . , Percent_repeat_item_interface::beat_slash) + (molecule-callback . ,Percent_repeat_item_interface::beat_slash) (thickness . 0.48) (slope . 1.7) (meta . ((interfaces . (percent-repeat-interface item-interface ))))