]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/clef-modifier.cc
lilypond-manuals.css: edit color scheme and some spacing
[lilypond.git] / lily / clef-modifier.cc
index 6d802ad2710948b271a669469f992be44f29dd2c..c6ce950fc04a64ab5a6abf28bdaa05fda706876f 100644 (file)
@@ -1,7 +1,7 @@
 /*
   This file is part of LilyPond, the GNU music typesetter.
 
-  Copyright (C) 2014--2014 Janek Warchoł <lemniskata.bernoullego@gmail.com>
+  Copyright (C) 2014--2015 Janek Warchoł <lemniskata.bernoullego@gmail.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
 struct Clef_modifier
 {
   DECLARE_SCHEME_CALLBACK (calc_parent_alignment, (SCM));
-  DECLARE_GROB_INTERFACE ();
 };
 
 MAKE_SCHEME_CALLBACK (Clef_modifier, calc_parent_alignment, 1)
 SCM
 Clef_modifier::calc_parent_alignment (SCM smob)
 {
-  Grob *me = Grob::unsmob (smob);
+  Grob *me = unsmob<Grob> (smob);
   Grob *clef = me->get_parent (X_AXIS);
   string full_clef_name = ly_scm2string (clef->get_property ("glyph"));
-
-  int separator_position = full_clef_name.find ('.');
-  string clef_type = full_clef_name.substr (separator_position + 1,
-                                            separator_position + 2);
+  string clef_name = replace_all(&full_clef_name, "clefs.", "");
 
   // find entry with keyname clef_type in clef-alignments
-  SCM alist_entry = scm_assq (ly_symbol2scm (clef_type.c_str ()),
+  SCM alist_entry = scm_assq (ly_symbol2scm (clef_name.c_str ()),
                               me->get_property ("clef-alignments"));
 
   if (scm_is_pair (alist_entry))