2 command-request.cc -- implement non-musical reqs
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "command-request.hh"
11 #include "musical-request.hh"
14 Barcheck_req::do_equal_b (Request
const *r
) const
16 Barcheck_req
const*b
= dynamic_cast<Barcheck_req
const*> (r
);
20 Tempo_req::Tempo_req ()
22 set_mus_property ("duration", Duration (2,0).smobbed_copy ());
26 Key_change_req::transpose (Pitch p
)
28 SCM newlist
= SCM_EOL
;
29 SCM pa
= get_mus_property ("pitch-alist");
30 for (SCM s
= pa
; gh_pair_p (s
); s
= gh_cdr (s
))
32 SCM key
= gh_caar (s
);
33 SCM alter
= gh_cdar (s
);
36 Pitch
orig (gh_scm2int (gh_car (key
)),
37 gh_scm2int (gh_cdr (key
)),
42 SCM key
= gh_cons (gh_int2scm (orig
.octave_i ()),
43 gh_int2scm (orig
.notename_i_
));
45 newlist
= gh_cons (gh_cons (key
, gh_int2scm (orig
.alteration_i_
)),
48 else if (gh_number_p (key
))
50 Pitch
orig (0, gh_scm2int (key
), gh_scm2int (alter
));
53 key
=gh_int2scm (orig
.notename_i_
);
54 alter
= gh_int2scm (orig
.alteration_i_
);
55 newlist
= gh_cons (gh_cons (key
, alter
), newlist
);
59 set_mus_property ("pitch-alist", newlist
);
64 alist_equal_p (SCM a
, SCM b
)
67 gh_pair_p (s
); s
= gh_cdr (s
))
69 SCM key
= gh_caar (s
);
70 SCM val
= gh_cdar (s
);
71 SCM l
= scm_assoc (key
, b
);
74 || !gh_equal_p ( gh_cdr (l
), val
))
82 Key_change_req::do_equal_b (Request
const * m
)const
84 Key_change_req
const * kc
=dynamic_cast<Key_change_req
const*> (m
);
88 return alist_equal_p (get_mus_property ("pitch-alist"),
89 kc
->get_mus_property ("pitch-alist"));
95 Mark_req::do_equal_b (Request
const * r
) const
97 Mark_req
const * other
= dynamic_cast<Mark_req
const*> (r
);
98 return other
&& scm_equal_p (other
->get_mus_property ("label"),
99 get_mus_property ("label")) == SCM_BOOL_T
;
103 ADD_MUSIC (Articulation_req
);
104 ADD_MUSIC (Barcheck_req
);
105 ADD_MUSIC (Break_req
);
106 ADD_MUSIC (Breathing_sign_req
);
107 ADD_MUSIC (Busy_playing_req
);
108 ADD_MUSIC (Extender_req
);
109 ADD_MUSIC (Glissando_req
);
110 ADD_MUSIC (Hyphen_req
);
111 ADD_MUSIC (Key_change_req
);
112 ADD_MUSIC (Lyric_req
);
113 ADD_MUSIC (Mark_req
);
114 ADD_MUSIC (Melisma_playing_req
);
115 ADD_MUSIC (Melisma_req
);
116 ADD_MUSIC (Melodic_req
);
117 ADD_MUSIC (Note_req
);
118 ADD_MUSIC (Rest_req
);
119 ADD_MUSIC (Rhythmic_req
);
120 ADD_MUSIC (Script_req
);
121 ADD_MUSIC (Skip_req
);
122 ADD_MUSIC (Span_req
);
123 ADD_MUSIC (Tempo_req
);
124 ADD_MUSIC (Text_script_req
);
126 ADD_MUSIC (Tremolo_req
);