+2002-11-20 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/beam-engraver.cc (stop_translation_timestep): reset now_stop_ev_
+
+ * lily/scm-option.cc: add parse-protect to ly:set-option
+
+ * lily/lexer.ll: set errorlevel if GUILE fails during parse.
+
+2002-11-19 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+
+ * lily/include/ligature-bracket.hh: removed
+ * lily/ligature-bracket.cc: removed
+
+ * lilypond-mode.el (LilyPond-expand-alist): set LaTeX extension to .tex
+
+ * lily/beam.cc (set_beaming): don't change beam count on rests.
+ (brew_molecule): always set flag-width > 0.
+
2002-11-19 Heikki Junes <hjunes@cc.hut.fi>
* lilypond-mode.el: LilyPond-imenu-generic-re: only alphabetic chars,
--- /dev/null
+\header {
+ texidoc = "The number of beams doesn't change on a rest."
+}
+
+\version "1.7.7"
+
+\score { \notes \relative c, {
+ \clef bass
+ [e8 r16 f d'8 e16 e16] [c8 c16 r16 bes8 r16 c16-] |
+ }
+\paper { linewidth = -1.0 }
+}
finished_beam_ = beam_;
finished_beam_info_ = beam_info_;
+ now_stop_ev_ = 0;
beam_ = 0;
beam_info_ = 0;
typeset_beam();
SCM gap = me->get_grob_property ("gap");
Molecule the_beam;
Real lt = me->get_paper ()->get_var ("linethickness");
+
for (int i = 0; i< stems.size(); i++)
{
Grob * st =stems[i];
Real xposn = st->relative_coordinate (xcommon, X_AXIS);
Real stem_width = gh_scm2double (st->get_grob_property ("thickness")) *lt;
+ /*
+ We do the space left of ST, with lfliebertjes pointing to the
+ right from the left stem, and rfliebertjes pointing left from
+ right stem.
+ */
if (i > 0)
{
SCM left = gh_cdr (last_beaming);
if (lfliebertjes.size() || rfliebertjes.size())
{
-
Real nw_f;
- if (!Stem::first_head (st))
- nw_f = 0;
- else
- {
- int t = Stem::duration_log (st);
- SCM proc = me->get_grob_property ("flag-width-function");
- SCM result = gh_call1 (proc, scm_int2num (t));
- nw_f = gh_scm2double (result);
- }
+ int t = Stem::duration_log (st);
+
+ SCM proc = me->get_grob_property ("flag-width-function");
+ SCM result = gh_call1 (proc, scm_int2num (t));
+ nw_f = gh_scm2double (result);
+
/* Half beam should be one note-width,
but let's make sure two half-beams never touch */
||(d == RIGHT && i == stems.size () -1))
continue;
-
- SCM beaming_prop = stems[i]->get_grob_property ("beaming");
+ Grob *st = stems[i];
+ SCM beaming_prop = st->get_grob_property ("beaming");
if (beaming_prop == SCM_EOL ||
index_get_cell (beaming_prop, d) == SCM_EOL)
{
int b = beaming->infos_.elem (i).beams_i_drul_[d];
- Stem::set_beaming (stems[i], b, d);
+ if (i>0
+ && i < stems.size() -1
+ && Stem::invisible_b (st))
+ b = b <? beaming->infos_.elem(i).beams_i_drul_[-d];
+
+ Stem::set_beaming (st, b, d);
}
}
while (flip (&d) != LEFT);
+++ /dev/null
-/*
- ligature-bracket.hh -- part of GNU LilyPond
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
-*/
-
-#ifndef LIGATURE_BRACKET_HH
-#define LIGATURE_BRACKET_HH
-
-#include "lily-proto.hh"
-#include "lily-guile.hh"
-
-struct Ligature_bracket
-{
- DECLARE_SCHEME_CALLBACK (brew_molecule, (SCM ));
- static bool has_interface (Grob*);
-};
-
-#endif /* LIGATURE_BRACKET_HH */
-
#include "input.hh"
#include "lily-guile.hh"
+extern bool parse_protect_global;
+
struct Parse_start
{
char const* str;
return SCM_T;
}
SCM sval = ly_parse_scm (s, &n, here_input());
+ if (sval == SCM_UNDEFINED)
+ {
+ sval = SCM_UNSPECIFIED;
+ errorlevel_ = 1;
+ }
for (int i=0; i < n; i++)
{
+++ /dev/null
-/*
- ligature-bracket.cc -- implement Ligature_bracket
-
- source file of the GNU LilyPond music typesetter
-
- (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
-*/
-
-#include "ligature-bracket.hh"
-#include "item.hh"
-#include "paper-def.hh"
-#include "spanner.hh"
-#include "staff-symbol-referencer.hh"
-#include "lookup.hh"
-#include "box.hh"
-
-static Molecule
-brew_edge (Direction dir, Real thickness, Real width, Real height,
- Real blotdiameter)
-{
- Molecule hline = Lookup::roundfilledbox (Box (Interval (0, width),
- Interval (0, thickness)),
- blotdiameter);
- hline.translate_axis (height - thickness, Y_AXIS);
-
- Molecule vline = Lookup::roundfilledbox (Box (Interval (0, thickness),
- Interval (0, height)),
- blotdiameter);
- if (dir == RIGHT)
- {
- vline.translate_axis (width - thickness, X_AXIS);
- }
-
- Molecule edge = Molecule ();
- edge.add_molecule (hline);
- edge.add_molecule (vline);
- return edge;
-}
-
-MAKE_SCHEME_CALLBACK (Ligature_bracket, brew_molecule, 1);
-SCM
-Ligature_bracket::brew_molecule (SCM smob)
-{
- Grob *me = unsmob_grob (smob);
- Spanner *spanner = dynamic_cast<Spanner*> (me);
- Real blotdiameter = me->get_paper ()->get_var ("blotdiameter");
- Real staff_space = Staff_symbol_referencer::staff_space (me);
-
- Real thickness = me->get_paper ()->get_var ("linethickness");
- SCM grob_thickness = me->get_grob_property ("thickness");
- if (gh_number_p (grob_thickness))
- thickness *= gh_scm2double (grob_thickness);
-
- SCM edge_width_scm = me->get_grob_property ("width");
- Real edge_width;
- if (gh_number_p (edge_width_scm))
- {
- edge_width = gh_scm2double (edge_width_scm);
- }
- else
- {
- edge_width = 0.75;
- }
- edge_width *= staff_space;
-
- SCM edge_height_scm = me->get_grob_property ("height");
- Real edge_height;
- if (gh_number_p (edge_height_scm))
- {
- edge_height = gh_scm2double (edge_height_scm);
- }
- else
- {
- edge_height = 0.5;
- }
- edge_height *= staff_space;
-
- Item* left_bound = spanner->get_bound (LEFT);
- Item* right_bound = spanner->get_bound (RIGHT);
-
- Molecule bracket = Molecule ();
-
- Real y_min_offs =
- 0.5 * Staff_symbol_referencer::line_count (me) * staff_space;
- Real y_left_offs = y_min_offs;
- Real y_right_offs = y_min_offs;
-
- Real left_bound_left_extent = 0;
-
- if (left_bound)
- {
- Molecule left_edge =
- brew_edge (LEFT, thickness, edge_width, edge_height, blotdiameter);
- Grob *left_common_x = me->common_refpoint (left_bound, X_AXIS);
- left_bound_left_extent =
- left_bound->extent (left_common_x, X_AXIS)[LEFT];
- left_edge.translate_axis (left_bound_left_extent, X_AXIS);
- bracket.add_molecule (left_edge);
- Grob *left_common_y = me->common_refpoint (left_bound, Y_AXIS);
- y_left_offs =
- max(y_left_offs, left_bound->extent (left_common_y, Y_AXIS)[UP]);
- }
- else
- {
- me->warning (_ ("no left bound"));
- }
-
- if (right_bound)
- {
- Molecule right_edge =
- brew_edge (RIGHT, thickness, edge_width, edge_height, blotdiameter);
- Grob *staff_symbol = Staff_symbol_referencer::get_staff_symbol (me);
- Grob *right_common_bound_x =
- right_bound->common_refpoint (staff_symbol, X_AXIS);
-
- Real left_offs = 0;
- if (left_bound)
- {
- Grob *left_common_bound_x =
- left_bound->common_refpoint (staff_symbol, X_AXIS);
- left_offs = left_bound->extent (left_common_bound_x, X_AXIS)[LEFT];
- }
-
- Real right_offs =
- right_bound->extent (right_common_bound_x, X_AXIS)[RIGHT];
-
- right_edge.translate_axis (+ right_offs
- - left_offs
- + left_bound_left_extent
- - edge_width,
- X_AXIS);
- bracket.add_molecule (right_edge);
- Grob *right_common_y = me->common_refpoint (right_bound, Y_AXIS);
- y_right_offs =
- max(y_right_offs, right_bound->extent (right_common_y, Y_AXIS)[UP]);
- }
- else
- {
- me->warning (_ ("no left bound"));
- }
-
- bracket.translate_axis (max (y_left_offs, y_right_offs), Y_AXIS);
-
- return bracket.smobbed_copy ();
-}
-
-ADD_INTERFACE (Ligature_bracket, "ligature-bracket-interface",
- "A bracket indicating a ligature in the original edition",
- "width thickness height ligature-primitive-callback");
*/
ps->nchars = 1;
- return SCM_EOL;
+ return SCM_UNDEFINED;
}
/*
&catch_protected_parse_body,
(void*)ps,
&parse_handler, (void*)ps);
-
}
-
-static bool protect = true;
-
-LY_DEFINE(set_parse_protect, "ly:set-parse-protect",
- 1,0,0, (SCM t),
- "If protection is switched on, errors in inline scheme are caught.
-If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation.")
-{
- protect = (t == SCM_BOOL_T);
- return SCM_UNSPECIFIED;
-}
+bool parse_protect_global = true;
SCM
ly_parse_scm (char const* s, int *n, Input i)
ps.str = s;
ps.start_location_ = i;
- SCM ans = protect ? protected_ly_parse_scm (&ps)
+ SCM ans = parse_protect_global ? protected_ly_parse_scm (&ps)
: internal_ly_parse_scm (&ps);
*n = ps.nchars;
+
return ans;
}
*/
#include <stdio.h>
+#include "parse-scm.hh"
#include "string.hh"
#include "lily-guile.hh"
#include "scm-option.hh"
printf ( " help ANY-SYMBOL\n"
" internal-type-checking BOOLEAN\n"
" midi-debug BOOLEAN\n"
+ " parse-protect BOOLEAN\n"
" testing-level INTEGER\n");
exit (0);
@item -t,--test
Switch on any experimental features. Not for general public use. */
-
LY_DEFINE (ly_set_option, "ly:set-option", 2, 0, 0, (SCM var, SCM val),
- "Set a global option value. Supported options include
-
-@table @code
-@item help
-List all options.
-@item midi-debug
-If set to true, generate human readable MIDI
-@item internal-type-checking
-Set paranoia for property assignments
-@end table
-
-This function is useful to call from the command line: @code{lilypond -e
-\"(ly-set-option 'midi-debug #t)\"}.
-")
+ "Set a global option value. Supported options include\n"
+"\n"
+"@table @code\n"
+"@item help\n"
+"List all options.\n"
+"@item midi-debug\n"
+"If set to true, generate human readable MIDI\n"
+"@item internal-type-checking\n"
+"Set paranoia for property assignments\n"
+"@item parse-protect\n"
+"If protection is switched on, errors in inline scheme are caught in the parser. \n"
+"If off, GUILE will halt on errors, and give a stack trace. Default is protected evaluation. \n"
+"@end table\n"
+"\n"
+"This function is useful to call from the command line: @code{lilypond -e\n"
+"\"(ly-set-option 'midi-debug #t)\"}.\n")
{
if (var == ly_symbol2scm ("help"))
{
{
testing_level_global = gh_scm2int (val);
}
+ else if (var == ly_symbol2scm ("parse-protect" ))
+ {
+ parse_protect_global = to_boolean(val);
+ }
else if (var == ly_symbol2scm ("internal-type-checking"))
{
internal_type_checking_global_b = to_boolean (val);
("%t" . ".tex")
("%d" . ".dvi")
("%p" . ".ps")
- ("%l" . ".latex")
+ ("%l" . ".tex")
("%x" . ".tely")
("%m" . ".midi")
)
(meta . ((interfaces . (key-signature-interface font-interface break-aligned-interface item-interface ))))
))
- (Ligature
- . (
- (molecule-callback . ,Ligature_bracket::brew_molecule)
- (meta . ((interfaces . (ligature-interface))))
- ))
-
(LigatureBracket
. (
(ligature-primitive-callback . ,Note_head::brew_molecule)
'()
)
+(ly:add-interface
+ 'ligature-bracket-interface
+ "A bracket indicating a ligature in the original edition"
+ '(width thickness height ligature-primitive-callback))
+
+
(ly:add-interface
'mark-interface
"a rehearsal mark"