X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fscore-engraver.cc;h=eff35efed4173fb2666a69a383970d569f5b495a;hb=cb01be4028886109ecc4772234452965ce7dfb66;hp=b6c79d01588f57eeff3980742f534a1c8253d2fb;hpb=b3cf2199183a184c7eef9a9f8f3c9a691db1f0ad;p=lilypond.git diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index b6c79d0158..eff35efed4 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Han-Wen Nienhuys + (c) 1997--2009 Han-Wen Nienhuys */ #include "score-engraver.hh" @@ -20,7 +20,6 @@ #include "paper-column-engraver.hh" #include "paper-column.hh" #include "paper-score.hh" -#include "stream-event.hh" #include "system.hh" #include "warn.hh" @@ -35,7 +34,6 @@ Score_engraver::derived_mark () const { if (pscore_) scm_gc_mark (pscore_->self_scm ()); - Score_translator::derived_mark (); Engraver_group::derived_mark (); } @@ -77,11 +75,11 @@ Score_engraver::initialize () pscore_ = new Paper_score (dynamic_cast (context ()->get_output_def ())); pscore_->unprotect (); + context ()->set_property ("output", pscore_->self_scm ()); SCM props = updated_grob_properties (context (), ly_symbol2scm ("System")); - Object_key const *sys_key = context ()->get_grob_key ("System"); - pscore_->typeset_system (new System (props, sys_key)); + pscore_->typeset_system (new System (props)); system_ = pscore_->root_system (); context ()->set_property ("rootSystem", system_->self_scm ()); @@ -100,6 +98,20 @@ Score_engraver::connect_to_context (Context *c) d->add_listener (GET_LISTENER (finish), ly_symbol2scm ("Finish")); } +/* + uncovered: + + check_removal always returns false for Score contexts, it has been that way +since I joined the project. There is a reason for this: The typeset score is +stored in the Score_engraver, which in turn is accessed through the +Global_context returned by ly:run-translator. So the score-translator must be +connected to the score-context after run-translator finishes. + +I plan to change this: we should junk run-translator, and instead keep track +of both context and translator in the SCM code, and access the typeset score +directly via the created global-translator. Then it would be possible to +disconnect score-translators at iteration time. -es + */ void Score_engraver::disconnect_from_context () { @@ -114,12 +126,12 @@ Score_engraver::disconnect_from_context () void Score_engraver::finalize () { - Score_translator::finalize (); + Engraver_group::finalize (); typeset_all (); } -IMPLEMENT_LISTENER(Score_engraver, one_time_step); +IMPLEMENT_LISTENER (Score_engraver, one_time_step); void Score_engraver::one_time_step (SCM) { @@ -157,41 +169,29 @@ Score_engraver::typeset_all () elems_.clear (); } -SCM -Score_engraver::get_output () -{ - Music_output *o = pscore_; - return o->self_scm (); -} - -bool -Score_engraver::try_music (Music *m) -{ - if (Engraver_group::try_music (m)) - return true; - - return false; -} - ADD_TRANSLATOR_GROUP (Score_engraver, - /* doc */ "Top level engraver. Takes care of generating columns and the complete system (ie. System) " - "\n\n " - "This engraver decides whether a column is breakable. The default is " - "that a column is always breakable. However, every Bar_engraver " - "that does not have a barline at a certain point will set " - "forbidBreaks to stop linebreaks. In practice, this " - "means that you can make a breakpoint by creating a barline (assuming " - "that there are no beams or notes that prevent a breakpoint.) ", + /* doc */ + "The top-level engraver. Takes care of generating" + " columns and the complete system (i.e.," + " @code{System}).\n" + "\n" + "This engraver decides whether a column is breakable." + " The default is that a column is always breakable." + " However, every @code{Bar_engraver} that does not have" + " a bar line at a certain point sets @code{forbidBreaks}" + " to stop line breaks. In practice, this means that you" + " can make a break point by creating a bar line" + " (assuming that there are no beams or notes that" + " prevent a break point).", + /* create */ "System ", - - /* accept */ - "break-event", /* read */ "currentMusicalColumn " "currentCommandColumn " - "verticallySpacedContexts", + "verticallySpacedContexts ", /* write */ - ""); + "" + );