+2006-03-20 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * input/regression/tie-single-manual.ly (Module): new file.
+
+ * lily/tie-formatting-problem.cc (find_optimal_tie_configuration):
+ look at has_manual_position_.
+ (from_ties): set has_manual_position_ if tie has staff-position set.
+
+ * lily/tuplet-bracket.cc (calc_positions): idem.
+
+ * lily/tuplet-number.cc (print): don't print tupletnumber if it
+ doesn't span time.
+
2006-03-19 Nicolas Sceaux <nicolas.sceaux@free.fr>
* scm/define-markup-commands.scm (smallCaps): new markup command
--- /dev/null
+
+\header {
+ texidoc = "Individual ties may be formatted manually by
+specifying their @code{direction} and/or @code{staff-position}."
+
+}
+
+\version "2.7.39"
+
+\paper {
+ ragged-right = ##t
+}
+
+{
+ \override Tie #'staff-position = #-5.5
+ c'4 ~ c'
+ \override Tie #'staff-position = #-6.5
+ c'4 ~ c'
+ \override Tie #'staff-position = #-7.5
+ c'4 ~ c'
+}
string start_type
= ly_symbol2string (current_cresc_ev_->get_property ("name"));
-
- /*
- ugh. Use push/pop?
- */
+
if (start_type == "DecrescendoEvent")
start_type = "decrescendo";
else if (start_type == "CrescendoEvent")
start_type = "crescendo";
+
+
+ /*
+ UGH. TODO: should read from original event, so appearance
+ may be altered with \tweak.
+ */
SCM s = get_property ((start_type + "Spanner").c_str ());
if (!scm_is_symbol (s) || s == ly_symbol2scm ("hairpin"))
{
}
spec.position_ = Tie::get_position (ties[i]);
-
+ if (scm_is_number (ties[i]->get_property ("staff-position")))
+ {
+ spec.manual_position_ = scm_to_double (ties[i]->get_property ("staff-position"));
+ spec.has_manual_position_ = true;
+ spec.position_ = int (my_round (spec.manual_position_));
+ }
+
do
{
spec.note_head_drul_[d] = Tie::head (ties[i], d);
for (int i = 0; i < details_.single_tie_region_size_; i ++)
{
confs.push_back (generate_configuration (pos + i * dir, dir));
+
+ if (spec.has_manual_position_)
+ {
+ confs.back ()->delta_y_
+ = (spec.manual_position_ - spec.position_)
+ * 0.5 * details_.staff_space_;
+
+ break;
+ }
}
vector<Real> scores;
{
Grob *h = head (me, d);
if (h)
- return (int) Staff_symbol_referencer::get_position (h);
+ return (int) rint (Staff_symbol_referencer::get_position (h));
}
while (flip (&d) != LEFT);
(void) yparent->get_property ("positioning-done");
}
- if (!scm_is_pair (me->get_property ("control-points")))
+ if (!scm_is_pair (me->get_property_data (ly_symbol2scm ("control-points"))))
{
set_default_control_points (me);
}
"direction "
"line-thickness "
"quant-score "
+ "staff-position "
"thickness "
);
#include "spanner.hh"
#include "staff-symbol-referencer.hh"
#include "lookup.hh"
+#include "paper-column.hh"
+#include "moment.hh"
static Item *
get_x_bound_item (Grob *me_grob, Direction hdir, Direction my_dir)
Direction xdir, SCM sym)
{
Drul_array<Real> zero (0, 0);
- Drul_array<Real> pair = robust_scm2drul (me->internal_get_property (sym), zero);
+ Drul_array<Real> pair
+ = robust_scm2drul (me->internal_get_property (sym), zero);
pair[xdir] = 0.0;
me->internal_set_property (sym, ly_interval2scm (pair));
return 0;
}
- *equally_long = (beam_stems[0] == stems[LEFT] && beam_stems.back () == stems[RIGHT]);
+ *equally_long =
+ (beam_stems[0] == stems[LEFT] && beam_stems.back () == stems[RIGHT]);
return beams[LEFT];
}
x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS)[RIGHT]
- overshoot[LEFT];
}
+
else if (d == RIGHT
&& (columns.empty ()
|| (bounds[d]->get_column ()
!= dynamic_cast<Item *> (columns.back ())->get_column ())))
{
/*
+ We're connecting to a column, for the last bit of a broken
+ fullLength bracket.
+
TODO: make padding tunable?
*/
Real padding = 1.0;
if (bounds[d]->break_status_dir ())
padding = 0.0;
- x_span[d] = robust_relative_extent (bounds[d], commonx, X_AXIS) [LEFT] - padding;
+ x_span[d]
+ = robust_relative_extent (bounds[d], commonx, X_AXIS) [LEFT]
+ - padding;
}
}
while (flip (&d) != LEFT);
Real y
= tuplet_y.linear_combination (d * sign (other_dy));
-#if 0
/*
- Let's not take padding into account for nested tuplets.
+ We don't take padding into account for nested tuplets.
the edges can come very close to the stems, likewise for
nested tuplets?
*/
- Drul_array<Real> my_height
- = robust_scm2drul (me->get_property ("edge-height"),
- Interval (0, 0));
- if (dynamic_cast<Spanner *> (tuplets[i])->get_bound (d)
- == me->get_bound (d))
- y += dir * my_height[d];
-#endif
points.push_back (Offset (tuplet_x[d] - x0, y));
}
SCM
Tuplet_bracket::calc_positions (SCM smob)
{
- Grob *me = unsmob_grob (smob);
+ Spanner *me = unsmob_spanner (smob);
extract_grob_set (me, "note-columns", columns);
+
+ /*
+ Don't print if it doesn't span time.
+ */
+ if (robust_scm2moment (me->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
+ == robust_scm2moment (me->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
+ {
+ me->suicide ();
+ return SCM_EOL;
+ }
+
+
Direction dir = get_grob_direction (me);
bool equally_long = false;
Grob *par_beam = parallel_beam (me, columns, &equally_long);
*/
#include "tuplet-bracket.hh"
+#include "moment.hh"
+#include "paper-column.hh"
#include "text-interface.hh"
#include "spanner.hh"
#include "lookup.hh"
SCM
Tuplet_number::print (SCM smob)
{
+ Spanner *me = unsmob_spanner (smob);
+ Spanner *tuplet = unsmob_spanner (me->get_object ("bracket"));
+
+ if (!tuplet || !tuplet->is_live ())
+ {
+ me->suicide ();
+ return SCM_EOL;
+ }
+
+ /*
+ Don't print if it doesn't span time.
+ */
+ if (robust_scm2moment (tuplet->get_bound (LEFT)->get_column ()->get_property ("when"), Moment (0))
+ == robust_scm2moment (tuplet->get_bound (RIGHT)->get_column ()->get_property ("when"), Moment (0)))
+ {
+ me->suicide ();
+ return SCM_EOL;
+ }
+
Stencil *stc = unsmob_stencil (Text_interface::print (smob));
stc->align_to (X_AXIS, CENTER);
stc->align_to (Y_AXIS, CENTER);
- Spanner *me = unsmob_spanner (smob);
- Spanner *tuplet = unsmob_spanner (me->get_object ("bracket"));
SCM cpoints = tuplet->get_property ("control-points");
Drul_array<Offset> points;
points[LEFT] = ly_scm2offset (scm_car (cpoints));