X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fnote-head.cc;h=af516bef2b0092a708196b80da510ebf2bb35208;hb=dd9cdec4d7fb538b3a201f3b82a10b5ac9ef5f79;hp=b17812f98f4adc2d707877718d060a196861b116;hpb=8adeb99e344bf047b9b3b9b48a9e97e59e8fc4d3;p=lilypond.git diff --git a/lily/note-head.cc b/lily/note-head.cc index b17812f98f..af516bef2b 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -1,7 +1,7 @@ /* This file is part of LilyPond, the GNU music typesetter. - Copyright (C) 1997--2011 Han-Wen Nienhuys + Copyright (C) 1997--2015 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 @@ -23,7 +23,6 @@ #include #include // min, max -using namespace std; #include "directional-element-interface.hh" #include "font-interface.hh" @@ -33,12 +32,14 @@ using namespace std; #include "staff-symbol-referencer.hh" #include "warn.hh" +using std::string; + static Stencil internal_print (Grob *me, string *font_char) { string style = robust_symbol2string (me->get_property ("style"), "default"); - string suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); + string suffix = ::to_string (std::min (robust_scm2int (me->get_property ("duration-log"), 2), 2)); if (style != "default") suffix = robust_scm2string (me->get_property ("glyph-name"), ""); @@ -51,7 +52,7 @@ internal_print (Grob *me, string *font_char) Stencil out = fm->find_by_name (idx_either + suffix); if (out.is_empty ()) { - Grob *stem = unsmob_grob (me->get_object ("stem")); + Grob *stem = unsmob (me->get_object ("stem")); Direction stem_dir = stem ? get_grob_direction (stem) : CENTER; if (stem_dir == CENTER) @@ -64,7 +65,8 @@ internal_print (Grob *me, string *font_char) if (style == "mensural" || style == "neomensural" || style == "petrucci" - || style == "baroque") + || style == "baroque" + || style == "kievan") { if (!Staff_symbol_referencer::on_line (me, @@ -79,6 +81,15 @@ internal_print (Grob *me, string *font_char) } } + if (style == "kievan" + && 3 == robust_scm2int (me->get_property ("duration-log"), 2)) + { + Grob *stem = unsmob (me->get_object ("stem")); + Grob *beam = unsmob (stem->get_object ("beam")); + if (beam) + out = fm->find_by_name (idx_either + "2kievan"); + } + idx_either += suffix; if (out.is_empty ()) { @@ -99,8 +110,8 @@ MAKE_SCHEME_CALLBACK (Note_head, stem_x_shift, 1); SCM Note_head::stem_x_shift (SCM smob) { - Grob *me = unsmob_grob (smob); - Grob *stem = unsmob_grob (me->get_object ("stem")); + Grob *me = unsmob (smob); + Grob *stem = unsmob (me->get_object ("stem")); if (stem) (void) stem->get_property ("positioning-done"); @@ -111,7 +122,7 @@ MAKE_SCHEME_CALLBACK (Note_head, print, 1); SCM Note_head::print (SCM smob) { - Grob *me = unsmob_grob (smob); + Grob *me = unsmob (smob); string idx; return internal_print (me, &idx).smobbed_copy (); @@ -121,7 +132,7 @@ MAKE_SCHEME_CALLBACK (Note_head, include_ledger_line_height, 1); SCM Note_head::include_ledger_line_height (SCM smob) { - Grob *me = unsmob_grob (smob); + Grob *me = unsmob (smob); Grob *staff = Staff_symbol_referencer::get_staff_symbol (me); if (staff) @@ -134,8 +145,8 @@ Note_head::include_ledger_line_height (SCM smob) // The +1 and -1 come from the fact that we only want to add // the interval between the note and the first ledger line, not // the whole interval between the note and the staff. - Interval iv (min (0.0, lines[UP] - my_ext[DOWN] + 1), - max (0.0, lines[DOWN] - my_ext[UP] - 1)); + Interval iv (std::min (0.0, lines[UP] - my_ext[DOWN] + 1), + std::max (0.0, lines[DOWN] - my_ext[UP] - 1)); return ly_interval2scm (iv); } @@ -152,7 +163,7 @@ Note_head::stem_attachment_coordinate (Grob *me, Axis a) } Offset -Note_head::get_stem_attachment (Font_metric *fm, string key) +Note_head::get_stem_attachment (Font_metric *fm, const string &key) { Offset att; @@ -180,7 +191,7 @@ MAKE_SCHEME_CALLBACK (Note_head, calc_stem_attachment, 1); SCM Note_head::calc_stem_attachment (SCM smob) { - Grob *me = unsmob_grob (smob); + Grob *me = unsmob (smob); Font_metric *fm = Font_interface::get_default_font (me); string key; internal_print (me, &key); @@ -194,8 +205,10 @@ ADD_INTERFACE (Note_head, " @ruser{Note head styles}.", /* properties */ + "duration-log " "note-names " "accidental-grob " + "ignore-ambitus " "glyph-name " "stem-attachment " "style "