class Axis_group_engraver : public Engraver
{
protected:
+ bool active_;
Spanner *staffline_;
SCM interesting_;
vector<Grob *> elts_;
void process_music ();
+ virtual void initialize ();
virtual void finalize ();
DECLARE_ACKNOWLEDGER (grob);
void process_acknowledged ();
{
staffline_ = 0;
interesting_ = SCM_EOL;
+ active_ = false;
+}
+
+void
+Axis_group_engraver::initialize ()
+{
+ active_ = !to_boolean (get_property ("hasAxisGroup"));
+ if (active_)
+ context ()->set_property ("hasAxisGroup", SCM_BOOL_T);
}
void
void
Axis_group_engraver::process_music ()
{
- if (!staffline_)
+ if (!staffline_ && active_)
{
staffline_ = get_spanner ();
Grob *it = unsmob_grob (get_property ("currentCommandColumn"));
void
Axis_group_engraver::acknowledge_grob (Grob_info i)
{
- elts_.push_back (i.grob ());
+ if (staffline_)
+ elts_.push_back (i.grob ());
if (staffline_ && to_boolean(staffline_->get_property("remove-empty")))
{
/* read */
"currentCommandColumn "
- "keepAliveInterfaces ",
-
+ "keepAliveInterfaces "
+ "hasAxisGroup ",
+
/* write */
- ""
+ "hasAxisGroup "
);
#include "align-interface.hh"
#include "axis-group-interface.hh"
#include "engraver.hh"
+#include "international.hh"
#include "spanner.hh"
#include "pointer-group-interface.hh"
#include "grob-array.hh"
/* read */
"alignAboveContext "
- "alignBelowContext ",
+ "alignBelowContext "
+ "hasAxisGroup ",
/* write */
""
void
Vertical_align_engraver::process_music ()
{
- if (!valign_)
+ if (!valign_ && !scm_is_null (id_to_group_hashtab_))
{
+ if (to_boolean (get_property ("hasAxisGroup")))
+ {
+ warning (_ ("Ignoring Vertical_align_engraver in VerticalAxisGroup"));
+ id_to_group_hashtab_ = SCM_EOL;
+ return;
+ }
+
top_level_ = to_boolean (get_property ("topLevelAlignment"));
valign_ = make_spanner (top_level_ ? "VerticalAlignment" : "StaffGrouper", SCM_EOL);
void
Vertical_align_engraver::acknowledge_axis_group (Grob_info i)
{
+ if (scm_is_null (id_to_group_hashtab_))
+ return;
+
if (top_level_ && qualifies (i))
{
string id = i.context ()->id_string ();
(graceSettings ,list? "Overrides for grace notes. This property
should be manipulated through the @code{add-grace-property} function.")
+
+ (hasAxisGroup ,boolean? "True if the current context is contained
+in an axis group.")
(hasStaffSpacing ,boolean? "True if the current
@code{CommandColumn} contains items that will affect spacing.")