1 #include "musicalrequest.hh"
2 #include "paper-def.hh"
11 Script::set_stem(Stem
*st_l
)
18 Script::set_support(Item
*i
)
24 Script::Script(Script_req
* rq
, int staflen
)
27 specs_l_
= rq
->scriptdef_p_
;
37 if (specs_l_
->invertsym
)
38 symdir
= (dir
< 0) ? -1:1;
42 Script::set_default_dir()
44 if (specs_l_
->stemdir
) {
48 dir
= stem_l_
->dir
* specs_l_
->stemdir
;
53 Script::support_height() const return r
;
55 for (int i
=0; i
< support
.size(); i
++)
56 r
.unite(support
[i
]->height());
60 Script::set_default_index()
62 Real inter_f
= paper()->internote();
63 Interval dy
= symbol().dim
.y
;
65 int d
= specs_l_
->staffdir
;
68 Interval v
= support_height();
69 y
= v
[dir
] -dy
[-dir
] + 2*dir
*inter_f
;
71 y
= (d
> 0) ? staffsize
+ 2: -2; // ug
73 Interval v
= support_height();
83 Interval v
= stem_l_
->height();
85 if (d
> 0 || (!d
&& dir
> 0)) {
87 }else if (d
< 0 || (!d
&& dir
< 0)) {
92 pos
= int(rint(Real(y
)/inter_f
));
98 return symbol().dim
.x
;
102 Script::symbol()const
104 String preidx_str
= (symdir
< 0) ?"-" :"";
105 return paper()->lookup_p_
->script(preidx_str
+ specs_l_
->symidx
);
109 Script::do_pre_processing()
116 Script::do_post_processing()
122 Script::brew_molecule_p() const
124 Real dy
= paper()->internote();
126 Molecule
*out
= new Molecule(Atom(symbol()));
127 out
->translate(Offset(0,dy
* pos
));