From: fred Date: Wed, 9 Apr 1997 22:16:53 +0000 (+0000) Subject: lilypond-0.0.50 X-Git-Tag: release/1.5.59~6154 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8bcdbfa22613e5c27d978e2d47dda231a230f67a;p=lilypond.git lilypond-0.0.50 --- diff --git a/lily/include/note-column-reg.hh b/lily/include/note-column-reg.hh new file mode 100644 index 0000000000..01a860911d --- /dev/null +++ b/lily/include/note-column-reg.hh @@ -0,0 +1,27 @@ +/* + note-column-reg.hh -- declare Note_column_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + + +#ifndef NOTE_COLUMN_REG_HH +#define NOTE_COLUMN_REG_HH + +#include "register.hh" + +class Note_column_register :public Request_register { + Note_column *ncol_p_; + /* *************** */ + bool acceptable_elem_b(Staff_elem const*)const; +protected: + virtual void acknowledge_element(Staff_elem_info); + virtual void pre_move_processing(); + +public: + Note_column_register(); + NAME_MEMBERS(Note_column_register); +}; +#endif // NOTE_COLUMN_REG_HH diff --git a/lily/note-column-reg.cc b/lily/note-column-reg.cc new file mode 100644 index 0000000000..1263ca1c6a --- /dev/null +++ b/lily/note-column-reg.cc @@ -0,0 +1,55 @@ +/* + note-column-reg.cc -- implement Note_column_register + + source file of the LilyPond music typesetter + + (c) 1997 Han-Wen Nienhuys +*/ + +#include "note-column-reg.hh" +#include "notehead.hh" +#include "stem.hh" +#include "note-column.hh" +#include "script.hh" + +bool +Note_column_register::acceptable_elem_b(Staff_elem const*elem_C)const +{ + char const*nC = elem_C->name(); + return (nC == Script::static_name() || nC == Notehead::static_name() + || nC == Stem::static_name()); +} + +void +Note_column_register::acknowledge_element(Staff_elem_info i) +{ + if (!acceptable_elem_b(i.elem_l_)) + return; + + if (!ncol_p_) + ncol_p_ = new Note_column; + + char const*nC = i.elem_l_->name(); + + if (nC == Script::static_name()) + ncol_p_->add((Script*)i.elem_l_); + else if (nC == Notehead::static_name()) + ncol_p_->add((Notehead*)i.elem_l_); + else if (nC == Stem::static_name()) + ncol_p_->add((Stem*)i.elem_l_); +} + +void +Note_column_register::pre_move_processing() +{ + if (ncol_p_) { + typeset_element(ncol_p_); + ncol_p_ =0; + } +} +Note_column_register::Note_column_register() +{ + ncol_p_=0; +} +IMPLEMENT_STATIC_NAME(Note_column_register); +ADD_THIS_REGISTER(Note_column_register);