/*
- global-translator.cc -- implement global_context
+ global-context.cc -- implement Global_context
source file of the GNU LilyPond music typesetter
- (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
-#include <stdio.h>
+
+#include "global-context.hh"
+
+#include <cstdio>
#include "warn.hh"
-#include "music.hh"
#include "event.hh"
-#include "music-list.hh"
#include "music-iterator.hh"
-#include "global-context.hh"
#include "score-context.hh"
#include "context-def.hh"
#include "output-def.hh"
#include "lilypond-key.hh"
-Global_context::Global_context (Output_def *o, Moment final)
- : Context (new Lilypond_context_key(0,
+Global_context::Global_context (Output_def *o, Moment final, Object_key *key)
+ : Context (new Lilypond_context_key(key,
Moment(0),
- "Global", ""))
+ "Global", "", 0))
{
- scm_gc_unprotect_object (key_->self_scm());
-
output_def_ = o;
final_mom_ = final;
definition_ = find_context_def (o, ly_symbol2scm ("Global"));
if (m < now_mom_)
programming_error ("Trying to freeze in time.");
- for (int i=0; i < extra_mom_pq_.size (); i++)
+ for (int i = 0; i < extra_mom_pq_.size (); i++)
if (extra_mom_pq_[i] == m)
return;
extra_mom_pq_.insert (m);
prev_mom_ = now_mom_;
now_mom_ = m;
+ clear_key_disambiguations ();
if (get_score_context ())
get_score_context ()->prepare (m);
+
}
Moment
if (!t)
error (_f ("can't find `%s' context", "Score"));
- Object_key *key = new Lilypond_context_key (get_key(), now_mom(),
- "Score", "");
+ Object_key const *key = get_context_key ("Score", "");
Context *c = t->instantiate (SCM_EOL, key);
add_context (c);
- scm_gc_unprotect_object (key->self_scm());
Score_context *sc = dynamic_cast<Score_context*> (c);
sc->prepare (w);