14 open_right=open_left=false;
20 int pos1 = encompass.last()->position;
21 int pos2 = encompass[0]->position;
25 Real w = width().length();
27 return Offset(w/2,dy * paper()->internote());
38 Slur::set_default_dir()
41 for (int i=0; i < encompass.sz(); i ++) {
42 sumpos += encompass[i]->position;
45 /* should consult stems */
46 Real meanpos = sumpos/Real(encompass.sz());
47 if (meanpos < 5) // todo
60 Slur::do_pre_processing()
62 right = encompass.last()->pcol_;
63 left = encompass[0]->pcol_;
67 Slur::do_break_at(PCol*l, PCol*r) const
69 assert(l->line == r->line);
70 Slur*ret = new Slur(*this);
72 ret->encompass.set_size(0);
73 for (int i =0; i < encompass.sz(); i++) {
74 if (encompass[i]->pcol_->line==l->line)
75 ret->encompass.add(encompass[i]);
78 ret->open_right = true;
80 ret->open_left = true;
87 Slur::do_post_processing()
93 Slur::brew_molecule() const
95 Molecule*output = new Molecule;
96 assert(left->line == right->line);
97 int minp=1000, maxp=-1000; // todo
98 for (int i=0; i<encompass.sz(); i++) {
99 minp = encompass[i]->position <? minp;
100 maxp = encompass[i]->position >? maxp;
102 assert(encompass.sz()>0); // todo
104 Notehead *lnote_p =encompass[0];
105 Notehead *rnote_p =encompass.last();
106 int pos1 = lnote_p->position;
107 int pos2 = rnote_p->position;
110 Real nw_f = paper()->note_width();
111 Real w = width().length();
112 w+= (-lnote_p->x_dir + rnote_p->x_dir)* nw_f ;
113 Real round_w = w; // slur lookup rounds the slurwidth .
115 Symbol sl = paper()->lookup_->slur(dy , round_w, dir);
117 Real error = w-round_w;
120 a.translate(Offset((lnote_p->x_dir + 0.5 )*nw_f + error/2,
121 (pos2+2*dir) * paper()->internote()));