]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/include/context.hh (class Context): make members protected.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Apr 2004 14:52:21 +0000 (14:52 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Mon, 12 Apr 2004 14:52:21 +0000 (14:52 +0000)
(children_contexts): new accessor function.

* lily/include/context.hh (class Context): make daddy_context_
private.

* lily/lyric-engraver.cc (get_voice_to_lyrics): recursively go
higher for finding Voice. (backportme)

* lily/include/context.hh (class Context): remove
find_context_below() as a method.

lily/auto-change-iterator.cc
lily/change-iterator.cc
lily/context-scheme.cc
lily/context.cc
lily/include/context.hh
lily/lyric-engraver.cc
lily/staff-performer.cc

index 01a46fd93c8f94d3dd8070314587c48fee3ab5bf..7b73db03caea743a8bd1ee6af3a2921c119c4ca0 100644 (file)
@@ -56,7 +56,7 @@ Auto_change_iterator::change_to (Music_iterator *it, SCM to_type_sym,
       current = current->get_parent_context ();
     }
 
-  if (current && current->id_string_ == to_id)
+  if (current && current->id_string () == to_id)
     {
       String msg;
       msg += _ ("Can't switch translators, I'm there already");
index 771be9b983a6694f53a5ad230176e0ba9c6a5674..d36567b5940981cf5ee0dd2babbfcb8b4fce4060 100644 (file)
@@ -27,7 +27,7 @@ Change_iterator::error (String reason)
    */
   String warn2= "Change_iterator::process (): " 
     + get_outlet ()->context_name () + " = `"
-    + get_outlet ()->id_string_ + "': ";
+    + get_outlet ()->id_string () + "': ";
   warning (warn2);
   get_music ()->origin ()->warning (warn1);
 }
@@ -55,7 +55,7 @@ Change_iterator::process (Moment m)
       current = current->get_parent_context ();
     }
 
-  if (current && current->id_string_ == to_id)
+  if (current && current->id_string () == to_id)
     {
       String msg;
       msg += _ ("Can't switch translators, I'm there already");
@@ -88,7 +88,7 @@ Change_iterator::process (Moment m)
          We could change the current translator's id, but that would make 
          errors hard to catch
          
-          last->translator_id_string_  = get_change ()->change_to_id_string_;
+          last->translator_id_string ()  = get_change ()->change_to_id_string ();
        */
        error (_ ("I'm one myself"));
       }
index 6457482b209a1b2d1d06264fdb616f99c16c482c..f6a03404fd850a8bf014dcf8c67ee4fd55e16ca7 100644 (file)
@@ -19,7 +19,7 @@ LY_DEFINE (ly_context_id, "ly:context-id",
   Context *tr = unsmob_context (context);
   SCM_ASSERT_TYPE (tr, context, SCM_ARG1, __FUNCTION__, "Context");
 
-  return scm_makfrom0str (tr->id_string_. to_str0 ());
+  return scm_makfrom0str (tr->id_string (). to_str0 ());
 }
 
 LY_DEFINE (ly_context_name, "ly:context-name",
index fedc490c8348cf998aec68cecf7b550e968f2bd4..6f0d2fcffb156bf34e3bdc407a23f8974d548f41 100644 (file)
@@ -116,7 +116,7 @@ Context::find_create_context (SCM n, String id,
   if (n == ly_symbol2scm ("Bottom"))
     {
       Context* tg = get_default_interpreter ();
-      tg->id_string_ = id;
+      tg->id_string () = id;
       return tg;
     }
 
@@ -140,7 +140,7 @@ Context::find_create_context (SCM n, String id,
 
          if (i == path.size () -1)
            {
-             new_group->id_string_ = id;
+             new_group->id_string () = id;
            }
 
          current->add_context (new_group);
@@ -303,7 +303,7 @@ find_context_below (Context * where,
 {
   if (where->is_alias (type))
     {
-      if (id == "" || where->id_string_ == id)
+      if (id == "" || where->id_string () == id)
        return where;
     }
   
index f32e3e83789e3e0da6b9a62d857a6174f8aa541c..6413d8b49f14689f5a60db0e85e960d0cbb4b0cb 100644 (file)
@@ -35,9 +35,11 @@ protected:
   SCM accepts_list_;
   SCM aliases_;
   SCM implementation_;
+  String id_string_;
 
   friend class Context_def;
 public:
+  String id_string () const { return id_string_; } 
   SCM children_contexts () const { return context_list_; }
   SCM default_child_context_name () const;
 
@@ -78,7 +80,6 @@ public:
   Link_array<Context> path_to_acceptable_context (SCM alias,
                                                  Music_output_def*) const;
 
-  String id_string_;
 };
 
 /*
index e32fca941afce9184edccc440375bb2645aeb0f3..b81897a819c997627e5cc1d651ad9a9395051748 100644 (file)
@@ -74,7 +74,7 @@ get_voice_to_lyrics (Context *lyrics)
     return c;
 
   SCM voice_name = lyrics->get_property ("associatedVoice");
-  String nm = lyrics->id_string_;
+  String nm = lyrics->id_string ();
 
   if (ly_c_string_p (voice_name))
     nm = ly_scm2string (voice_name);
index 4264011e39c18f252cc60f94993e6eba78eb29f8..7cb78b53805d1130416618d2e26ee6707efac537 100644 (file)
@@ -65,7 +65,7 @@ Staff_performer::initialize ()
   audio_staff_ = new Audio_staff;
   announce_element (Audio_element_info (audio_staff_, 0));
 
-  name_ = new Audio_text (Audio_text::TRACK_NAME, context ()->id_string_);
+  name_ = new Audio_text (Audio_text::TRACK_NAME, context ()->id_string ());
   announce_element (Audio_element_info (name_, 0));
 
   tempo_ = new Audio_tempo (get_tempo ());