X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsemi-tie-column.cc;h=f31e23050a1baef803339a827440d473fda9abdb;hb=eaa41b4e4dc1d3b893c5a75711f26db6a7f5fa18;hp=70d431f10591237996c81dd50bdac51b8824dae2;hpb=cbb205d40a19c0d2d9801031a63607e108a18038;p=lilypond.git diff --git a/lily/semi-tie-column.cc b/lily/semi-tie-column.cc index 70d431f105..f31e23050a 100644 --- a/lily/semi-tie-column.cc +++ b/lily/semi-tie-column.cc @@ -1,10 +1,21 @@ /* - semi-tie-column.cc -- implement Semi_tie_column + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2011 Han-Wen Nienhuys - (c) 2005--2007 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "semi-tie-column.hh" @@ -21,7 +32,7 @@ ADD_INTERFACE (Semi_tie_column, - "The interface for a column of l.v. ties.", + "The interface for a column of l.v. (laissez vibrer) ties.", /* properties */ "positioning-done " @@ -72,4 +83,23 @@ Semi_tie_column::calc_positioning_done (SCM smob) return SCM_BOOL_T; } +MAKE_SCHEME_CALLBACK (Semi_tie_column, calc_head_direction, 1); +SCM +Semi_tie_column::calc_head_direction (SCM smob) +{ + Grob *me = unsmob_grob (smob); + extract_grob_set (me, "ties", ties); + Direction d = LEFT; + for (vsize i = 0; i < ties.size (); i++) + { + Direction this_d = to_dir (ties[i]->get_property ("head-direction")); + if (i > 0 && d != this_d) + { + programming_error ("all semi-ties in a semi-tie-column should have the same head-direction"); + return scm_from_int (d); + } + d = this_d; + } + return scm_from_int (d); +}