#include "staff-symbol-referencer.hh"
#include "text-interface.hh"
#include "warn.hh"
+#include "unpure-pure-container.hh"
System::System (System const &src)
: Spanner (src)
}
}
- if (be_verbose_global)
- message (_f ("Element count %d", count + element_count ()) + "\n");
+ debug_output (_f ("Element count %d", count + element_count ()) + "\n");
}
SCM
SCM lines = scm_c_make_vector (broken_intos_.size (), SCM_EOL);
for (vsize i = 0; i < broken_intos_.size (); i++)
{
- if (be_verbose_global)
- progress_indication ("[");
+ debug_output ("[", false);
System *system = dynamic_cast<System *> (broken_intos_[i]);
scm_vector_set_x (lines, scm_from_int (i),
system->get_paper_system ());
- if (be_verbose_global)
- progress_indication (to_string (i) + "]");
+ debug_output (to_string (i) + "]", false);
}
return lines;
}
for (vsize i = 0; i < all_elements_->size (); i++)
all_elements_->grob (i)->discretionary_processing ();
- if (be_verbose_global)
- message (_f ("Grob count %d", element_count ()));
+ debug_output (_f ("Grob count %d", element_count ()));
/*
order is significant: broken grobs are added to the end of the
pl->set_property ("page-break-penalty", right_bound->get_property ("page-break-penalty"));
pl->set_property ("page-turn-penalty", right_bound->get_property ("page-turn-penalty"));
+ if (right_bound->original () == dynamic_cast<System*> (original ())->get_bound (RIGHT))
+ pl->set_property ("last-in-score", SCM_BOOL_T);
+
Interval staff_refpoints;
if (Grob *align = get_vertical_alignment ())
{
return pure ? get_pure_bound (d, start, end) : get_bound (d);
}
+enum {
+ SPACEABLE_STAVES,
+ NONSPACEABLE_STAVES,
+ ALL_STAVES
+};
+
+static SCM
+get_maybe_spaceable_staves (SCM smob, int filter)
+{
+ System *me = dynamic_cast<System*> (unsmob_grob (smob));
+ Grob *align = me->get_vertical_alignment ();
+ SCM ret = SCM_EOL;
+
+ if (align)
+ {
+ SCM *tail = &ret;
+ extract_grob_set (align, "elements", staves);
+
+ for (vsize i = 0; i < staves.size (); ++i)
+ {
+ bool spaceable = Page_layout_problem::is_spaceable (staves[i]);
+ if (staves[i]->is_live () &&
+ ((filter == ALL_STAVES)
+ || (filter == SPACEABLE_STAVES && spaceable)
+ || (filter == NONSPACEABLE_STAVES && !spaceable)))
+ {
+ *tail = scm_cons (staves[i]->self_scm (), SCM_EOL);
+ tail = SCM_CDRLOC (*tail);
+ }
+ }
+ }
+
+ return ret;
+}
+
+MAKE_SCHEME_CALLBACK (System, get_staves, 1)
+SCM
+System::get_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, ALL_STAVES);
+}
+
+MAKE_SCHEME_CALLBACK (System, get_spaceable_staves, 1)
+SCM
+System::get_spaceable_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, SPACEABLE_STAVES);
+}
+
+MAKE_SCHEME_CALLBACK (System, get_nonspaceable_staves, 1)
+SCM
+System::get_nonspaceable_staves (SCM smob)
+{
+ return get_maybe_spaceable_staves (smob, NONSPACEABLE_STAVES);
+}
+
+
ADD_INTERFACE (System,
"This is the top-level object: Each object in a score"
" ultimately has a @code{System} object as its X and"