2 figured-bass-engraver.cc -- implement Figured_bass_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2002--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
11 #include "text-item.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 ()
47 Figured_bass_engraver::try_music (Music*m)
49 if (m->is_mus_type ("bass-figure-event"))
54 else if (m->is_mus_type ("rest-event"))
63 Figured_bass_engraver::process_music ()
67 figure_ = make_item ("BassFigure", rest_req_->self_scm ());
68 figure_->set_property ("text" , scm_makfrom0str ("-"));
70 else if (figures_.size ())
72 SCM proc = get_property ("bassFigureFormatFunction");
73 if (ly_c_procedure_p (proc))
77 for (int i = 0; i < figures_.size (); i++)
79 *t = scm_cons (figures_[i]->self_scm (), SCM_EOL);
82 figure_ = make_item ("BassFigure", figures_[0]->self_scm ());
83 scm_call_3 (proc, l, context ()->self_scm (),
84 figure_->self_scm ());
90 ENTER_DESCRIPTION (Figured_bass_engraver,
91 /* descr */ "Make figured bass numbers.",
92 /* creats*/ "BassFigure",
93 /* accepts */ "rest-event bass-figure-event",
95 /* reads */ "bassFigureFormatFunction",