/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1996--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1996--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "font-interface.hh"
#include "international.hh"
#include "output-def.hh"
-#include "staff-symbol.hh"
-#include "staff-symbol-referencer.hh"
#include "text-interface.hh"
-#include "warn.hh"
/*
TODO:
SCM
Time_signature::print (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Grob *me = Grob::unsmob (smob);
SCM st = me->get_property ("style");
SCM frac = me->get_property ("fraction");
int n = 4;
else
m = numbered_time_signature (me, n, d);
- /*
- position the signature centred on the staff line
- nearest to the middle of the staff
- */
- if (Grob *staff = Staff_symbol_referencer::get_staff_symbol (me))
- {
- std::vector<Real> const linepos = Staff_symbol::line_positions (staff);
- if (!linepos.empty ())
- {
- Interval const span = Staff_symbol::line_span (staff);
- Real const mid = span.center ();
- Real pos = linepos.front ();
- Real dist = fabs (pos - mid);
- for (std::vector<Real>::const_iterator
- i = linepos.begin (), e = linepos.end ();
- ++i != e;)
- {
- double const d = fabs (*i - mid);
- if (d < dist)
- {
- pos = *i;
- dist = d;
- }
- }
-
- m.translate_axis
- (pos * Staff_symbol_referencer::staff_space (me) / 2, Y_AXIS);
- }
- }
-
return m.smobbed_copy ();
}
return numbered_time_signature (me, n, d);
if ((style == "default") || (style == ""))
- style = to_string ("C");
+ style = ::to_string ("C");
if (style == "C")
{
return numbered_time_signature (me, n, d);
}
- string char_name = style + to_string (n) + to_string (d);
+ string char_name = style + ::to_string (n) + ::to_string (d);
me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic"));
Stencil out = Font_interface::get_default_font (me)
->find_by_name ("timesig." + char_name);
chain);
SCM sn = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
- ly_string2scm (to_string (num)));
+ ly_string2scm (::to_string (num)));
SCM sd = Text_interface::interpret_markup (me->layout ()->self_scm (), chain,
- ly_string2scm (to_string (den)));
+ ly_string2scm (::to_string (den)));
- Stencil n = *unsmob_stencil (sn);
- Stencil d = *unsmob_stencil (sd);
+ Stencil n = *Stencil::unsmob (sn);
+ Stencil d = *Stencil::unsmob (sd);
n.align_to (X_AXIS, CENTER);
d.align_to (X_AXIS, CENTER);