2 beam-setting-scheme.cc -- Retrieving beam settings
4 source file of the GNU LilyPond music typesetter
6 Copyright (c) 2009 Carl Sorensen <c_sorensen@byu.edu>
9 #include "beam-settings.hh"
11 #include "guile-compatibility.hh"
13 LY_DEFINE (ly_grouping_rules
, "ly:grouping-rules",
14 3, 0, 0, (SCM settings
, SCM time_signature
, SCM rule_type
),
15 "Return grouping rules for @var{time-signature} and"
16 " @var{rule-type} from @var{settings}.")
18 LY_ASSERT_TYPE (ly_cheap_is_list
, settings
, 1);
19 LY_ASSERT_TYPE (scm_is_pair
, time_signature
, 2);
20 LY_ASSERT_TYPE (ly_is_symbol
, rule_type
, 3);
22 SCM grouping_rules
= SCM_EOL
;
23 if (scm_is_pair (settings
))
25 ly_assoc_get (scm_list_2 (time_signature
, rule_type
),
28 return grouping_rules
;
31 LY_DEFINE (ly_beam_grouping
, "ly:beam-grouping",
32 4, 0, 0, (SCM settings
, SCM time_signature
, SCM rule_type
,
34 "Return grouping for beams of @var{beam-type} in"
35 " @var{time-signature} for"
36 " @var{rule-type} from @var{settings}.")
38 LY_ASSERT_TYPE (ly_cheap_is_list
, settings
, 1);
39 LY_ASSERT_TYPE (scm_is_pair
, time_signature
, 2);
40 LY_ASSERT_TYPE (ly_is_symbol
, rule_type
, 3);
41 SCM_ASSERT_TYPE (scm_is_symbol(beam_type
) || scm_is_pair(beam_type
),
42 beam_type
, SCM_ARG4
, __FUNCTION__
, "symbol or pair");
44 ly_assoc_get (beam_type
,
45 ly_grouping_rules (settings
,time_signature
,rule_type
),
50 LY_DEFINE (ly_beat_grouping
, "ly:beat-grouping",
51 1, 0, 0, (SCM context
),
52 "Return default beat grouping currently active in @var{context}.")
54 LY_ASSERT_SMOB (Context
, context
, 1);
55 Context
*c
= unsmob_context (context
);
57 c
->get_property ("timeSignatureFraction");
59 c
->get_property("beamSettings");
61 ly_beam_grouping (settings
,
63 ly_symbol2scm ("end"),