source file of the GNU LilyPond music typesetter
- (c) 1999--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1999--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "music.hh"
#include "auto-change-iterator.hh"
#include "translator-group.hh"
-#include "musical-request.hh"
+#include "event.hh"
void
-Auto_change_iterator::change_to (Music_iterator *it, String to_type,
+Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
String to_id)
{
Translator_group * current = it->report_to ();
If \translator Staff = bass, then look for Staff = *
*/
- while (current && current->type_string_ != to_type)
+ while (current && !current->is_alias_b (to_type_sym))
{
last = current;
current = current->daddy_trans_;
if (last)
{
Translator_group * dest =
- it->report_to ()->find_create_translator (to_type, to_id);
+ it->report_to ()->find_create_translator (to_type_sym, to_id);
current->remove_translator (last);
dest->add_used_group_translator (last);
}
{
SCM muses = iter->get_pending_events (m);
for (SCM s = muses; gh_pair_p (s); s=ly_cdr (s))
- if (Note_req* nr = dynamic_cast<Note_req*> (unsmob_music (ly_car (s))))
- {
- ps.push (*unsmob_pitch (nr->get_mus_property ("pitch")));
- }
-
+ {
+ Music * m = unsmob_music (ly_car (s));
+ if (m && m->is_mus_type ("note-event"))
+ {
+ ps.push (*unsmob_pitch (m->get_mus_property ("pitch")));
+ }
+ }
+
if (ps.size ())
break;
{
where_dir_ = s;
String to_id = (s >= 0) ? "up" : "down";
- String wh = ly_scm2string (get_music ()->get_mus_property ("what"));
- change_to (child_iter_, wh, to_id);
+ change_to (child_iter_, get_music ()->get_mus_property ("what"), to_id);
}
}
}