[ << Programming work ] | [Top][Contents] | [ Release work >> ] |
[ < Translation process ] | [ Up : Engraver tutorial ] | [ Acknowledging grobs > ] |
10.12.3 Listening to music events
External interfaces to the engraver are implemented by protected macros including one or more of the following:
-
DECLARE_TRANSLATOR_LISTENER (event_name)
-
IMPLEMENT_TRANSLATOR_LISTENER (Engraver_name, event_name)
where event_name is the type of event required to provide the input the engraver needs and Engraver_name is the name of the engraver.
Following declaration of a listener, the method is implemented as follows:
IMPLEMENT_TRANSLATOR_LISTENER (Engraver_name, event_name) void Engraver_name::listen_event_name (Stream event *event) { ...body of listener method... }