Update from Andrew: tweaks for cross-staff chords snippet.
[lilypond.git] / lily / system-scheme.cc
blob284dc4102cdd632752036502cf0dc93655b9ea97
1 /*
2 system-scheme.cc -- implement scheme bindings to System
4 source file of the GNU LilyPond music typesetter
6 (c) 2007 Joe Neeman <joeneeman@gmail.com>
7 */
9 #include "align-interface.hh"
10 #include "pointer-group-interface.hh"
11 #include "system.hh"
14 LY_DEFINE (ly_system_print, "ly:system-print",
15 1, 0, 0, (SCM system),
16 "Draw the system and return the prob containing its"
17 " stencil.")
19 Grob *me = unsmob_grob (system);
20 System *me_system = dynamic_cast<System*> (me);
21 SCM_ASSERT_TYPE (me, system, SCM_ARG1, __FUNCTION__, "grob");
23 return me_system->get_paper_system ();
26 LY_DEFINE (ly_system_stretch, "ly:system-stretch",
27 2, 0, 0, (SCM system, SCM amount_scm),
28 "Stretch the system vertically by the given amount."
29 " This must be called before the system is drawn (for example"
30 " with @code{ly:system-print}).")
32 Grob *me = unsmob_grob (system);
33 Real amount = robust_scm2double (amount_scm, 0.0);
35 extract_grob_set (me, "elements", elts);
36 for (vsize i = 0; i < elts.size (); i++)
37 if (Align_interface::has_interface (elts[i]))
39 Align_interface::stretch (elts[i], amount, Y_AXIS);
40 break;
42 return SCM_UNDEFINED;