2 output-property-engraver.cc -- implement Output_property_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "output-property.hh"
11 #include "engraver.hh"
13 class Output_property_engraver
: public Engraver
16 Output_property_engraver();
17 VIRTUAL_COPY_CONS(Translator
);
20 Link_array
<Output_property
> props_
;
22 virtual void do_acknowledge_element (Score_element_info
);
23 virtual bool do_try_music (Music
*);
27 Output_property_engraver::do_try_music (Music
* m
)
29 if (Output_property
* o
= dynamic_cast<Output_property
*> (m
))
38 Output_property_engraver::do_acknowledge_element (Score_element_info i
)
40 for (int i
=props_
.size (); i
--; )
42 Output_property
* o
= props_
[i
];
43 SCM pred
= gh_car (o
->pred_sym_val_list_
);
45 should typecheck pred.
47 SCM result
=gh_apply (pred
,
48 gh_listify (i
.elem_l_
->self_scm_
, SCM_UNDEFINED
));
49 if (to_boolean (result
))
51 i
.elem_l_
->set_elt_property (gh_cadr (o
->pred_sym_val_list_
),
52 gh_caddr (o
->pred_sym_val_list_
));
58 Output_property_engraver::do_pre_move_processing ()