]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Feb 2004 22:56:56 +0000 (22:56 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 24 Feb 2004 22:56:56 +0000 (22:56 +0000)
VERSION
lily/stanza-number-align-engraver.cc [new file with mode: 0644]

diff --git a/VERSION b/VERSION
index 2dfd00af372753108cfbc0bbeef61e08fc651cc7..a29934318337f4af2ab7992baff454fc4cf83c20 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1,6 +1,6 @@
 PACKAGE_NAME=LilyPond
 MAJOR_VERSION=2
 MINOR_VERSION=1
-PATCH_LEVEL=26
-MY_PATCH_LEVEL=hwn1
+PATCH_LEVEL=27
+MY_PATCH_LEVEL=
 
diff --git a/lily/stanza-number-align-engraver.cc b/lily/stanza-number-align-engraver.cc
new file mode 100644 (file)
index 0000000..3115ac3
--- /dev/null
@@ -0,0 +1,68 @@
+
+/*   
+stanza-number-align-engraver.cc --  implement 
+
+source file of the GNU LilyPond music typesetter
+
+(c) 2004 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ */
+
+
+#include "context.hh"
+#include "engraver.hh"
+#include "note-head.hh"
+#include "lyric-extender.hh"
+#include "item.hh"
+#include "group-interface.hh"
+#include "side-position-interface.hh"
+
+
+class Stanza_number_align_engraver : public Engraver
+{
+public:  
+  TRANSLATOR_DECLARATIONS(Stanza_number_align_engraver);
+
+protected:  
+  Link_array<Grob> lyrics_;
+  Link_array<Grob> stanza_numbers_;
+  virtual void acknowledge_grob (Grob_info);
+  virtual void stop_translation_timestep ();
+};
+
+Stanza_number_align_engraver::Stanza_number_align_engraver ()
+{
+  
+}
+
+void
+Stanza_number_align_engraver::acknowledge_grob (Grob_info gi)
+{
+  Grob *h = gi.grob_;
+  
+  if (h->internal_has_interface (ly_symbol2scm ("lyric-syllable-interface")))
+    lyrics_.push (h);
+  else if (h->internal_has_interface (ly_symbol2scm ("stanza-number-interface")))
+    stanza_numbers_.push (h);
+}
+
+void
+Stanza_number_align_engraver::stop_translation_timestep ()
+{
+  for (int i= lyrics_.size(); i--;)
+    for (int j = stanza_numbers_.size (); j--;)
+      Side_position_interface::add_support (stanza_numbers_[j], lyrics_[i]);
+  
+  stanza_numbers_.clear ();
+  lyrics_.clear ();
+}
+
+
+ENTER_DESCRIPTION(Stanza_number_align_engraver,
+                 "This engraver ensures that stanza numbers are neatly aligned. ",
+                 "",
+                 "",
+                 "stanza-number-interface lyric-syllable-interface ",
+                 "",
+                 "");
+