2 figured-bass-engraver.cc -- implement Figured_bass_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
11 #include "text-item.hh"
14 #include "translator-group.hh"
16 class Figured_bass_engraver : public Engraver
18 TRANSLATOR_DECLARATIONS(Figured_bass_engraver);
20 Link_array<Music> figures_;
25 virtual bool try_music (Music*);
26 virtual void stop_translation_timestep ();
27 virtual void process_music ();
31 Figured_bass_engraver::Figured_bass_engraver()
38 Figured_bass_engraver::stop_translation_timestep ()
42 typeset_grob (figure_);
51 Figured_bass_engraver::try_music (Music*m)
53 if (m->is_mus_type ("bass-figure-event"))
58 else if (m->is_mus_type ("rest-event"))
67 Figured_bass_engraver::process_music ()
71 figure_ = make_item ("BassFigure");
72 announce_grob(figure_, rest_req_->self_scm()); // todo
73 figure_->set_grob_property ("text" , scm_makfrom0str ("-"));
75 else if (figures_.size ())
77 SCM proc = get_property ("bassFigureFormatFunction");
78 if (gh_procedure_p (proc))
82 for (int i = 0; i <figures_.size (); i++)
83 l = gh_cons (figures_[i]->self_scm(), l);
85 SCM markup = scm_call_2 (proc, l, daddy_trans_->self_scm ());
87 figure_ = make_item ("BassFigure");
88 figure_->set_grob_property ("text", markup);
89 announce_grob(figure_, figures_[0]->self_scm()); // todo
95 ENTER_DESCRIPTION(Figured_bass_engraver,
96 /* descr */ "Make figured bass numbers.",
97 /* creats*/ "BassFigure",
98 /* accepts */ "rest-event bass-figure-event",
100 /* reads */ "bassFigureFormatFunction",