]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/cue-clef-engraver.cc
Doc-es: various updates.
[lilypond.git] / lily / cue-clef-engraver.cc
index f2988585cd0d7cbd95bf161b2411f361b0b30d4f..cf7f0bd9681f7715b96f78b409f32ddb1121a153 100644 (file)
@@ -1,9 +1,9 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 1997--2014 Han-Wen Nienhuys <hanwen@xs4all.nl>
+  Copyright (C) 1997--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
                            Mats Bengtsson <matsb@s3.kth.se>
-  Copyright (C) 2010--2014 Reinhold Kainhofer <reinhold@kainhofer.com>
+  Copyright (C) 2010--2015 Reinhold Kainhofer <reinhold@kainhofer.com>
 
   LilyPond is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -41,7 +41,7 @@ public:
 protected:
   void stop_translation_timestep ();
   void process_music ();
-  DECLARE_ACKNOWLEDGER (bar_line);
+  void acknowledge_bar_line (Grob_info);
 
   virtual void derived_mark () const;
 private:
@@ -66,7 +66,8 @@ Cue_clef_engraver::derived_mark () const
   scm_gc_mark (prev_glyph_);
 }
 
-Cue_clef_engraver::Cue_clef_engraver ()
+Cue_clef_engraver::Cue_clef_engraver (Context *c)
+  : Engraver (c)
 {
   clef_ = 0;
   modifier_ = 0;
@@ -171,9 +172,9 @@ Cue_clef_engraver::inspect_clef_properties ()
   SCM clefpos = get_property ("cueClefPosition");
   SCM transposition = get_property ("cueClefTransposition");
 
-  if (scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F
-      || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F
-      || scm_equal_p (transposition, prev_transposition_) == SCM_BOOL_F)
+  if (!ly_is_equal (glyph, prev_glyph_)
+      || !ly_is_equal (clefpos, prev_cpos_)
+      || !ly_is_equal (transposition, prev_transposition_))
     {
       set_glyph ();
       if (scm_is_string (glyph))
@@ -197,19 +198,25 @@ Cue_clef_engraver::stop_translation_timestep ()
 {
   if (clef_)
     {
-      SCM vis = 0;
       if (to_boolean (clef_->get_property ("non-default")))
-        vis = get_property ("explicitCueClefVisibility");
+        {
+          SCM vis = get_property ("explicitCueClefVisibility");
 
-      if (vis)
-        clef_->set_property ("break-visibility", vis);
+          if (scm_is_vector (vis))
+            clef_->set_property ("break-visibility", vis);
+        }
 
       clef_ = 0;
       modifier_ = 0;
     }
 }
 
-ADD_ACKNOWLEDGER (Cue_clef_engraver, bar_line);
+void
+Cue_clef_engraver::boot ()
+{
+  ADD_ACKNOWLEDGER (Cue_clef_engraver, bar_line);
+}
+
 ADD_TRANSLATOR (Cue_clef_engraver,
                 /* doc */
                 "Determine and set reference point for pitches in cued voices.",