origin location.
* lily/tuplet-bracket.cc (parallel_beam): robustness check, don't
fail if a beam doesn't have stems.
* lily/engraver-group-engraver.cc (do_announces): scary change in
calling convention of create_grobs(): no create_grobs() call
before acknowledge_grobs().
* lily/sequential-music-iterator.cc (skip): add support for grace
notes.
2002-06-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ * lily/grob.cc (programming_error): add programming_error with
+ origin location.
+
+ * lily/tuplet-bracket.cc (parallel_beam): robustness check, don't
+ fail if a beam doesn't have stems.
+
+ * lily/engraver-group-engraver.cc (do_announces): scary change in
+ calling convention of create_grobs(): no create_grobs() call
+ before acknowledge_grobs().
+
+ * lily/sequential-music-iterator.cc (skip): add support for grace
+ notes.
+
* lily/music.cc (Music): fix very subtle and nasty memory
- corruption bug.
+ corruption bug. Typical symptom: "programming_error: Rhythmic_req
+ has no duration"
* mutopia/claop.py: new file: CLA(O)P II by Peter Wallin.
@lilypondfile[printfilename]{grace-sync.ly}
+@lilypondfile[printfilename]{grace-part-combine.ly}
+
@lilypondfile[printfilename]{grace-bar-number.ly}
--- /dev/null
+\header {
+ texidoc = "partcombiner and grace notes can go together"
+}
+
+\score {
+ \context StaffGroup = group <
+ \context Staff = instrument <
+ \context Voice=one \partcombine Voice
+ \context Thread=one \notes \relative c'' {
+ c4 d e f \grace f16 g1
+ }
+ \context Thread=two \notes \relative c' {
+ c4 d e2 g1
+ }
+ >
+ >
+}
dynamic_cast<Engraver_group_engraver*> (t)->do_announces ();
}
- create_grobs_in_simple_children ();
+ // create_grobs_in_simple_children ();
while (announce_info_arr_.size ())
{
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+#include <stdio.h>
#include "debug.hh"
#include "music.hh"
}
w = sneaky_insert_extra_moment (w);
+
+ // printf ("proccing %s\n ", w.str().ch_C());
- // cout << "Proccing " << w << endl;
if (first)
}
void
-Grob::warning (String s)
+Grob::warning (String s)const
{
SCM cause = self_scm();
while (cause != SCM_EOL && !unsmob_music (cause))
}
else
::warning (s);
-
+}
+
+void
+Grob::programming_error (String s)const
+{
+ s = "Programming error: " + s;
+ warning (s);
}
SCM internal_get_grob_property (SCM) const;
void internal_set_grob_property (SCM, SCM val);
- void warning (String);
+ void warning (String)const;
+ void programming_error (String)const;
void set_elt_pointer (const char*, SCM val);
friend class Property_engraver; // UGHUGHUGH.
return false;
if (!dynamic_cast<Item*> (me))
- programming_error ("only items can be breakable.");
+ me->programming_error ("only items can be breakable.");
Item * i =dynamic_cast<Item*> (me->get_parent (X_AXIS));
return (i) ? Item::breakable_b (i) : to_boolean (me->get_grob_property ("breakable"));
#include "sequential-music-iterator.hh"
#include "music-list.hh"
+Grace_fixup *copy_grace_fixups (Grace_fixup* src);
+Grace_fixup *get_grace_fixups (SCM cursor);
/*
Sequential_music_iterator::Sequential_music_iterator (Sequential_music_iterator const &src)
: Music_iterator (src)
{
- grace_fixups_ = src.grace_fixups_;
+ grace_fixups_ = copy_grace_fixups (src.grace_fixups_);
cursor_ = src.cursor_;
here_mom_ = src.here_mom_;
if (src.iter_p_)
}
-/*
-
-
- if (start_music.grace)
- here.grace -= start_music.grace
-
- last
- if (len
-
- */
-
Grace_fixup *
get_grace_fixups (SCM cursor)
{
return head;
}
+Grace_fixup *
+copy_grace_fixups (Grace_fixup* src)
+{
+
+ Grace_fixup * head = 0;
+ Grace_fixup **dest = &head;
+
+ while (src)
+ {
+ *dest = new Grace_fixup (*src);
+ dest = & (*dest)->next_;
+ src = src ->next_;
+ }
+
+ return head;
+}
+
void
Sequential_music_iterator::construct_children ()
{
descending to child iterator contexts, because they might depend on
\context specs and \translator changes being executed
- TODO: build support for grace notes here.
+ TODO: check support for grace notes here.
*/
void
Sequential_music_iterator::skip (Moment until)
{
while (ok ())
{
- Moment l =iter_p_->music_length_mom ();
- if (l >= until - here_mom_)
- iter_p_->skip (until - here_mom_);
+ if (grace_fixups_ &&
+ grace_fixups_->start_ == here_mom_
+ && (grace_fixups_->start_ + grace_fixups_->length_
+ + Moment (Rational (0), grace_fixups_->grace_start_) == until))
+ {
+ /*
+ do the stuff/note/rest preceding a grace.
+ */
+ iter_p_->skip (iter_p_->music_length_mom ());
+ }
+ else if (iter_p_->music_length_mom () >= until - here_mom_)
+ iter_p_->skip (until - here_mom_ + iter_p_->music_start_mom ());
if (iter_p_->ok ())
return ;
Link_array<Grob> beam_stems = Pointer_group_interface__extract_grobs
(b1, (Grob*)0, "stems");
+ if (beam_stems.size() == 0)
+ {
+ programming_error ("Beam under tuplet bracket has no stems!");
+ *equally_long = 0;
+ return 0;
+ }
*equally_long = (beam_stems[0] == s1 && beam_stems.top() == s2);
return b1;