]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/mark-engraver.cc
* lily/relocate.cc (setup_paths): only check path for non-absolute
[lilypond.git] / lily / mark-engraver.cc
index a770cf2001c28093ac517e43daa63ef1ed55c541..e1044aff92a9a898655bb7c5564ea761368bbf35 100644 (file)
@@ -7,13 +7,17 @@
 */
 
 #include <cctype>
+using namespace std;
+
+#include "engraver.hh"
 
 #include "bar-line.hh"
 #include "context.hh"
-#include "engraver-group-engraver.hh"
 #include "item.hh"
 #include "warn.hh"
 #include "text-interface.hh"
+#include "grob-array.hh"
+#include "axis-group-interface.hh"
 
 /**
    put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
 */
 class Mark_engraver : public Engraver
 {
+
+  void create_items (Music *);
+  Item *text_;
+  Music *mark_ev_;
+
 public:
   TRANSLATOR_DECLARATIONS (Mark_engraver);
+
 protected:
-  Item *text_;
-protected:
-  void stop_translation_timestep ();
-  DECLARE_ACKNOWLEDGER (bar_line);
-  void create_items (Music *);
   virtual bool try_music (Music *ev);
   void process_music ();
+  void stop_translation_timestep ();
 
-private:
-  Music *mark_ev_;
+  DECLARE_ACKNOWLEDGER (break_aligned);
 };
 
 Mark_engraver::Mark_engraver ()
@@ -43,15 +48,17 @@ Mark_engraver::Mark_engraver ()
 }
 
 void
-Mark_engraver::acknowledge_bar_line (Grob_info inf)
+Mark_engraver::acknowledge_break_aligned (Grob_info inf)
 {
   Grob *s = inf.grob ();
-  if (text_)
+  if (text_
+      && (get_property ("rehearsalMarkAlignSymbol")
+         == s->get_property ("break-align-symbol"))
+      && Axis_group_interface::has_interface (s))
     {
       /*
-       TODO: make this configurable. RehearsalMark cannot be
-       break-aligned, since the width of the object should not be taken
-       into alignment considerations.
+       RehearsalMark cannot be break-aligned, since the width of the
+       object should not be taken into alignment considerations.
       */
       text_->set_parent (s, X_AXIS);
     }
@@ -62,8 +69,8 @@ Mark_engraver::stop_translation_timestep ()
 {
   if (text_)
     {
-      SCM lst = get_property ("stavesFound");
-      text_->set_object ("side-support-elements", lst);
+      text_->set_object ("side-support-elements",
+                        grob_list_to_grob_array (get_property ("stavesFound")));
       text_ = 0;
     }
   mark_ev_ = 0;
@@ -132,7 +139,8 @@ Mark_engraver::process_music ()
 
 #include "translator.icc"
 
-ADD_ACKNOWLEDGER (Mark_engraver, bar_line);
+ADD_ACKNOWLEDGER (Mark_engraver, break_aligned);
+
 ADD_TRANSLATOR (Mark_engraver,
                /* doc */ "This engraver will create RehearsalMark objects. "
                "It puts them on top of all staves (which is taken from "
@@ -142,5 +150,5 @@ ADD_TRANSLATOR (Mark_engraver,
                "end up on the same Y-location",
                /* create */ "RehearsalMark",
                /* accept */ "mark-event",
-               /* read */ "rehearsalMark markFormatter stavesFound",
+               /* read */ "rehearsalMark rehearsalMarkAlignSymbol markFormatter stavesFound",
                /* write */ "");