+2002-05-17 Han-Wen <hanwen@cs.uu.nl>
+
+ * scm/music-functions.scm (check-start-chords): function to check
+ for chords without \context. Apply automatically from parser.
+
+2002-05-16 Han-Wen <hanwen@cs.uu.nl>
+
+ * lily/bar-line.cc: remove index entries. Texinfo can't handle :
+ in index entries.
+
+ * scm/output-lib.scm: fix ez notation stems.
+
+ * lily/paper-outputter.cc: various fixes to speed up compilation.
+
2002-05-16 Mats Bengtsson <mats.bengtsson@s3.kth.se>
* scripts/lilypond-book.py: Don't import pre for Python >= 2.2
* mf/GNUmakefile (INSTALLATION_OUT_FILES4): create and install
fonts.dir file.
- * lily/parser.yy (My_lily_parser): uncomment code. (Causes
+ * lily/parser.yy (My_lily_parser): comment out code. (Causes
problems with recent bison releases).
* make/lilypond.redhat.spec.in: add pfa fonts to X.
# however, this triggers compilation during install, which is a bad thing (tm).
$(outdir)/lilypond-internals.nexi $(outdir)/lilypond-internals.texi: $(depth)/$(builddir)/lily/$(outconfbase)/lilypond
- cd $(outdir) && ../$(depth)/$(builddir)/lily/$(outconfbase)/lilypond ../$(src-depth)/ly/generate-documentation
+ cd $(outdir) && ../$(depth)/$(builddir)/lily/$(outconfbase)/lilypond --verbose ../$(src-depth)/ly/generate-documentation
-ln $(outdir)/lilypond-internals.texi $(outdir)/lilypond-internals.nexi
calculate the number of semitones of @var{p} from central C.
@end defun
-@defun Pitch::transpose t p
+@defun Pitch@code{:}@code{:}transpose t p
Transpose @var{p} by the amount @var{t}, where @var{t} is the pitch that
central C is transposed to.
@end defun
set value of property @var{sym} in context @var{tr} to @var{val}.
@end defun
-@defun Translator::name tr
+@defun Translator@code{:}@code{:}name tr
Return the type name of the translator @var{tr}.
@end defun
-@defun Translator::description tr
+@defun Translator@code{:}@code{:}description tr
Return an alist of properties of translator @var{tr}.
@end defun
\item
No operator[] is provided, since this would be enormously slow. If needed,
- convert to char const* .
+k convert to char const* .
\end{itemize}
*/
*/
-// fix constness: gcc-2.95 is correct in defining
-// typeof (*this)
-// in a const member function to be const
-
-#if 0
-#define VIRTUAL_COPY_CONS(base) \
- virtual base *clone () const \
- { \
- return new typeof (*this) (*this); \
- }
-#else
+/*
+ fix constness: gcc-2.95 is correct in defining
+
+ typeof (*this)
+
+ in a const member function to be const
+*/
#define VIRTUAL_COPY_CONS(base) \
virtual base* clone_const_helper () \
{ \
base* urg = (base*)this; \
return urg->clone_const_helper (); \
}
-#endif
+
#endif /* VIRTUAL_METHODS_HH */
This is a request to print a special bar symbol. It replaces the
regular bar symbol with a special
symbol. The argument @var{bartype} is a string which specifies the
-kind of bar to print. Options are @code{:|}
-@cindex |A@@@code{:|}
-,
-@code{|:}
-@cindex |B@@@code{|:}
-, @code{:|:}
-@cindex |C@@@code{:|:}
-,
-@code{||}
-@cindex |D@@@code{||}
-, @code{|.}
-@cindex |E@@@code{|.}
-,
-@code{.|}
-@cindex |F@@@code{.|}
-, and @code{.|.}
-@cindex |G@@@code{.|.}
-.
+kind of bar to print. Options are @code{:|},
+@code{|:}, @code{:|:},
+@code{||}, @code{|.},
+@code{.|}, and @code{.|.}.
These produce, respectively, a right repeat, a left repeat, a double
repeat, a double bar, a start bar, an end bar, and a thick double bar.
(c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
+
#include "grob.hh"
#include "grob-info.hh"
-#include "request.hh"
-#include "translator.hh"
+#include "music.hh"
#include "translator-group.hh"
Grob_info::Grob_info (Grob*s_l)
/*
- clef.hh -- declare
+ clef.hh -- declare Clef
source file of the GNU LilyPond music typesetter
#include "array.hh"
#include "duration.hh"
#include "pitch.hh"
-#include "protected-scm.hh"
+
class Break_req : public Request {
public:
#include "box.hh"
#include "grob.hh"
#include "drul-array.hh"
-#include "protected-scm.hh"
+
/**
A horizontally fixed size element of the score.
#include "engraver.hh"
#include "item.hh"
#include "smobs.hh"
+#include "protected-scm.hh"
class Syllable_group;
private:
/** association list of Syllable_group smobs
+
+ fixme: should use property.
+
*/
Protected_scm voice_alist_;
Grob * any_notehead_l_;
extern int score_count_global;
extern Sources* source_global_l;
-#include <iostream.h> /* gcc 3.0 */
-
-
#endif /* MAIN_HH */
#define OUTPUT_PROPERTY_HH
#include "music.hh"
-//#include "protected-scm.hh"
+
/*
#include "lily-proto.hh"
#include "lily-guile.hh"
#include "real.hh"
-
-#include "moment.hh"
#include "array.hh"
#include "interval.hh"
#include "music-output-def.hh"
-#include "protected-scm.hh"
+
/**
#include "lily-proto.hh"
#include "music-output.hh"
#include "lily-guile.hh"
-#include "protected-scm.hh"
+
/** all stuff which goes onto paper. notes, signs, symbols in a score
#Paper_score# contains the items, the columns.
#include "input.hh"
#include "lily-proto.hh"
-#include "protected-scm.hh"
+
#include "parray.hh"
#include "smobs.hh"
#ifndef SCORELINE_HH
#define SCORELINE_HH
-#include "protected-scm.hh"
+
#include "column-x-positions.hh"
#include "spanner.hh"
#include "lily-proto.hh"
#include "virtual-methods.hh"
#include "lily-guile.hh"
-#include "parray.hh"
#include "input.hh"
#include "smobs.hh"
}
/*
- for unknown reason, we don't use IMPLEMENT_TYPE_P
+ We don't use IMPLEMENT_TYPE_P, since the smobification part is
+ implemented separately from the class.
*/
SCM
ly_input_p (SCM x)
return unsmob_input (x) ? SCM_BOOL_T : SCM_BOOL_F ;
}
+SCM
+ly_input_message (SCM sip, SCM msg)
+{
+ Input *ip = unsmob_input(sip);
+
+ SCM_ASSERT_TYPE(ip, sip, SCM_ARG1, __FUNCTION__, "input location");
+ SCM_ASSERT_TYPE(gh_string_p(msg), msg, SCM_ARG2, __FUNCTION__, "string");
+
+ String m = ly_scm2string (msg);
+
+ ip->message (m);
+ return SCM_UNDEFINED;
+}
static void
scm_c_define_gsubr ("ly-input-location?", 1, 0, 0,
(Scheme_function_unknown)ly_input_p);
+ scm_c_define_gsubr ("ly-input-message", 2, 0, 0,
+ (Scheme_function_unknown)ly_input_message);
}
SCM
/*
Compute the width the head without ledgers.
+
+ -- there used to be some code from the time that ledgers
+ did take space. Nowadays, we can simply take the standard extent.
*/
Interval
Note_head::head_extent (Grob *me, Axis a)
{
- return internal_brew_molecule (me, false).extent (a);
+ return me->get_molecule()->extent (a);
}
*/
#include <time.h>
-
#include <math.h>
-
#include "dimensions.hh"
#include "virtual-methods.hh"
#include "paper-outputter.hh"
SCM m = $1->self_scm ();
scm_gc_unprotect_object (m);
$$->music_ = m;
+
+ /*
+ guh.
+ */
+ SCM check_func = scm_c_eval_string ("check-start-chords");
+ gh_call1 (check_func, m);
+
}
| SCORE_IDENTIFIER {
$$ = new Score (*unsmob_score ($1));
SEQUENTIAL '{' Music_list '}' {
$$ = new Sequential_music (SCM_EOL);
$$->set_mus_property ("elements", ly_car ($3));
+ $$->set_spot(THIS->here_input());
}
| '{' Music_list '}' {
$$ = new Sequential_music (SCM_EOL);
$$->set_mus_property ("elements", ly_car ($2));
+ $$->set_spot(THIS->here_input());
}
;
SIMULTANEOUS '{' Music_list '}'{
$$ = new Simultaneous_music (SCM_EOL);
$$->set_mus_property ("elements", ly_car ($3));
+ $$->set_spot(THIS->here_input());
}
| '<' Music_list '>' {
$$ = new Simultaneous_music (SCM_EOL);
$$->set_mus_property ("elements", ly_car ($2));
+ $$->set_spot(THIS->here_input());
}
;
))
;;;
+
+;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;
+
+(define (has-request-chord elts)
+ (reduce (lambda (x y) (or x y)) (map (lambda (x) (equal? (ly-music-name x)
+ "Request_chord")) elts)
+ ))
+
+(define (ly-music-message music msg)
+ (let* (
+ (ip (ly-get-mus-property music 'origin))
+ )
+
+ (if (ly-input-location? ip)
+ (ly-input-message ip msg)
+ (ly-warn msg))
+ ))
+
+(define (check-start-chords music)
+ "Check music expression for a Simultaneous_music containing notes
+(ie. Request_chords), without context specification.
+
+Called from parser.
+"
+ (let*
+ ((es (ly-get-mus-property music 'elements))
+ (e (ly-get-mus-property music 'element))
+ (name (ly-music-name music))
+ )
+
+ (cond
+ ((equal? name "Context_specced_music") #t)
+ ((equal? name "Simultaneous_music")
+
+ (if (has-request-chord es)
+ (ly-music-message music "Starting score with a chord.
+Please insert an explicit \\context before chord")
+ (map check-start-chords es)))
+
+ ((equal? name "Sequential_music")
+ (if (pair? es)
+ (check-start-chords (car es))))
+ (else (if (music? e) (check-start-chords e )))
+
+ ))
+
+ music
+ )
((harmonic) '(1.0 0.0))
((triangle) '(0.75 . 0.15))
(else
+
+ ;; this also works for easy notation.
'(1.0 . 0.0)
)))