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"
14 #include "general-script-def.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
->specs_l_
->inside_b(),
57 s_l
->dir_
) ].push (s_l
);
60 for (int j
=0; j
<4; j
++)
62 placed_l_arr_a
[j
].sort (Script::compare
);
66 for (int j
=0; j
< 4; j
++)
68 if (placed_l_arr_a
[j
].size())
69 for (int i
=0; i
< support_l_arr_
.size(); i
++)
70 placed_l_arr_a
[j
][0]->add_support (support_l_arr_
[i
]);
77 for (int i
=0; i
< placed_l_arr_a
[j
].size(); i
++)
80 placed_l_arr_a
[j
][i
]->add_support (support_l
);
81 support_l
= placed_l_arr_a
[j
][i
];
87 for (int i
=0; i
< placed_l_arr_a
[j
].size(); i
++)
90 placed_l_arr_a
[j
][i
]->add_support (support_l
);
91 support_l
= placed_l_arr_a
[j
][i
];
98 Script_column::add_support (Item
*i_l
)
100 support_l_arr_
.push (i_l
);
101 add_dependency (i_l
);
106 Script_column::do_substitute_dependency (Score_elem
*o
,Score_elem
*n
)
110 script_l_arr_
.substitute ((Script
*)o
->item(),(Script
*) (n
?n
->item ():0));
111 support_l_arr_
.substitute (o
->item(), (n
?n
->item ():0));