X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fpart-combine-engraver.cc;h=d8e1f7640975ca7967d7d077655123670febf9ab;hb=b7a0cffbf9d1069860368f289a5b50e9d1d90ba8;hp=3196ffa4d09b9c39e9e1048c55eca5202a220c27;hpb=7f6816438d66f6d70db5b68454d80656a0f3f131;p=lilypond.git diff --git a/lily/part-combine-engraver.cc b/lily/part-combine-engraver.cc index 3196ffa4d0..d8e1f76409 100644 --- a/lily/part-combine-engraver.cc +++ b/lily/part-combine-engraver.cc @@ -1,41 +1,56 @@ /* - part-combine-engraver.cc -- implement PC-engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter - - (c) 2000--2005 Jan Nieuwenhuizen + Copyright (C) 2000--2009 Jan Nieuwenhuizen Han-Wen Nienhuys + + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "engraver.hh" -#include "text-interface.hh" +#include "multi-measure-rest.hh" #include "note-head.hh" -#include "stem.hh" #include "side-position-interface.hh" -#include "multi-measure-rest.hh" +#include "stem.hh" +#include "stream-event.hh" +#include "text-interface.hh" +#include "item.hh" + +#include "translator.icc" class Part_combine_engraver : public Engraver { TRANSLATOR_DECLARATIONS (Part_combine_engraver); protected: - DECLARE_ACKNOWLEDGER(note_head); - DECLARE_ACKNOWLEDGER(stem); - + DECLARE_ACKNOWLEDGER (note_head); + DECLARE_ACKNOWLEDGER (stem); + + DECLARE_TRANSLATOR_LISTENER (part_combine); void process_music (); void stop_translation_timestep (); - virtual bool try_music (Music *); private: Item *text_; - Music *event_; + Stream_event *event_; }; -bool -Part_combine_engraver::try_music (Music *m) +IMPLEMENT_TRANSLATOR_LISTENER (Part_combine_engraver, part_combine); +void +Part_combine_engraver::listen_part_combine (Stream_event *ev) { - event_ = m; - return true; + ASSIGN_EVENT_ONCE (event_, ev); } Part_combine_engraver::Part_combine_engraver () @@ -50,16 +65,16 @@ Part_combine_engraver::process_music () if (event_ && to_boolean (get_property ("printPartCombineTexts"))) { - SCM what = event_->get_property ("part-combine-status"); + SCM what = event_->get_property ("class"); SCM text = SCM_EOL; - if (what == ly_symbol2scm ("solo1")) + if (what == ly_symbol2scm ("solo-one-event")) text = get_property ("soloText"); - else if (what == ly_symbol2scm ("solo2")) + else if (what == ly_symbol2scm ("solo-two-event")) text = get_property ("soloIIText"); - else if (what == ly_symbol2scm ("unisono")) + else if (what == ly_symbol2scm ("unisono-event")) text = get_property ("aDueText"); - if (Text_interface::markup_p (text)) + if (Text_interface::is_markup (text)) { text_ = make_item ("CombineTextScript", event_->self_scm ()); text_->set_property ("text", text); @@ -84,7 +99,7 @@ void Part_combine_engraver::acknowledge_stem (Grob_info i) { if (text_) - Side_position_interface::add_support (text_, i.grob ()); + Side_position_interface::add_support (text_, i.grob ()); } void @@ -94,14 +109,22 @@ Part_combine_engraver::stop_translation_timestep () event_ = 0; } -#include "translator.icc" -ADD_ACKNOWLEDGER(Part_combine_engraver, note_head); -ADD_ACKNOWLEDGER(Part_combine_engraver, stem); +ADD_ACKNOWLEDGER (Part_combine_engraver, note_head); +ADD_ACKNOWLEDGER (Part_combine_engraver, stem); ADD_TRANSLATOR (Part_combine_engraver, - /* descr */ "Part combine engraver for orchestral scores: " - "Print markings a2, Solo, Solo II, and unisono ", - /* creats*/ "CombineTextScript", - /* accepts */ "part-combine-event", - /* reads */ "printPartCombineTexts soloText soloIIText " - "aDueText", - /* write */ ""); + /* doc */ + "Part combine engraver for orchestral scores: Print markings" + " @q{a2}, @q{Solo}, @q{Solo II}, and @q{unisono}.", + + /* create */ + "CombineTextScript ", + + /* read */ + "printPartCombineTexts " + "soloText " + "soloIIText " + "aDueText ", + + /* write */ + "" + );