Key_item::Key_item (int c)
{
- breakable_b_ =true;
- default_b_ = false;
- set_c_position (c);
+ breakable_b_ =true;
+ default_b_ = false;
+ set_c_position (c);
}
void
Key_item::read (Key_engraver const & key_grav_r)
{
- assert (!key_grav_r.key_.multi_octave_b_);
- const Array<int> &idx_arr =key_grav_r.accidental_idx_arr_;
- for (int i = 0 ; i< idx_arr.size(); i++) {
+ assert (!key_grav_r.key_.multi_octave_b_);
+ const Array<int> &idx_arr =key_grav_r.accidental_idx_arr_;
+ for (int i = 0 ; i< idx_arr.size(); i++)
+ {
int note = idx_arr[i];
int acc = ((Key &) key_grav_r.key_).oct (0).acc (note);
void
Key_item::set_c_position (int c0)
{
- int octaves =(abs (c0) / 7) +1 ;
- c_position=(c0 + 7*octaves)%7;
+ int octaves =(abs (c0) / 7) +1 ;
+ c_position=(c0 + 7*octaves)%7;
}
void
Key_item::add (int p, int a)
{
- if ((a<0 && p>FLAT_TOP_PITCH) ||
- (a>0 && p>SHARP_TOP_PITCH)) {
- p -= 7; /* Typeset below c_position */
+ if ((a<0 && p>FLAT_TOP_PITCH) ||
+ (a>0 && p>SHARP_TOP_PITCH))
+ {
+ p -= 7; /* Typeset below c_position */
}
- pitch.push (p);
- acc.push (a);
+ pitch.push (p);
+ acc.push (a);
}
Molecule*
Key_item::brew_molecule_p()const
{
- Molecule*output = new Molecule;
- Real inter = paper()->internote_f ();
-
- for (int i =0; i < pitch.size(); i++) {
+ Molecule*output = new Molecule;
+ Real inter = paper()->internote_f ();
+
+ for (int i =0; i < pitch.size(); i++)
+ {
Symbol s= paper()->lookup_l ()->accidental (acc[i]);
Atom a (s);
a.translate ((c_position + pitch[i]) * inter, Y_AXIS);
Molecule m (a);
output->add_right (m);
}
- if ( pitch.size()) {
+ if ( pitch.size())
+ {
Molecule m (paper()->lookup_l ()->fill (Box (
Interval (0, paper()->note_width ()),
Interval (0,0))));
output->add_right (m);
}
- return output;
+ return output;
}
IMPLEMENT_IS_TYPE_B1(Key_item,Item);
void
Key_item::do_pre_processing()
{
- if (default_b_) {
+ if (default_b_)
+ {
empty_b_ = transparent_b_ = (break_status_i() != 1);
}
}