]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score.cc
Issue 4404: Add ly:disconnect-dispatchers function
[lilypond.git] / lily / score.cc
index 3a1232d2a268034c7a2494257d42c102ea75d4e0..fe0f761fb7bad81ebf8dcdb2077b9d007a1f7097 100644 (file)
@@ -40,7 +40,7 @@ using namespace std;
 Input *
 Score::origin () const
 {
-  return Input::unsmob (input_location_);
+  return unsmob<Input> (input_location_);
 }
 
 Score::Score ()
@@ -83,7 +83,7 @@ Score::Score (Score const &s)
   smobify_self ();
   input_location_ = s.origin ()->smobbed_copy ();
 
-  Music *m = Music::unsmob (s.music_);
+  Music *m = unsmob<Music> (s.music_);
   if (m)
     {
       Music *mclone = m->clone ();
@@ -117,7 +117,7 @@ Score::book_rendering (Output_def *layoutbook,
 
   Real scale = 1.0;
 
-  if (layoutbook && layoutbook->c_variable ("is-paper") == SCM_BOOL_T)
+  if (layoutbook && to_boolean (layoutbook->c_variable ("is-paper")))
     scale = scm_to_double (layoutbook->c_variable ("output-scale"));
 
   SCM outputs = SCM_EOL;
@@ -129,7 +129,7 @@ Score::book_rendering (Output_def *layoutbook,
       Output_def *def = outdef_count ? defs_[i] : default_def;
       SCM scaled = def->self_scm ();
 
-      if (def->c_variable ("is-layout") == SCM_BOOL_T)
+      if (to_boolean (def->c_variable ("is-layout")))
         {
           def = scale_output_def (def, scale);
           def->parent_ = layoutbook;
@@ -139,7 +139,7 @@ Score::book_rendering (Output_def *layoutbook,
 
       /* TODO: fix or junk --no-layout.  */
       SCM context = ly_run_translator (music_, scaled);
-      if (dynamic_cast<Global_context *> (Context::unsmob (context)))
+      if (unsmob<Global_context> (context))
         {
           SCM s = ly_format_output (context);
 
@@ -155,12 +155,12 @@ Score::book_rendering (Output_def *layoutbook,
 void
 Score::set_music (SCM music)
 {
-  if (Music::is_smob (music_))
+  if (unsmob<Music> (music_))
     {
-      Music::unsmob (music)->origin ()->error (_ ("already have music in score"));
-      Music::unsmob (music_)->origin ()->error (_ ("this is the previous music"));
+      unsmob<Music> (music)->origin ()->error (_ ("already have music in score"));
+      unsmob<Music> (music_)->origin ()->error (_ ("this is the previous music"));
     }
-  Music *m = Music::unsmob (music);
+  Music *m = unsmob<Music> (music);
   if (m && to_boolean (m->get_property ("error-found")))
     {
       m->origin ()->error (_ ("errors found, ignoring music expression"));