X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fottava-bracket.cc;h=1fa77ec799cf5db54d323ec5be4ea9f963a3d8c0;hb=27d3e1188a9885e72a5afbd72482617b34907f30;hp=53e87118f3cd4c4bb2793e3a5ffd01e37381d9c8;hpb=8f8b3fb62d5d0776335de899b32aada69457810a;p=lilypond.git diff --git a/lily/ottava-bracket.cc b/lily/ottava-bracket.cc index 53e87118f3..1fa77ec799 100644 --- a/lily/ottava-bracket.cc +++ b/lily/ottava-bracket.cc @@ -1,13 +1,23 @@ /* - ottava-bracket.cc -- implement Ottava_bracket + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2004--2011 Han-Wen Nienhuys - (c) 2004--2005 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 "text-interface.hh" -#include "line-spanner.hh" #include "spanner.hh" #include "font-interface.hh" #include "dimensions.hh" @@ -24,7 +34,7 @@ struct Ottava_bracket { DECLARE_SCHEME_CALLBACK (print, (SCM)); - static bool has_interface (Grob *); + DECLARE_GROB_INTERFACE (); }; /* @@ -55,7 +65,7 @@ Ottava_bracket::print (SCM smob) { extract_grob_set (b, "note-heads", heads); common = common_refpoint_of_array (heads, common, X_AXIS); - for (int i = 0; i < heads.size (); i++) + for (vsize i = 0; i < heads.size (); i++) { Grob *h = heads[i]; Grob *dots = Rhythmic_head::get_dots (h); @@ -70,7 +80,8 @@ Ottava_bracket::print (SCM smob) SCM markup = me->get_property ("text"); Stencil text; if (Text_interface::is_markup (markup)) - text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), properties, markup)); + text = *unsmob_stencil (Text_interface::interpret_markup (layout->self_scm (), + properties, markup)); Drul_array shorten = robust_scm2interval (me->get_property ("shorten-pair"), Interval (0, 0)); @@ -87,7 +98,7 @@ Ottava_bracket::print (SCM smob) if (Note_column::has_interface (b)) { extract_grob_set (b, "note-heads", heads); - for (int i = 0; i < heads.size (); i++) + for (vsize i = 0; i < heads.size (); i++) { Grob *h = heads[i]; ext.unite (h->extent (common, X_AXIS)); @@ -132,10 +143,13 @@ Ottava_bracket::print (SCM smob) Drul_array flare = robust_scm2interval (me->get_property ("bracket-flare"), Interval (0, 0)); - edge_height[LEFT] = 0.0; - edge_height[RIGHT] *= -get_grob_direction (me); - if (broken[RIGHT]) - edge_height[RIGHT] = 0.0; + do + { + edge_height[d] *= -get_grob_direction (me); + if (broken[d]) + edge_height[d] = 0.0; + } + while (flip(&d) != LEFT); Stencil b; Interval empty; @@ -176,15 +190,12 @@ Ottava_bracket::print (SCM smob) } ADD_INTERFACE (Ottava_bracket, - "ottava-bracket-interface", - - "An ottava bracket", + "An ottava bracket.", - /* - properties - */ + /* properties */ "edge-height " "bracket-flare " "shorten-pair " - "minimum-length"); + "minimum-length " + );