2004-02-16 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/context.cc (find_create_context): go to Score if it exists.
+
* lily/context-scheme.cc: new file.
* lily/score-translator.cc (get_output): new file.
@tab printing lyrics
@tab
twinkle
-@c cheating ..
-@c@li lypond[fragment]
-@c \lyrics \new Lyrics { twinkle }
-@c @end lilypond
+@lilypond[fragment]
+\lyrics \new Lyrics { twinkle }
+@end lilypond
@item @code{twin -- kle}
@tab lyric hyphen
g2 e4 a2 f4 g2. }
\lyrics << \lyricsto "duet" \new Lyrics {
\set stanza = "B."
- \set vocName = "Bert"
+ \set vocNam = "Bert"
Hi, my name is bert. }
\lyricsto "duet" \new Lyrics {
\set stanza = "E."
- \set vocName = "Ernie"
+ \set vocNam = "Ernie"
Ooooo, ch\'e -- ri, je t'aime.
}
>> >>
l = gh_cons (gh_cons (ly_symbol2scm ("accepts"), get_accepted (SCM_EOL)), l);
l = gh_cons (gh_cons (ly_symbol2scm ("property-ops"), property_ops_), l);
l = gh_cons (gh_cons (ly_symbol2scm ("context-name"), context_name_), l);
- l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
+
+ if (gh_symbol_p (translator_group_type_))
+ l = gh_cons (gh_cons (ly_symbol2scm ("group-type"), translator_group_type_), l);
return l;
}
Context::find_create_context (SCM n, String id,
SCM operations)
{
+ /*
+ Don't create multiple score contexts.
+ */
+ if (dynamic_cast<Global_context*> (this)
+ && dynamic_cast<Global_context*> (this)->get_score_context ())
+ return get_score_context ()->find_create_context (n, id, operations);
+
+
Context * existing = find_existing_context (n,id);
if (existing)
return existing;
scm_puts (" ", port);
- scm_display (sc->implementation_, port);
-
-#if 0
- Translator * tr = unsmob_translator (sc->implementation_);
- if (Translator_group *tg = dynamic_cast<Translator_group*> (tr))
- scm_display (tg->get_simple_trans_list (), port);
-#endif
-
- /*
- don't try to print properties, that is too much hassle.
- */
+
+ scm_display (sc->context_list_, port);
scm_puts (" >", port);
return 1;
*/
+#include "context.hh"
#include "engraver-group-engraver.hh"
#include "protected-scm.hh"
SCM proc = get_property ("recordEventSequence");
if (gh_procedure_p (proc))
- scm_call_2 (proc, self_scm(), gh_cdr (accumulator_));
+ scm_call_2 (proc, daddy_context_->self_scm(), gh_cdr (accumulator_));
accumulator_ = SCM_EOL;
}
{
if (!to_boolean (get_property ("skipTypesetting")))
{
- recurse_down_engravers (daddy_context_, &Engraver::process_music, false);
+ recurse_down_engravers (daddy_context_, &Engraver::process_music, true);
recurse_down_engravers (daddy_context_, &Engraver::do_announces, true);
}
"Return an alist of properties of translator @var{me}.")
{
Translator *tr =unsmob_translator (me);
- SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Context");
+ SCM_ASSERT_TYPE (tr, me, SCM_ARG1, __FUNCTION__, "Translator");
return tr->translator_description ();
}
\translator {
\name Global
- % nothing else needed -- tweaks are ignored anyway.
\accepts Score
+\description "Hard coded entry point for LilyPond. Cannot be tuned."
}
%
\translator {
\name Global
\accepts Score
+\description "Hard coded entry point for LilyPond. Cannot be tuned."
}
\translator {
\StaffContext
(lambda (x)
(let*
((context (cdr (assoc 'context-name x)))
+ (group (assq-ref x 'group-type))
(consists (append
- (list
- (cdr (assoc 'group-type x)))
+ (if group
+ (list group)
+ '())
(cdr (assoc 'consists x))
))
(cdr desc-handle) "(not documented)"))
(accepts (cdr (assoc 'accepts context-desc)))
+ (group (assq-ref context-desc 'group-type))
+
(consists (append
- (list (cdr (assoc 'group-type context-desc)))
+ (if group (list group)
+ '())
(cdr (assoc 'consists context-desc))
))
(props (cdr (assoc 'property-ops context-desc)))
(map document-engraver-by-name consists))
))))
-(define (engraver-grobs grav)
+(define (engraver-grobs grav)
(let* ((eg (if (symbol? grav)
(find-engraver-by-name grav)
grav)))
-
(if (eq? eg #f)
'()
(map symbol->string (cdr (assoc 'grobs-created (ly:translator-description eg)))))
))
(define (context-grobs context-desc)
- (let* ((consists (append
- (list (cdr (assoc 'group-type context-desc)))
+ (let* (
+ (group (assq-ref context-desc 'group-type))
+ (consists (append
+ (if group
+ (list group)
+ '())
(cdr (assoc 'consists context-desc))
))
(grobs (apply append