OLD | NEW |
1 /* | 1 /* |
2 This file is part of LilyPond, the GNU music typesetter. | 2 This file is part of LilyPond, the GNU music typesetter. |
3 | 3 |
4 Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> | 4 Copyright (C) 1998--2012 Han-Wen Nienhuys <hanwen@xs4all.nl> |
5 | 5 |
6 LilyPond is free software: you can redistribute it and/or modify | 6 LilyPond is free software: you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 7 it under the terms of the GNU General Public License as published by |
8 the Free Software Foundation, either version 3 of the License, or | 8 the Free Software Foundation, either version 3 of the License, or |
9 (at your option) any later version. | 9 (at your option) any later version. |
10 | 10 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 | 340 |
341 now_heads_.clear (); | 341 now_heads_.clear (); |
342 } | 342 } |
343 | 343 |
344 void | 344 void |
345 Tie_engraver::typeset_tie (Grob *her) | 345 Tie_engraver::typeset_tie (Grob *her) |
346 { | 346 { |
347 if (! (Tie::head (her, LEFT) && Tie::head (her, RIGHT))) | 347 if (! (Tie::head (her, LEFT) && Tie::head (her, RIGHT))) |
348 warning (_ ("lonely tie")); | 348 warning (_ ("lonely tie")); |
349 | 349 |
350 Direction d = LEFT; | |
351 Drul_array<Grob *> new_head_drul; | 350 Drul_array<Grob *> new_head_drul; |
352 new_head_drul[LEFT] = Tie::head (her, LEFT); | 351 new_head_drul[LEFT] = Tie::head (her, LEFT); |
353 new_head_drul[RIGHT] = Tie::head (her, RIGHT); | 352 new_head_drul[RIGHT] = Tie::head (her, RIGHT); |
354 do | 353 for (LEFT_and_RIGHT (d)) |
355 { | 354 { |
356 if (!Tie::head (her, d)) | 355 if (!Tie::head (her, d)) |
357 new_head_drul[d] = Tie::head (her, (Direction) - d); | 356 new_head_drul[d] = Tie::head (her, (Direction) - d); |
358 } | 357 } |
359 while (flip (&d) != LEFT); | |
360 | 358 |
361 Spanner *sp = dynamic_cast<Spanner *> (her); | 359 Spanner *sp = dynamic_cast<Spanner *> (her); |
362 sp->set_bound (LEFT, new_head_drul[LEFT]); | 360 sp->set_bound (LEFT, new_head_drul[LEFT]); |
363 sp->set_bound (RIGHT, new_head_drul[RIGHT]); | 361 sp->set_bound (RIGHT, new_head_drul[RIGHT]); |
364 } | 362 } |
365 | 363 |
366 ADD_ACKNOWLEDGER (Tie_engraver, note_head); | 364 ADD_ACKNOWLEDGER (Tie_engraver, note_head); |
367 ADD_TRANSLATOR (Tie_engraver, | 365 ADD_TRANSLATOR (Tie_engraver, |
368 /* doc */ | 366 /* doc */ |
369 "Generate ties between note heads of equal pitch.", | 367 "Generate ties between note heads of equal pitch.", |
370 | 368 |
371 /* create */ | 369 /* create */ |
372 "Tie " | 370 "Tie " |
373 "TieColumn ", | 371 "TieColumn ", |
374 | 372 |
375 /* read */ | 373 /* read */ |
376 "tieWaitForNote ", | 374 "tieWaitForNote ", |
377 | 375 |
378 /* write */ | 376 /* write */ |
379 "tieMelismaBusy " | 377 "tieMelismaBusy " |
380 ); | 378 ); |
OLD | NEW |