]> git.donarmstrong.com Git - lilypond.git/blob - lily/group-interface.cc
b78783c192d4fe3216aea51e938e2227ed5a75e5
[lilypond.git] / lily / group-interface.cc
1 /*   
2   group-interface.cc --  implement Group_interface
3   
4   source file of the GNU LilyPond music typesetter
5   
6   (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7   
8  */
9 #include "group-interface.hh"
10 #include "score-element.hh"
11
12 Group_interface::Group_interface (Score_element const* e)
13 {
14   elt_l_ = (Score_element*)e;
15   name_ = "elements";
16 }
17
18
19 Group_interface::Group_interface (Score_element const *e, String s)
20 {
21   elt_l_ =(Score_element*)e;
22   name_ = s;
23
24 bool
25 Group_interface::has_interface_b () 
26 {
27   SCM el = elt_l_->get_elt_property (name_);
28
29   return el == SCM_EOL || gh_pair_p (el);
30 }
31
32
33
34 void
35 Group_interface::add_thing (SCM s)
36 {
37   elt_l_->set_elt_property (name_,
38                             gh_cons (s, elt_l_->get_elt_property (name_)));
39
40 }
41
42
43 int
44 Group_interface::count ()
45 {
46   return scm_ilength (elt_l_->get_elt_property (name_));
47 }
48
49 void
50 Group_interface::set_interface ()
51 {
52   if (!has_interface_b ())
53     {
54       elt_l_->set_elt_property (name_, SCM_EOL);
55     }
56 }
57