]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/clef-engraver.cc
* input/regression/clef-oct.ly: new file.
[lilypond.git] / lily / clef-engraver.cc
index c2e671216b678de4b3104d5bc691457b5b5a629f..44b8be7cba363f994cc9509347142efe82e94de5 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>,
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>,
 
   Mats Bengtsson <matsb@s3.kth.se>
 */
 #include <ctype.h>
 
 #include "translator-group.hh"
-
 #include "bar-line.hh"
 #include "staff-symbol-referencer.hh"
-
 #include "engraver.hh"
 #include "direction.hh"
 #include "side-position-interface.hh"
 #include "item.hh"
 
-
 class Clef_engraver : public  Engraver
 {
 public:
@@ -65,8 +62,8 @@ Clef_engraver::set_glyph ()
 
   SCM basic = ly_symbol2scm ("Clef");
   
-  daddy_trans_->execute_single_pushpop_property (basic, glyph_sym, SCM_UNDEFINED);
-  daddy_trans_->execute_single_pushpop_property (basic, glyph_sym, glyph);
+  daddy_trans_->execute_pushpop_property (basic, glyph_sym, SCM_UNDEFINED);
+  daddy_trans_->execute_pushpop_property (basic, glyph_sym, glyph);
 }
 
 /** 
@@ -82,7 +79,6 @@ Clef_engraver::acknowledge_grob (Grob_info info)
       if (Bar_line::has_interface (info.grob_)
          && gh_string_p (get_property ("clefGlyph")))
        create_clef ();
-
     } 
 }
 
@@ -105,12 +101,18 @@ Clef_engraver::create_clef ()
        {
          Item * g = new Item (get_property ("OctavateEight"));
 
+         int abs_oct = gh_scm2int (oct) ;
+         int dir = sign (abs_oct);
+         abs_oct = abs (abs_oct)  + 1;
+           
+         g->set_grob_property ("text",
+                               scm_number_to_string (gh_int2scm (abs_oct),
+                                                     SCM_MAKINUM (10)));
          Side_position_interface::add_support (g,clef_);      
 
          g->set_parent (clef_, Y_AXIS);
          g->set_parent (clef_, X_AXIS);
-
-         g->set_grob_property ("direction", scm_int2num (sign (gh_scm2int (oct))));
+         g->set_grob_property ("direction", scm_int2num (dir));
          octavate_ = g;
          announce_grob(octavate_, SCM_EOL);
        }
@@ -134,8 +136,7 @@ Clef_engraver::inspect_clef_properties ()
       || scm_equal_p (glyph, prev_glyph_) == SCM_BOOL_F
       || scm_equal_p (clefpos, prev_cpos_) == SCM_BOOL_F
       || scm_equal_p (octavation, prev_octavation_) == SCM_BOOL_F
-      || to_boolean (force_clef)
-)
+      || to_boolean (force_clef))
     {
       set_glyph ();
       create_clef ();