lilypond-1.3.67
[lilypond.git] / lily / newkey.cc
blob31bd1c913cbf03e9c3d103315ff0b1a5a6c272a3
1 #include "newkey.hh"
3 Newkey::Newkey ()
5 clear();
8 void
9 Newkey::clear()
11 key_alist_ = SCM_EOL;
14 void
15 Newkey::set (int n, int a)
17 set_scm (gh_int2scm (n), gh_int2scm (a));
20 void
21 Newkey::set (int o, int n, int a)
23 set_scm (gh_cons (gh_int2scm (o),gh_int2scm(n)), gh_int2scm (a));
26 void
27 Newkey::set_scm (SCM k, SCM v)
29 key_alist_
30 = scm_assoc_set_x (key_alist_, k, v);
33 int
34 Newkey::get (int o, int n)
36 SCM r = scm_assoc (gh_cons (gh_int2scm (o), gh_int2scm (n)), key_alist_);
37 return r == SCM_BOOL_F ? get (n) : gh_cdr (r);
40 int
41 Newkey::get (int n)
43 SCM r = scm_assoc (gh_int2scm (n), key_alist_);
44 return r == SCM_BOOL_F ? 0: gh_cdr (r);