2 script-column.cc -- implement Script_column
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
9 #include "script-column.hh"
12 #include "note-head.hh"
16 IMPLEMENT_IS_TYPE_B1(Script_column
,Horizontal_vertical_group_item
);
20 Script_column::add (Script
*s_l
)
22 script_l_arr_
.push (s_l
);
29 Script_column::do_print() const
32 DOUT
<< "scripts: " << script_l_arr_
.size() << '\n';
37 idx (bool inside
, int dir
)
46 Script_column::do_pre_processing()
48 if (!script_l_arr_
.size())
51 /* up+inside, up+outside, down+inside, down+outside */
52 Array
<Script
*> placed_l_arr_a
[4];
53 for (int i
=0; i
< script_l_arr_
.size(); i
++)
55 Script
*s_l
= script_l_arr_
[i
];
56 placed_l_arr_a
[idx (s_l
->inside_staff_b_
, s_l
->dir_
) ].push (s_l
);
59 for (int j
=0; j
<4; j
++)
61 placed_l_arr_a
[j
].sort (Script::compare
);
65 for (int j
=0; j
< 4; j
++)
67 if (placed_l_arr_a
[j
].size())
68 for (int i
=0; i
< support_l_arr_
.size(); i
++)
69 placed_l_arr_a
[j
][0]->add_support (support_l_arr_
[i
]);
76 for (int i
=0; i
< placed_l_arr_a
[j
].size(); i
++)
79 placed_l_arr_a
[j
][i
]->add_support (support_l
);
80 support_l
= placed_l_arr_a
[j
][i
];
86 for (int i
=0; i
< placed_l_arr_a
[j
].size(); i
++)
89 placed_l_arr_a
[j
][i
]->add_support (support_l
);
90 support_l
= placed_l_arr_a
[j
][i
];
97 Script_column::add_support (Item
*i_l
)
99 support_l_arr_
.push (i_l
);
100 add_dependency (i_l
);
105 Script_column::do_substitute_dependency (Score_elem
*o
,Score_elem
*n
)
109 script_l_arr_
.substitute ((Script
*)o
->item(),(Script
*) (n
?n
->item ():0));
110 support_l_arr_
.substitute (o
->item(), (n
?n
->item ():0));