(children_contexts): new accessor function.
* lily/include/translator.hh (class Translator): make
daddy_context_ protected.
(class Translator): clean up.
* lily/include/context.hh (class Context): make daddy_context_
private.
* lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go
higher for finding Voice. (backportme)
* lily/include/context.hh (class Context): remove
find_context_below() as a method.
* Documentation/user/notation.itely (The Lyrics context): add note
about manual durations
* ly/chord-modifiers-init.ly (blackTriangleMarkup): use TeX-math
encoding.
* scm/output-tex.scm (text): dump \inputencoding{} for text.
2004-04-12 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/include/context.hh (class Context): make members protected.
+ (children_contexts): new accessor function.
+
+ * lily/include/translator.hh (class Translator): make
+ daddy_context_ protected.
+ (class Translator): clean up.
+
+ * lily/include/context.hh (class Context): make daddy_context_
+ private.
+
+ * lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go
+ higher for finding Voice. (backportme)
+
+ * lily/include/context.hh (class Context): remove
+ find_context_below() as a method.
+
+ * Documentation/user/notation.itely (The Lyrics context): add note
+ about manual durations
+
+ * ly/chord-modifiers-init.ly (blackTriangleMarkup): use TeX-math
+ encoding.
+
* scm/output-tex.scm (text): dump \inputencoding{} for text.
2004-04-11 Han-Wen Nienhuys <hanwen@xs4all.nl>
@internalsref{Melisma_translator} in the program reference for more
information.
+Lyrics can also be entered without @code{\lyricsto}. In this case the
+durations of each syllable must be entered explicitly, for example,
+
+@verbatim
+ play2 the4 game2.
+ sink2 or4 swim2.
+@end verbatim
+
+Alignment to a melody can be specified with the @code{associatedVoice}
+property,
+
+@verbatim
+ \set associatedVoice = #"melody"
+@end verbatim
+
+Here is an example demonstrating manual lyric durations,
+
+@lilypond[relative=1,verbatim,fragment]
+<< \context Voice = melody {
+ c2 e4 g2.
+ }
+ \new Lyrics \lyrics {
+ \set associatedVoice = #"melody"
+ play2 the4 game2.
+ } >>
+@end lilypond
+
+
+
+
When multiple stanzas are put on the same melody, it can happen that
two stanzas have melismata in different locations. This can be
remedied by switching off melismata for one
set_property_on_children (Context * trans, const char * sym, SCM val)
{
trans->set_property (sym, val);
- for (SCM p = trans->context_list_; is_pair (p); p = ly_cdr (p))
+ for (SCM p = trans->children_contexts (); is_pair (p); p = ly_cdr (p))
{
Context *trg = unsmob_context (ly_car (p));
set_property_on_children (trg, sym, ly_deep_copy (val));
{
last_keysig_ = get_property ("keySignature");
- Context * trans_ = daddy_context_;
+ Context * trans_ = get_parent_context ();
while (trans_)
{
trans_ -> set_property ("localKeySignature",
ly_deep_copy (last_keysig_));
- trans_ = trans_->daddy_context_;
+ trans_ = trans_->get_parent_context ();
}
- set_property_on_children (daddy_context_,"localKeySignature", last_keysig_);
+ set_property_on_children (get_parent_context (),"localKeySignature", last_keysig_);
}
/*
{
Context * dad = origin;
while (dad && !dad->is_alias (rule))
- dad = dad->daddy_context_;
+ dad = dad->get_parent_context ();
if (dad)
origin = dad;
if (change)
origin->set_property ("localKeySignature", localsig);
- origin = origin->daddy_context_;
+ origin = origin->get_parent_context ();
}
}
Accidental_entry entry ;
entry.head_ = info.grob_;
- entry.origin_ = info.origin_trans_->daddy_context_;
+ entry.origin_ = info.origin_trans_->get_parent_context ();
entry.melodic_ = note;
accidentals_.push (entry);
*/
if (last_keysig_ != sig)
{
- Context * trans_ = daddy_context_;
+ Context * trans_ = get_parent_context ();
while (trans_)
{
trans_ -> set_property ("localKeySignature", ly_deep_copy (sig));
- trans_ = trans_->daddy_context_;
+ trans_ = trans_->get_parent_context ();
}
- set_property_on_children (daddy_context_,"localKeySignature", sig);
+ set_property_on_children (get_parent_context (),"localKeySignature", sig);
last_keysig_ = sig;
}
Link_array<Context>
Audio_element_info::origin_contexts (Translator* end) const
{
- Context * t = origin_trans_->daddy_context_;
+ Context * t = origin_trans_->get_parent_context ();
Link_array<Context> r;
do {
r.push (t);
- t = t->daddy_context_;
- } while (t && t != end->daddy_context_);
+ t = t->get_parent_context ();
+ } while (t && t != end->get_parent_context ());
return r;
}
stems_ = new Link_array<Item>;
grouping_ = new Beaming_info_list;
- beam_settings_ = updated_grob_properties (daddy_context_, ly_symbol2scm ("Beam"));
+ beam_settings_ = updated_grob_properties (get_parent_context (), ly_symbol2scm ("Beam"));
beam_start_moment_ = now_mom ();
beam_start_location_ = *unsmob_moment (get_property ("measurePosition"));
while (current && !current->is_alias (to_type_sym))
{
last = current;
- current = current->daddy_context_;
+ current = current->get_parent_context ();
}
if (current && current->id_string_ == to_id)
if (!staffline_)
return ;
- String type = daddy_context_->context_name ();
+ String type = get_parent_context ()->context_name ();
SCM dims = get_property ("verticalExtent");
if (is_number_pair (dims))
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
- daddy_context_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ get_parent_context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
{
SCM b = get_property ("autoBeaming");
if (!to_boolean (b))
- daddy_context_->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ get_parent_context ()->set_property ("beamMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
while (current && !current->is_alias (to_type))
{
last = current;
- current = current->daddy_context_;
+ current = current->get_parent_context ();
}
if (current && current->id_string_ == to_id)
Context * where = get_outlet ();
while (!dest && where)
{
- dest = where->find_context_below (to_type, to_id);
- where = where->daddy_context_;
+ dest = find_context_below (where, to_type, to_id);
+ where = where->get_parent_context ();
}
if (dest)
SCM name_proc = get_property ("chordNameFunction");
SCM markup = scm_call_4 (name_proc, pitches, bass, inversion,
- daddy_context_->self_scm ());
+ get_parent_context ()->self_scm ());
/*
Ugh.
SCM basic = ly_symbol2scm ("Clef");
- execute_pushpop_property (daddy_context_, basic, glyph_sym, SCM_UNDEFINED);
- execute_pushpop_property (daddy_context_, basic, glyph_sym, glyph);
+ execute_pushpop_property (get_parent_context (), basic, glyph_sym, SCM_UNDEFINED);
+ execute_pushpop_property (get_parent_context (), basic, glyph_sym, glyph);
}
/**
if (to_boolean (force_clef))
{
- Context * w = daddy_context_->where_defined (ly_symbol2scm ("forceClef"));
+ Context * w = get_parent_context ()->where_defined (ly_symbol2scm ("forceClef"));
w->set_property ("forceClef", SCM_EOL);
}
}
Translator * g = get_translator (translator_group_type_);
g = g->clone ();
- g->simple_trans_list_ = names_to_translators (trans_names, tg);
+ g->simple_trans_list_ = SCM_EOL;
+
+ for (SCM s = trans_names; is_pair (s) ; s = ly_cdr (s))
+ {
+ Translator * t = get_translator (ly_car (s));
+ if (!t)
+ warning (_f ("can't find: `%s'", s));
+ else
+ {
+ Translator * tr = t->clone ();
+ SCM str = tr->self_scm ();
+ g->simple_trans_list_ = scm_cons (str, g->simple_trans_list_);
+ tr->daddy_context_ = tg;
+ scm_gc_unprotect_object (str);
+ }
+ }
+
+
+
tg->implementation_ = g->self_scm ();
if (dynamic_cast<Engraver*> (g))
g->simple_trans_list_ = filter_performers (g->simple_trans_list_);
{
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- return unsmob_context_def (tr->definition_)->get_context_name ();
+ return ly_symbol2scm (tr->context_name ().to_str0 ());
}
LY_DEFINE (is_contextushpop_property, "ly:context-pushpop-property",
Context *tr = unsmob_context (context);
SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
- tr = tr->daddy_context_ ;
+ tr = tr->get_parent_context () ;
if (tr)
return tr->self_scm ();
else
{
if (tr->is_alias (name))
return tr->self_scm ();
- tr = tr->daddy_context_ ;
+ tr = tr->get_parent_context () ;
}
return SCM_BOOL_F;
scm_gc_unprotect_object (properties_scm_);
}
-Context *
-Context::find_context_below (SCM n, String id)
-{
- if ((is_alias (n) && (id_string_ == id || id.is_empty ())))
- return this;
-
- Context* r = 0;
- for (SCM p = context_list_; !r && is_pair (p); p = ly_cdr (p))
- {
- Context * t = unsmob_context (ly_car (p));
-
- r = dynamic_cast<Context*> (t)->find_context_below (n, id);
- }
-
- return r;
-}
Context*
return get_score_context ()->find_create_context (n, id, operations);
- Context * existing = find_context_below (n,id);
+ Context * existing = find_context_below (this, n,id);
if (existing)
return existing;
none.
*/
SCM
-default_child_context_name (Context const *tg)
+Context::default_child_context_name () const
{
- return is_pair (tg->accepts_list_)
- ? ly_car (scm_last_pair (tg->accepts_list_))
+ return is_pair (accepts_list_)
+ ? ly_car (scm_last_pair (accepts_list_))
: SCM_EOL;
}
bool
Context::is_bottom_context () const
{
- return !is_symbol (default_child_context_name (this));
+ return !is_symbol (default_child_context_name ());
}
Context*
{
if (!is_bottom_context ())
{
- SCM nm = default_child_context_name (this);
+ SCM nm = default_child_context_name ();
SCM st = get_output_def ()->find_context_def (nm);
Context_def *t = unsmob_context_def (st);
*/
Context *
find_context_below (Context * where,
- String type, String id)
+ SCM type, String id)
{
if (where->is_alias (ly_symbol2scm (type.to_str0 ())))
{
}
Context * found = 0;
- for (SCM s = where->context_list_;
+ for (SCM s = where->children_contexts ();
!found && is_pair (s); s = ly_cdr (s))
{
Context * tr = unsmob_context (ly_car (s));
programming_error ("No Global context!");
return 0;
}
+
+Context*
+Context::get_parent_context () const
+{
+ return daddy_context_;
+}
Item *p = make_item ("Script");
SCM desc = SCM_EOL;
make_script_from_event (p, &desc,
- daddy_context_, script,
+ get_parent_context (), script,
0);
if (p->get_property ("follow-into-staff"))
{
cresc_ = make_spanner ("TextSpanner");
cresc_->set_property ("style", s);
- daddy_context_->set_property ((start_type
+ get_parent_context ()->set_property ((start_type
+ "Spanner").to_str0 (), SCM_EOL);
s = get_property ((start_type + "Text").to_str0 ());
/*
{
cresc_->set_property ("edge-text",
scm_cons (s, scm_makfrom0str ("")));
- daddy_context_->set_property ((start_type + "Text").to_str0 (),
+ get_parent_context ()->set_property ((start_type + "Text").to_str0 (),
SCM_EOL);
}
}
Engraver_group_engraver::initialize ()
{
SCM tab = scm_make_vector (scm_int2num (61), SCM_BOOL_F);
- daddy_context_->set_property ("acknowledgeHashTable", tab);
+ get_parent_context ()->set_property ("acknowledgeHashTable", tab);
Translator_group::initialize ();
}
(tg->*ptr) ();
}
- for (SCM s = c->context_list_ ; is_pair (s);
+ for (SCM s = c->children_contexts () ; is_pair (s);
s =ly_cdr (s))
{
recurse_down_engravers (unsmob_context (ly_car (s)), ptr, context_first);
if (extender_ || pending_extender_)
{
- Context *voice = get_voice_to_lyrics (daddy_context_);
+ Context *voice = get_voice_to_lyrics (get_parent_context ());
Grob* h = (voice) ? get_current_note_head (voice) : 0;
if (h)
t = SCM_CDRLOC (*t);
}
figure_ = make_item ("BassFigure");
- scm_call_3 (proc, l, daddy_context_->self_scm (),
+ scm_call_3 (proc, l, get_parent_context ()->self_scm (),
figure_->self_scm ());
announce_grob (figure_, figures_[0]->self_scm ()); // todo
}
/*
We only want to process a grob once.
*/
- if (gi.origin_trans_->daddy_context_ != daddy_context_)
+ if (gi.origin_trans_->get_parent_context () != get_parent_context ())
return ;
if (is_number (sz) && ly_scm2double (sz))
Link_array<Context>
Grob_info::origin_contexts (Translator* end) const
{
- Context * t = origin_trans_->daddy_context_;
+ Context * t = origin_trans_->get_parent_context ();
Link_array<Context> r;
do {
r.push (t);
- t = t->daddy_context_;
- } while (t && t != end->daddy_context_);
+ t = t->get_parent_context ();
+ } while (t && t != end->get_parent_context ());
return r;
}
void
Grob_pq_engraver::initialize ()
{
- daddy_context_->set_property ("busyGrobs", SCM_EOL);
+ get_parent_context ()->set_property ("busyGrobs", SCM_EOL);
}
LY_DEFINE (ly_grob_pq_less_p, "ly:grob-pq-less?",
SCM busy= get_property ("busyGrobs");
busy = scm_merge_x (lst, busy, ly_grob_pq_less_p_proc);
- daddy_context_->set_property ("busyGrobs", busy);
+ get_parent_context ()->set_property ("busyGrobs", busy);
}
}
}
if (start_busy != busy)
- daddy_context_->set_property ("busyGrobs", busy);
+ get_parent_context ()->set_property ("busyGrobs", busy);
}
void
}
if (start_busy != busy)
- daddy_context_->set_property ("busyGrobs", busy);
+ get_parent_context ()->set_property ("busyGrobs", busy);
}
DECLARE_SMOBS (Context, dummy);
void terminate ();
-public:
+
+protected:
+ Context * daddy_context_;
SCM definition_;
SCM properties_scm_;
SCM context_list_;
SCM accepts_list_;
SCM aliases_;
- Context * daddy_context_;
+ friend class Context_def;
+public:
+ SCM children_contexts () const { return context_list_; }
+ SCM default_child_context_name () const;
+
+ Context * get_parent_context () const;
Context ();
void execute_pushpop_property (SCM prop, SCM sym, SCM val);
virtual Music_output_def *get_output_def () const;
virtual Moment now_mom () const;
- Context *find_context_below (SCM context_name, String id);
Context *find_create_context (SCM context_name,
- String id, SCM ops);
+ String id, SCM ops);
Link_array<Context> path_to_acceptable_context (SCM alias,
Music_output_def*) const;
virtual Context *get_default_interpreter ();
void execute_pushpop_property (Context * trg, SCM prop, SCM eltprop, SCM val);
SCM updated_grob_properties (Context* tg, SCM sym);
Context * find_context_below (Context * where,
- String type, String id);
+ SCM type_sym, String id);
bool melisma_busy (Context*);
Context *get_voice_to_lyrics (Context *lyrics);
TRANSLATOR_DECLARATIONS(Engraver);
};
-#define make_item(x) make_item_from_properties (daddy_context_, ly_symbol2scm (x))
-#define make_spanner(x) make_spanner_from_properties (daddy_context_, ly_symbol2scm (x))
+#define make_item(x) make_item_from_properties (get_parent_context (), ly_symbol2scm (x))
+#define make_spanner(x) make_spanner_from_properties (get_parent_context (), ly_symbol2scm (x))
Item* make_item_from_properties (Context * tg, SCM x);
Spanner* make_spanner_from_properties (Context * tg, SCM x);
class Translator
{
void init ();
+
public:
- Music_output_def * output_def_;
+ Context * get_parent_context () const { return daddy_context_; }
Translator (Translator const &);
- Context * daddy_context_ ;
void removal_processing ();
- virtual Music_output_def *get_output_def () const;
SCM internal_get_property (SCM symbol) const;
+
+ virtual Music_output_def *get_output_def () const;
virtual Translator_group* get_daddy_translator ()const;
virtual Moment now_mom () const;
-
-public:
- DECLARE_SMOBS (Translator, dummy);
-
-protected: // should be private.
- SCM simple_trans_list_;
- friend class Context_def;
-
-public:
- Score_context * get_score_context () const;
- Global_context * get_global_context () const;
-
- TRANSLATOR_DECLARATIONS(Translator);
virtual bool try_music (Music *req);
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
virtual void process_music ();
virtual void do_announces ();
virtual void finalize ();
+
+ Score_context * get_score_context () const;
+ Global_context * get_global_context () const;
+
+ TRANSLATOR_DECLARATIONS(Translator);
+ DECLARE_SMOBS (Translator, dummy);
+protected: // should be private.
+ Context * daddy_context_ ;
+ SCM simple_trans_list_;
+ friend class Context_def;
+ friend class Context;
};
/**
void
Instrument_name_engraver::initialize ()
{
- daddy_context_->set_property ("instrumentSupport", SCM_EOL);
+ get_parent_context ()->set_property ("instrumentSupport", SCM_EOL);
}
void
SCM nl = scm_cons (i.grob_->self_scm (),
get_property ("instrumentSupport"));
- daddy_context_->set_property ("instrumentSupport", nl);
+ get_parent_context ()->set_property ("instrumentSupport", nl);
}
}
if (ly_scm2int (ly_cdar (s)))
accs = scm_cons (ly_car (s), accs);
- daddy_context_->set_property ("keySignature", accs);
- daddy_context_->set_property ("tonic" ,
+ get_parent_context ()->set_property ("keySignature", accs);
+ get_parent_context ()->set_property ("tonic" ,
r->get_property ("tonic"));
}
Key_engraver::start_translation_timestep ()
{
key_ev_ = 0;
- daddy_context_->set_property ("lastKeySignature", get_property ("keySignature"));
+ get_parent_context ()->set_property ("lastKeySignature", get_property ("keySignature"));
}
void
Key_engraver::initialize ()
{
- daddy_context_->set_property ("keySignature", SCM_EOL);
- daddy_context_->set_property ("lastKeySignature", SCM_EOL);
+ get_parent_context ()->set_property ("keySignature", SCM_EOL);
+ get_parent_context ()->set_property ("lastKeySignature", SCM_EOL);
Pitch p (0,0,0);
- daddy_context_->set_property ("tonic", p.smobbed_copy ());
+ get_parent_context ()->set_property ("tonic", p.smobbed_copy ());
}
{
SCM target_callback = ly_symbol2scm ("print-function");
SCM source_callback = ly_symbol2scm ("ligature-primitive-callback");
- SCM noteHeadProperties = updated_grob_properties (daddy_context_, ly_symbol2scm ("NoteHead"));
+ SCM noteHeadProperties = updated_grob_properties (get_parent_context (), ly_symbol2scm ("NoteHead"));
SCM value = ly_cdr (scm_sloppy_assq (source_callback, noteHeadProperties));
- execute_pushpop_property (daddy_context_, ly_symbol2scm ("NoteHead"),
+ execute_pushpop_property (get_parent_context (), ly_symbol2scm ("NoteHead"),
target_callback, value);
}
{
SCM symbol = ly_symbol2scm ("NoteHead");
SCM key = ly_symbol2scm ("print-function");
- execute_pushpop_property (daddy_context_, symbol, key, SCM_UNDEFINED);
+ execute_pushpop_property (get_parent_context (), symbol, key, SCM_UNDEFINED);
}
void
if (Context *c = unsmob_context (avc))
return c;
- SCM voice = lyrics->get_property ("associatedVoice");
+ SCM voice_name = lyrics->get_property ("associatedVoice");
String nm = lyrics->id_string_;
- if (is_string (voice))
- nm = ly_scm2string (voice);
+ if (is_string (voice_name))
+ nm = ly_scm2string (voice_name);
else
{
int idx = nm.index_last ('-');
nm = nm.left_string (idx);
}
- Context *c = lyrics->find_context_below (ly_symbol2scm ("Voice"), nm);
+ Context *parent = lyrics;
+ Context *voice = 0;
+ while (parent && !voice)
+ {
+ voice = find_context_below (parent, ly_symbol2scm ("Voice"), nm);
+ parent = parent->get_parent_context ();
+ }
- if (c)
- return c;
+ if (voice)
+ return voice;
+
+ parent = lyrics;
+ voice = 0;
+ while (parent && !voice)
+ {
+ voice = find_context_below (parent, ly_symbol2scm ("Voice"), "");
+ parent = parent->get_parent_context ();
+ }
- return lyrics->find_context_below (ly_symbol2scm ("Voice"), "");
+ return voice;
}
Grob *
{
if (text_)
{
- Context * voice = get_voice_to_lyrics (daddy_context_);
+ Context * voice = get_voice_to_lyrics (get_parent_context ());
if (voice)
{
{
int mark_count = ly_scm2int (m);
mark_count ++;
- daddy_context_->set_property ("rehearsalMark",
+ get_parent_context ()->set_property ("rehearsalMark",
scm_int2num (mark_count));
}
if (is_number (m))
- m = scm_call_2 (proc, m, daddy_context_->self_scm ());
+ m = scm_call_2 (proc, m, get_parent_context ()->self_scm ());
else
warning ("rehearsalMark does not have integer value.");
}
{
if (m->is_mus_type ("melisma-playing-event"))
{
- return melisma_busy (daddy_context_);
+ return melisma_busy (get_parent_context ());
}
else if (m->is_mus_type ("melisma-span-event"))
{
SCM sd = event_->get_property ("span-direction");
Direction d = to_dir (sd);
if (d == START)
- daddy_context_->set_property ("melismaBusy", SCM_BOOL_T);
+ get_parent_context ()->set_property ("melismaBusy", SCM_BOOL_T);
else
- daddy_context_->unset_property (ly_symbol2scm ("melismaBusy"));
+ get_parent_context ()->unset_property (ly_symbol2scm ("melismaBusy"));
}
}
SCM proc = get_property ("metronomeMarkFormatter");
SCM result= scm_call_2 (proc, mark_ev_->self_scm (),
- daddy_context_->self_scm ());
+ get_parent_context ()->self_scm ());
text_->set_property ("text", result);
}
{
while (child && child != me)
{
- child = child->daddy_context_;
+ child = child->get_parent_context ();
}
return child == me;
Finger_tuple ft ;
Grob * g= make_item ("Script");
- make_script_from_event (g, &ft.description_, daddy_context_,
+ make_script_from_event (g, &ft.description_, get_parent_context (),
event->get_property ("articulation-type"), 0);
if (g)
{
if (lyric_iter_)
lyrics_context_ = find_context_below (lyric_iter_->get_outlet (),
- "Lyrics", "");
+ ly_symbol2scm ("Lyrics"), "");
/*
We do not create a Lyrics context, because the user might
if (is_string (voice_name))
{
Context *t = get_outlet ();
- while (t && t->daddy_context_)
- t = t->daddy_context_;
+ while (t && t->get_parent_context ())
+ t = t->get_parent_context ();
String name = ly_scm2string (voice_name);
- Context *voice = find_context_below (t, "Voice", name);
+ Context *voice = find_context_below (t, ly_symbol2scm ("Voice"), name);
if (!voice)
get_music ()->origin ()->warning (_f ("cannot find Voice: %s",
name.to_str0 ()) + "\n");
if (!music_context_)
return ;
- if (!music_context_->daddy_context_)
+ if (!music_context_->get_parent_context ())
{
/*
The melody has died.
head_ = info.grob_;
if (to_boolean (get_property ("followVoice")))
{
- Context * tr = daddy_context_;
+ Context * tr = get_parent_context ();
while (tr && !tr->is_alias (ly_symbol2scm ( "Staff")))
- tr = tr->daddy_context_ ;
+ tr = tr->get_parent_context () ;
if (tr
&& tr->is_alias (ly_symbol2scm ("Staff")) && tr != last_staff_)
dynamic_cast<Context *> (inf.origin_trans_);
if (!d)
- d = dynamic_cast<Context *> (inf.origin_trans_->daddy_context_);
+ d = dynamic_cast<Context *> (inf.origin_trans_->get_parent_context ());
SCM proc = o->get_property ("procedure");
scm_call_3 (proc,
inf.grob_->self_scm (),
d->self_scm (),
- daddy_context_->self_scm ());
+ get_parent_context ()->self_scm ());
}
}
}
{
announce_infos_.push (info);
Translator *t
- = unsmob_translator (daddy_context_->daddy_context_->implementation_);
+ = unsmob_translator (get_parent_context ()->get_parent_context ()->implementation_);
if (Performer_group_performer * eg = dynamic_cast<Performer_group_performer*> (t))
eg->announce_element (info);
SCM proc = get_property ("recordEventSequence");
if (is_procedure (proc))
- scm_call_2 (proc, daddy_context_->self_scm (), ly_cdr (accumulator_));
+ scm_call_2 (proc, get_parent_context ()->self_scm (), ly_cdr (accumulator_));
accumulator_ = SCM_EOL;
}
void
Repeat_acknowledge_engraver::initialize ()
{
- daddy_context_->set_property ("repeatCommands", SCM_EOL);
+ get_parent_context ()->set_property ("repeatCommands", SCM_EOL);
}
void
Repeat_acknowledge_engraver::start_translation_timestep ()
{
- Context * tr = daddy_context_->where_defined (ly_symbol2scm ("repeatCommands"));
+ Context * tr = get_parent_context ()->where_defined (ly_symbol2scm ("repeatCommands"));
if (!tr)
- tr = daddy_context_;
+ tr = get_parent_context ();
tr->set_property ("repeatCommands", SCM_EOL);
}
{
if (s != "" || (volta_found && !is_string (wb)))
{
- daddy_context_->set_property ("whichBar", scm_makfrom0str (s.to_str0 ()));
+ get_parent_context ()->set_property ("whichBar", scm_makfrom0str (s.to_str0 ()));
}
}
}
if (!command_column_)
{
SCM nmp
- = updated_grob_properties (daddy_context_,
+ = updated_grob_properties (get_parent_context (),
ly_symbol2scm ("NonMusicalPaperColumn"));
- SCM pc = updated_grob_properties (daddy_context_,
+ SCM pc = updated_grob_properties (get_parent_context (),
ly_symbol2scm ("PaperColumn"));
set_columns (new Paper_column (nmp), new Paper_column (pc));
command_column_->set_property ("when", w);
musical_column_->set_property ("when", w);
- recurse_over_translators (daddy_context_, &Translator::start_translation_timestep, DOWN);
+ recurse_over_translators (get_parent_context (), &Translator::start_translation_timestep, DOWN);
}
void
if ((breaks_%8))
progress_indication ("[" + to_string (breaks_) + "]");
- recurse_over_translators (daddy_context_, &Translator::finalize, UP);
+ recurse_over_translators (get_parent_context (), &Translator::finalize, UP);
}
/*
pscore_ = new Paper_score;
pscore_->paper_ = dynamic_cast<Paper_def*> (get_output_def ());
- SCM props = updated_grob_properties (daddy_context_, ly_symbol2scm ("System"));
+ SCM props = updated_grob_properties (get_parent_context (), ly_symbol2scm ("System"));
pscore_->typeset_line (new System (props));
{
if (!to_boolean (get_property ("skipTypesetting")))
{
- recurse_over_translators (daddy_context_, &Engraver::process_music, UP);
- recurse_over_translators (daddy_context_, &Engraver::do_announces, UP);
+ recurse_over_translators (get_parent_context (), &Engraver::process_music, UP);
+ recurse_over_translators (get_parent_context (), &Engraver::do_announces, UP);
}
- recurse_over_translators (daddy_context_, &Translator::stop_translation_timestep, UP);
+ recurse_over_translators (get_parent_context (), &Translator::stop_translation_timestep, UP);
}
void
musical_column_ = new_musical;
if (new_command)
{
- daddy_context_->set_property ("currentCommandColumn", new_command->self_scm ());
+ get_parent_context ()->set_property ("currentCommandColumn", new_command->self_scm ());
}
if (new_musical)
{
- daddy_context_->set_property ("currentMusicalColumn", new_musical->self_scm ());
+ get_parent_context ()->set_property ("currentMusicalColumn", new_musical->self_scm ());
}
}
{
audio_column_ = new Audio_column (m);
play_element (audio_column_);
- recurse_over_translators (daddy_context_, &Translator::start_translation_timestep, UP);
+ recurse_over_translators (get_parent_context (), &Translator::start_translation_timestep, UP);
}
void
Score_performer::finish ()
{
- recurse_over_translators (daddy_context_, &Translator::finalize, UP);
+ recurse_over_translators (get_parent_context (), &Translator::finalize, UP);
}
void
Score_performer::one_time_step ()
{
- recurse_over_translators (daddy_context_, &Performer::process_music, UP);
- recurse_over_translators (daddy_context_, &Performer::do_announces, UP);
- recurse_over_translators (daddy_context_, &Translator::stop_translation_timestep, UP);
+ recurse_over_translators (get_parent_context (), &Performer::process_music, UP);
+ recurse_over_translators (get_parent_context (), &Performer::do_announces, UP);
+ recurse_over_translators (get_parent_context (), &Translator::stop_translation_timestep, UP);
}
int
Grob * p = make_item ("Script");
- make_script_from_event (p, &scripts_[i].description_, daddy_context_,
+ make_script_from_event (p, &scripts_[i].description_, get_parent_context (),
l->get_property ("articulation-type"),
i);
if (ib)
{
p_ref_->set_property ("breakable", SCM_BOOL_T);
- daddy_context_->set_property ("breakableSeparationItem", p_ref_->self_scm ());
+ get_parent_context ()->set_property ("breakableSeparationItem", p_ref_->self_scm ());
}
announce_grob (p_ref_, SCM_EOL);
Separating_line_group_engraver::start_translation_timestep ()
{
if (break_item_)
- daddy_context_->unset_property (ly_symbol2scm ("breakableSeparationItem"));
+ get_parent_context ()->unset_property (ly_symbol2scm ("breakableSeparationItem"));
break_item_ =0;
}
/* if create_separate_contexts_ is set, create a new context with the
number number as name */
- SCM name = unsmob_context_def (get_outlet ()->definition_)->get_context_name ();
+ SCM name = ly_symbol2scm (get_outlet ()->context_name ().to_str0 ());
Context * t = (j && create_separate_contexts_)
? get_outlet ()->find_create_context (name, to_string (j), SCM_EOL)
: get_outlet ();
void
Slur_engraver::set_melisma (bool m)
{
- daddy_context_->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
+ get_parent_context ()->set_property ("slurMelismaBusy", m ? SCM_BOOL_T :SCM_BOOL_F);
}
void
void
Slur_performer::set_melisma (bool ml)
{
- daddy_context_->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
+ get_parent_context ()->set_property ("slurMelismaBusy", ml ? SCM_BOOL_T :SCM_BOOL_F);
}
void
SCM staffs = get_property ("stavesFound");
staffs = scm_cons (gi.grob_->self_scm (), staffs);
- daddy_context_->set_property ("stavesFound", staffs);
+ get_parent_context ()->set_property ("stavesFound", staffs);
}
}
audio_staff_ = new Audio_staff;
announce_element (Audio_element_info (audio_staff_, 0));
- name_ = new Audio_text (Audio_text::TRACK_NAME, daddy_context_->id_string_);
+ name_ = new Audio_text (Audio_text::TRACK_NAME, get_parent_context ()->id_string_);
announce_element (Audio_element_info (name_, 0));
tempo_ = new Audio_tempo (get_tempo ());
else
requested_type = 8;
else
- daddy_context_->set_property ("tremoloFlags", scm_int2num (requested_type));
+ get_parent_context ()->set_property ("tremoloFlags", scm_int2num (requested_type));
int tremolo_flags = intlog2 (requested_type) - 2
- (duration_log > 2 ? duration_log - 2 : 0);
if (is_number (prop))
{
Stem::set_beaming (stem_,ly_scm2int (prop),LEFT);
- daddy_context_->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
+ get_parent_context ()->unset_property (ly_symbol2scm ("stemLeftBeamCount"));
}
prop = get_property ("stemRightBeamCount");
if (is_number (prop))
{
Stem::set_beaming (stem_,ly_scm2int (prop), RIGHT);
- daddy_context_->unset_property (ly_symbol2scm ("stemRightBeamCount"));
+ get_parent_context ()->unset_property (ly_symbol2scm ("stemRightBeamCount"));
}
typeset_grob (stem_);
if (!delim_)
{
SCM delim_name =get_property ("systemStartDelimiter");
- delim_ = make_spanner_from_properties (daddy_context_, delim_name);
+ delim_ = make_spanner_from_properties (get_parent_context (), delim_name);
delim_->set_bound (LEFT, unsmob_grob (get_property ("currentCommandColumn")));
announce_grob (delim_, SCM_EOL);
Tie_engraver::process_music ()
{
if (event_)
- daddy_context_->set_property ("tieMelismaBusy", SCM_BOOL_T);
+ get_parent_context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
}
void
void
Tie_engraver::start_translation_timestep ()
{
- daddy_context_->set_property ("tieMelismaBusy",
+ get_parent_context ()->set_property ("tieMelismaBusy",
ly_bool2scm (heads_to_tie_.size ()));
}
Tie_performer::process_music ()
{
if (event_)
- daddy_context_->set_property ("tieMelismaBusy", SCM_BOOL_T);
+ get_parent_context ()->set_property ("tieMelismaBusy", SCM_BOOL_T);
}
void
void
Tie_performer::start_translation_timestep ()
{
- daddy_context_->set_property ("tieMelismaBusy",
+ get_parent_context ()->set_property ("tieMelismaBusy",
ly_bool2scm (heads_to_tie_.size ()));
}
which = (now.main_part_ || now.main_part_ == last_moment_.main_part_)
? SCM_EOL : scm_makfrom0str ("|");
- daddy_context_->set_property ("whichBar", which);
+ get_parent_context ()->set_property ("whichBar", which);
}
}
}
- daddy_context_->set_property ("whichBar", which);
+ get_parent_context ()->set_property ("whichBar", which);
}
void
Timing_engraver::stop_translation_timestep ()
{
Timing_translator::stop_translation_timestep ();
- daddy_context_->set_property ("whichBar", SCM_EOL);
+ get_parent_context ()->set_property ("whichBar", SCM_EOL);
last_moment_ = now_mom ();
}
/*
move this to engraver-init.ly?
*/
- daddy_context_->add_alias (ly_symbol2scm ("Timing"));
- daddy_context_->set_property ("timing" , SCM_BOOL_T);
- daddy_context_->set_property ("currentBarNumber" , scm_int2num (1));
+ get_parent_context ()->add_alias (ly_symbol2scm ("Timing"));
+ get_parent_context ()->set_property ("timing" , SCM_BOOL_T);
+ get_parent_context ()->set_property ("currentBarNumber" , scm_int2num (1));
- daddy_context_->set_property ("timeSignatureFraction",
+ get_parent_context ()->set_property ("timeSignatureFraction",
scm_cons (scm_int2num (4), scm_int2num (4)));
/*
Do not init measurePosition; this should be done from global
context.
*/
- daddy_context_->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
- daddy_context_->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
+ get_parent_context ()->set_property ("measureLength", Moment (Rational (1)).smobbed_copy ());
+ get_parent_context ()->set_property ("beatLength", Moment (Rational (1,4)).smobbed_copy ());
}
Rational
else
{
measposp = now;
- daddy_context_->set_property ("measurePosition",
+ get_parent_context ()->set_property ("measurePosition",
measposp.smobbed_copy ());
}
b ++;
}
- daddy_context_->set_property ("currentBarNumber", scm_int2num (b));
- daddy_context_->set_property ("measurePosition", measposp.smobbed_copy ());
+ get_parent_context ()->set_property ("currentBarNumber", scm_int2num (b));
+ get_parent_context ()->set_property ("measurePosition", measposp.smobbed_copy ());
}
ENTER_DESCRIPTION (Timing_translator,
Translator_group::get_daddy_translator () const
{
Translator *t
- = unsmob_translator (daddy_context_->daddy_context_->implementation_);
+ = unsmob_translator (get_parent_context ()->get_parent_context ()->implementation_);
return dynamic_cast<Translator_group*> (t);
}
Translator_group::initialize ()
{
SCM tab = scm_make_vector (scm_int2num (19), SCM_BOOL_F);
- daddy_context_->set_property ("acceptHashTable", tab);
+ get_parent_context ()->set_property ("acceptHashTable", tab);
}
return false;
}
-SCM
-names_to_translators (SCM namelist, Context*tg)
-{
- SCM l = SCM_EOL;
- for (SCM s = namelist; is_pair (s) ; s = ly_cdr (s))
- {
- Translator * t = get_translator (ly_car (s));
- if (!t)
- warning (_f ("can't find: `%s'", s));
- else
- {
- Translator * tr = t->clone ();
- SCM str = tr->self_scm ();
- l = scm_cons (str, l);
-
- tr->daddy_context_ = tg;
- scm_gc_unprotect_object (str);
- }
- }
- return l;
-}
-
SCM
Translator_group::get_simple_trans_list ()
(tg->*ptr) ();
}
- for (SCM s = c->context_list_ ; is_pair (s);
+ for (SCM s = c->children_contexts () ; is_pair (s);
s =ly_cdr (s))
{
recurse_over_translators (unsmob_context (ly_car (s)), ptr, dir);
return SCM_EOL;
SCM daddy_props
- = (tg->daddy_context_)
- ? updated_grob_properties (tg->daddy_context_, sym)
+ = (tg->get_parent_context ())
+ ? updated_grob_properties (tg->get_parent_context (), sym)
: SCM_EOL;
SCM props = tg->internal_get_property (sym);
chordmodifiers = #default-chord-modifier-list
whiteTriangleMarkup = #(make-override-markup
- '(font-encoding . math) (make-simple-markup "M"))
+ '(font-encoding . TeX-math) (make-simple-markup "M"))
blackTriangleMarkup = #(make-override-markup
- '(font-encoding . math) (make-simple-markup "N"))
+ '(font-encoding . TeX-math) (make-simple-markup "N"))
ignatzekExceptionMusic = \notes{
<c e gis>1-\markup { "+" }
Buildrequires: texinfo >= 4.6
Buildrequires: guile-devel >= 1.6.4-8
Requires: tetex tetex-latex libstdc++ python tetex-dvips tetex-latex
-Requires: guile >= 1.6.4-8 ec-fonts-mftraced
+Requires: guile >= 1.6.4-8 ec-fonts-mftrace
%description
LilyPond lets you create music notation. It produces
(define (text font s)
(let*
- ((mapping #f)
- (input-enc-name (assoc-get 'input-name (ly:font-encoding-alist font) ))
- )
+ ((mapping #f) ;; (assoc-get 'char-mapping (ly:font-encoding-alist font))))
+
- ;; TODO: we'd better do this for PS only
- ;; LaTeX gets in the way, and we need to remap
- ;; nonprintable chars.
-
- ;; (assoc-get 'char-mapping (ly:font-encoding-alist font))))
+ ;; TODO: we'd better do this for PS only
+ ;; LaTeX gets in the way, and we need to remap
+ ;; nonprintable chars.
+
+
+ (input-enc-name #f) ;; (assoc-get 'input-name (ly:font-encoding-alist font) ))
+ )
(string-append "\\hbox{\\" (font-command font)
(if (string? input-enc-name)