X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fglobal-context.cc;h=13d9738cd03d0da06e30d2671de4b231221d622f;hb=90875da23e480d263aecd479d5454b816d47dd8b;hp=40fe3a61cdb7a0b657398fc459bde7a7e6a87ed7;hpb=e0aab46ee287f06765b982c49fd0491ab033fce7;p=lilypond.git diff --git a/lily/global-context.cc b/lily/global-context.cc index 40fe3a61cd..13d9738cd0 100644 --- a/lily/global-context.cc +++ b/lily/global-context.cc @@ -3,7 +3,7 @@ source file of the GNU LilyPond music typesetter - (c) 1997--2006 Han-Wen Nienhuys + (c) 1997--2009 Han-Wen Nienhuys */ #include "global-context.hh" @@ -14,17 +14,13 @@ using namespace std; #include "context-def.hh" #include "dispatcher.hh" #include "international.hh" -#include "lilypond-key.hh" #include "music-iterator.hh" #include "music.hh" #include "output-def.hh" -#include "stream-event.hh" #include "warn.hh" -Global_context::Global_context (Output_def *o, Object_key *key) - : Context (new Lilypond_context_key (key, - Moment (0), - "Global", "", 0)) +Global_context::Global_context (Output_def *o) + : Context () { output_def_ = o; definition_ = find_context_def (o, ly_symbol2scm ("Global")); @@ -93,8 +89,6 @@ Global_context::prepare (SCM sev) else prev_mom_ = now_mom_; now_mom_ = *mom; - - clear_key_disambiguations (); } Moment @@ -114,7 +108,11 @@ Global_context::get_score_context () const SCM Global_context::get_output () { - return get_score_context ()->get_property ("output"); + Context * c = get_score_context (); + if (c) + return c->get_property ("output"); + else + return SCM_EOL; } void @@ -136,6 +134,13 @@ Global_context::run_iterator_on_me (Music_iterator *iter) if (w.main_part_.is_infinity () || w > final_mom) break; + if (w == prev_mom_) + { + programming_error ("Moment is not increasing. Aborting interpretation."); + break ; + } + + if (first) { /* @@ -191,3 +196,9 @@ Global_context::get_default_interpreter () else return Context::get_default_interpreter (); } + +Global_context * +unsmob_global_context (SCM x) +{ + return dynamic_cast (unsmob_context (x)); +}