X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=lily%2Ffingering-engraver.cc;h=355e102c6f4f4b7e31be2a7f8fcca1d6e4001a74;hb=efbdfc972f673abbd19fa6b177edb3398ccf804f;hp=f469df8139484e59fa2619ee8ac38bcf5ab8e4f2;hpb=bd78c003160e138bc3118ee8ede5929d6011d58e;p=lilypond.git diff --git a/lily/fingering-engraver.cc b/lily/fingering-engraver.cc index f469df8139..355e102c6f 100644 --- a/lily/fingering-engraver.cc +++ b/lily/fingering-engraver.cc @@ -1,9 +1,20 @@ /* - fingering-engraver.cc -- implement Fingering_engraver + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 1998--2012 Han-Wen Nienhuys - (c) 1998--2006 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" @@ -13,13 +24,14 @@ #include "side-position-interface.hh" #include "stem.hh" #include "stream-event.hh" +#include "item.hh" #include "translator.icc" class Fingering_engraver : public Engraver { - vector events_; - vector fingerings_; + vector events_; + vector fingerings_; public: TRANSLATOR_DECLARATIONS (Fingering_engraver); @@ -27,6 +39,7 @@ protected: void stop_translation_timestep (); void process_music (); DECLARE_TRANSLATOR_LISTENER (fingering); + DECLARE_TRANSLATOR_LISTENER (stroke_finger); DECLARE_ACKNOWLEDGER (rhythmic_head); DECLARE_ACKNOWLEDGER (stem); @@ -41,6 +54,17 @@ Fingering_engraver::listen_fingering (Stream_event *ev) events_.push_back (ev); } +IMPLEMENT_TRANSLATOR_LISTENER (Fingering_engraver, stroke_finger); +void +Fingering_engraver::listen_stroke_finger (Stream_event * /* ev */) +{ + /* + FIXME: should do something. + + This function is mainly here to shut up a warning + */ +} + void Fingering_engraver::acknowledge_stem (Grob_info inf) { @@ -56,7 +80,7 @@ Fingering_engraver::acknowledge_rhythmic_head (Grob_info inf) Grob *t = fingerings_[i]; Side_position_interface::add_support (t, inf.grob ()); if (!t->get_parent (X_AXIS)) - t->set_parent (inf.grob (), X_AXIS); + t->set_parent (inf.grob (), X_AXIS); } } @@ -103,12 +127,12 @@ Fingering_engraver::make_script (Direction d, Stream_event *r, int i) fingering->set_property ("script-priority", scm_from_int (priority)); - if (!is_direction (fingering->get_property_data (ly_symbol2scm ("direction")))) + if (!is_direction (fingering->get_property_data ("direction"))) { if (d) - fingering->set_property ("direction", scm_from_int (d)); + fingering->set_property ("direction", scm_from_int (d)); else - fingering->set_property ("direction", scm_from_int (RIGHT)); + fingering->set_property ("direction", scm_from_int (RIGHT)); } fingerings_.push_back (fingering); @@ -117,9 +141,6 @@ Fingering_engraver::make_script (Direction d, Stream_event *r, int i) void Fingering_engraver::stop_translation_timestep () { - if (!fingerings_.size ()) - return; - fingerings_.clear (); events_.clear (); } @@ -130,9 +151,17 @@ Fingering_engraver::Fingering_engraver () ADD_ACKNOWLEDGER (Fingering_engraver, rhythmic_head); ADD_ACKNOWLEDGER (Fingering_engraver, stem); + ADD_TRANSLATOR (Fingering_engraver, - /* doc */ "Create fingering-scripts", - /* create */ "Fingering", - /* accept */ "fingering-event", - /* read */ "", - /* write */ ""); + /* doc */ + "Create fingering scripts.", + + /* create */ + "Fingering ", + + /* read */ + "", + + /* write */ + "" + );