lilypond-1.3.67
[lilypond.git] / lily / pointer-group-interface.cc
blobf20aea2b052603de40382da8a7d6611105c4268c
1 /*
2 group-interface.cc -- implement Pointer_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 Pointer_group_interface::Pointer_group_interface (Score_element const* e)
14 elt_l_ = (Score_element*)e;
15 name_ = "elements";
19 Pointer_group_interface::Pointer_group_interface (Score_element const *e, String s)
21 elt_l_ =(Score_element*)e;
22 name_ = s;
24 bool
25 Pointer_group_interface::has_interface_b ()
27 SCM el = elt_l_->get_elt_pointer (name_.ch_C());
29 return el == SCM_EOL || gh_pair_p (el);
33 void
34 Pointer_group_interface::add_element (Score_element*p)
36 elt_l_->set_elt_pointer (name_.ch_C(),
37 gh_cons (p->self_scm_,
38 elt_l_->get_elt_pointer (name_.ch_C())));
41 int
42 Pointer_group_interface::count ()
44 return scm_ilength (elt_l_->get_elt_pointer (name_.ch_C()));
47 void
48 Pointer_group_interface::set_interface ()
50 if (!has_interface_b ())
52 elt_l_->set_elt_pointer (name_.ch_C(), SCM_EOL);