lilypond-1.3.80
[lilypond.git] / lily / group-interface.cc
blob7337f84c3bbe4c1d89067a45cd179540f7e66c04
1 /*
2 group-interface.cc -- implement Group_interface
4 source file of the GNU LilyPond music typesetter
6 (c) 1999--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
9 #include "group-interface.hh"
10 #include "score-element.hh"
12 Group_interface::Group_interface (Score_element const* e)
14 elt_l_ = (Score_element*)e;
15 name_ = "elements";
19 Group_interface::Group_interface (Score_element const *e, String s)
21 elt_l_ =(Score_element*)e;
22 name_ = s;
24 bool
25 Group_interface::has_interface ()
27 SCM el = elt_l_->get_elt_property (name_.ch_C());
29 return el == SCM_EOL || gh_pair_p (el);
34 void
35 Group_interface::add_thing (SCM s)
37 elt_l_->set_elt_property (name_.ch_C (),
38 gh_cons (s, elt_l_->get_elt_property (name_.ch_C())));
42 int
43 Group_interface::count ()
45 return scm_ilength (elt_l_->get_elt_property (name_.ch_C()));
48 void
49 Group_interface::set_interface ()
51 if (!has_interface ())
53 elt_l_->set_elt_property (name_.ch_C (), SCM_EOL);