]> git.donarmstrong.com Git - lilypond.git/blob - lily/command-request.cc
release: 0.0.42.pre3
[lilypond.git] / lily / command-request.cc
1 /*
2   commandrequest.cc -- implement Nonmusical reqs
3
4   source file of the LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #include "command-request.hh"
10 #include "debug.hh"
11 #include "musical-request.hh"
12
13
14 void
15 Cadenza_req::do_print()const
16 {
17     mtor << on_b_;
18 }
19
20 Cadenza_req::Cadenza_req(bool b)
21 {
22     on_b_ =b;
23 }
24 /* *************** */
25
26
27 int
28 Bar_req::compare(Bar_req const &c1)const
29 {
30     return type_str_ == c1.type_str_;
31 }
32
33 void
34 Bar_req::do_print() const
35 {
36     mtor << type_str_;
37 }
38
39 Bar_req::Bar_req(String s)
40 {
41     type_str_ = s;
42 }
43
44 Partial_measure_req::Partial_measure_req(Moment m)
45 {
46     duration_ =m;
47 }
48 /* *************** */
49 Meter_change_req::Meter_change_req()
50 {
51     beats_i_ = 0;
52     one_beat_i_ =0;
53 }
54 void
55 Meter_change_req::set(int b,int o)
56 {
57     beats_i_=b;
58     one_beat_i_=o;
59 }
60
61 void
62 Timing_req::do_print()const{}
63
64 void
65 Command_req::do_print()const{}
66 /* *************** */
67 void
68 Barcheck_req::do_print() const{}
69
70 /* *************** */
71 void
72 Clef_change_req::do_print() const
73 {
74     mtor << clef_str_ ;
75 }
76
77 Clef_change_req::Clef_change_req(String s)
78 {
79     clef_str_ = s;
80 }
81 /* *************** */
82 void
83 Group_feature_req::do_print() const
84 {
85     mtor << "stemdir " << stemdir_i_;
86 }
87
88 Group_feature_req::Group_feature_req()
89 {
90     stemdir_i_ = 0;
91 }
92
93 void
94 Group_change_req::do_print()const
95 {
96     mtor << "id : " << newgroup_str_;
97 }
98 /* *************** */
99 void
100 Terminate_voice_req::do_print()const
101 {
102 }
103
104 /* *************** */
105 void
106 Partial_measure_req::do_print() const
107 {
108     mtor << duration_;
109 }
110
111 void
112 Meter_change_req::do_print() const
113 {
114     mtor << beats_i_ << "*" << one_beat_i_;
115 }
116
117 /* *************** */
118
119 void
120 Measure_grouping_req::do_print() const
121 {
122     for (int i=0; i < elt_length_arr_.size(); i++) {
123         mtor << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
124     }
125 }
126 /* *************** */
127 void
128 Key_change_req::do_print() const
129 {
130     for (int i=0; i < melodic_p_arr_.size(); i++) {
131         melodic_p_arr_[i]->print();
132     }
133 }
134
135 Key_change_req::Key_change_req()
136 {
137 }
138 Key_change_req::Key_change_req(Key_change_req const&c)
139 {
140     for (int i=0; i < c.melodic_p_arr_.size(); i++) {
141         melodic_p_arr_.push( c.melodic_p_arr_[i]->clone()->melodic() );
142     }
143 }
144
145 Key_change_req::~Key_change_req()
146 {
147     for (int i=0; i < melodic_p_arr_.size(); i++)
148         delete melodic_p_arr_[i];
149 }