2 command-request.cc -- implement non-musical reqs
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "command-request.hh"
11 #include "musical-request.hh"
13 Tempo_req::Tempo_req ()
15 set_mus_property ("duration", Duration (2,0).smobbed_copy ());
19 Key_change_req::transpose (Pitch p)
21 SCM newlist = SCM_EOL;
22 SCM pa = get_mus_property ("pitch-alist");
23 for (SCM s = pa; gh_pair_p (s); s = ly_cdr (s))
25 SCM key = ly_caar (s);
26 SCM alter = ly_cdar (s);
29 Pitch orig (gh_scm2int (ly_car (key)),
30 gh_scm2int (ly_cdr (key)),
35 SCM key = gh_cons (gh_int2scm (orig.octave_i ()),
36 gh_int2scm (orig.notename_i_));
38 newlist = gh_cons (gh_cons (key, gh_int2scm (orig.alteration_i_)),
41 else if (gh_number_p (key))
43 Pitch orig (0, gh_scm2int (key), gh_scm2int (alter));
46 key =gh_int2scm (orig.notename_i_);
47 alter = gh_int2scm (orig.alteration_i_);
48 newlist = gh_cons (gh_cons (key, alter), newlist);
52 set_mus_property ("pitch-alist", gh_reverse (newlist));
57 alist_equal_p (SCM a, SCM b)
60 gh_pair_p (s); s = ly_cdr (s))
62 SCM key = ly_caar (s);
63 SCM val = ly_cdar (s);
64 SCM l = scm_assoc (key, b);
67 || !gh_equal_p ( ly_cdr (l), val))
75 Key_change_req::do_equal_b (Request const * m )const
77 Key_change_req const * kc =dynamic_cast<Key_change_req const*> (m);
81 return alist_equal_p (get_mus_property ("pitch-alist"),
82 kc->get_mus_property ("pitch-alist"));
88 Mark_req::do_equal_b (Request const * r) const
90 Mark_req const * other = dynamic_cast<Mark_req const*> (r);
91 return other && scm_equal_p (other->get_mus_property ("label"),
92 get_mus_property ("label")) == SCM_BOOL_T;
96 ADD_MUSIC (Articulation_req);
97 ADD_MUSIC (Break_req);
98 ADD_MUSIC (Breathing_sign_req);
99 ADD_MUSIC (Busy_playing_req);
100 ADD_MUSIC (Extender_req);
101 ADD_MUSIC (Glissando_req);
102 ADD_MUSIC (Hyphen_req);
103 ADD_MUSIC (Key_change_req);
104 ADD_MUSIC (Lyric_req);
105 ADD_MUSIC (Mark_req);
106 ADD_MUSIC (Melisma_playing_req);
107 ADD_MUSIC (Melisma_req);
108 ADD_MUSIC (Melodic_req);
109 ADD_MUSIC (Note_req);
110 ADD_MUSIC (Porrectus_req);
111 ADD_MUSIC (Rest_req);
112 ADD_MUSIC (Rhythmic_req);
113 ADD_MUSIC (Script_req);
114 ADD_MUSIC (Skip_req);
115 ADD_MUSIC (Span_req);
116 ADD_MUSIC (Tempo_req);
117 ADD_MUSIC (Text_script_req);
119 ADD_MUSIC (Tremolo_req);