]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/include/lyric-phrasing-engraver.hh
release: 1.3.142
[lilypond.git] / lily / include / lyric-phrasing-engraver.hh
index 44263b4ca408523006472dc61700adeff1498f58..68996710f9a24b6a61a925bafd4593821c0e84e3 100644 (file)
@@ -15,7 +15,7 @@
 #include "item.hh"
 #include "smobs.hh"
 
-class Voice_alist_entry;
+class Syllable_group;
 
 
 /**
@@ -23,31 +23,30 @@ class Voice_alist_entry;
    right aligning end of phrases, centering others under their notes.
  */
 
-
 /* 
 * Build an engraver that catches noteheads and lyrics.
 
-(It needs to be in a context above Staff and Lyrics, eg. in Score
+ (It needs to be in a context above Staff and Lyrics, eg. in Score
 context.)
 
 * Determine which heads belong to which lyrics
 
-(eg. by looking at the names of their originating contexts, or maybe
+ (eg. by looking at the names of their originating contexts, or maybe
 some \properties)
 
 * Attach the lyrics to the appropriate heads
 
-(by doing lyric->set_parent (head, X_AXIS), that will fix the current
+ (by doing lyric->set_parent (head, X_AXIS), that will fix the current
 noteheadwidth guessing kludge)
 
 * Check if the lyric syllables end or start a phrase.
 
-(eg. check if the syllable ends with punctuation, and remember that
+ (eg. check if the syllable ends with punctuation, and remember that
 fact for the next one.)
 
 * Adjust their alignment accordingly. 
 
-(eg. by doing lyric->add_offset_callback(centered_on_parent,X_AXIS)
+ (eg. by doing lyric->add_offset_callback (centered_on_parent,X_AXIS)
 and setting self-alignment-X)
 
 * Add a property to switch on/off the engraver (for multi stanza
@@ -63,16 +62,16 @@ for melismas as well.
 class Lyric_phrasing_engraver : public Engraver 
 {
 protected:
-  virtual void acknowledge_element(Score_element_info);
-  virtual void process_acknowledged ();
-  virtual void do_pre_move_processing();
-  
+  virtual void acknowledge_grob (Grob_info);
+  virtual void create_grobs ();
+  virtual void stop_translation_timestep ();
+  virtual void finalize ();  
 private:
-  void record_notehead(const String &context_id, Score_element * notehead);
-  void record_lyric(const String &context_id, Score_element * lyric);
-  void record_melisma(const String &context_id);
-  void record_extender(const String &context_id, Score_element * extender);
-  Voice_alist_entry * lookup_context_id(const String &context_id);
+  void record_notehead (const String &context_id, Grob * notehead);
+  void record_lyric (const String &context_id, Grob * lyric);
+  void record_melisma (const String &context_id);
+  void record_extender (const String &context_id, Grob * extender);
+  Syllable_group * lookup_context_id (const String &context_id);
 
 public:
   Lyric_phrasing_engraver ();
@@ -80,48 +79,46 @@ public:
   VIRTUAL_COPY_CONS (Translator);
 
 private:
-  /** association list of Voice_alist_entry smobs
+  /** association list of Syllable_group smobs
   */
   Protected_scm voice_alist_;
-  Score_element * any_notehead_l_;
+  Grob * any_notehead_l_;
 };
 
 
-class Voice_alist_entry
+class Syllable_group
 {
   bool first_in_phrase_b_;
-  Score_element * notehead_l_;
-  Link_array<Score_element> lyric_list_;
-//   Link_array<Score_element> extender_list_;
-  Score_element * longest_lyric_l_;
-  Score_element * shortest_lyric_l_;
+  Grob * notehead_l_;
+  Link_array<Grob> lyric_list_;
+  Grob * longest_lyric_l_;
+  Grob * shortest_lyric_l_;
   int alignment_i_;
   bool melisma_b_;
+  Real group_translation_f_;
 public:
-  static SCM make_entry();
-  void set_first_in_phrase(bool f);
-  void set_notehead(Score_element * notehead);
-  void add_lyric(Score_element * lyric);
-  void add_extender(Score_element * extender);
-//   void terminate_extenders();
-//   void clear_extenders();
-  void set_melisma();
-  bool get_melisma() { return melisma_b_; }
-  int lyric_count() { return lyric_list_.size(); }
-  void clear();
-  bool is_empty();
-  bool set_lyric_align(const char *punc, Score_element *default_notehead_l);
-  void adjust_melisma_align();
-  int appropriate_alignment(const char *punc);
-  Real amount_to_translate();
-  void next_lyric();
-  void copy(Voice_alist_entry *);
+  static SCM make_entry ();
+  void set_first_in_phrase (bool f);
+  void set_notehead (Grob * notehead);
+  void add_lyric (Grob * lyric);
+  void add_extender (Grob * extender);
+  void set_melisma () { melisma_b_ = true; }
+  bool get_melisma () { return melisma_b_; }
+  int lyric_count () { return lyric_list_.size (); }
+  void clear ();
+  bool is_empty ();
+  bool set_lyric_align (const char *punc, Grob *default_notehead_l);
+  void adjust_melisma_align ();
+  int appropriate_alignment (const char *punc);
+  Real amount_to_translate ();
+  void next_lyric ();
+  void copy (Syllable_group *);
 private:
-  Voice_alist_entry();
-  DECLARE_SIMPLE_SMOBS(Voice_alist_entry,);
+  Syllable_group ();
+  DECLARE_SIMPLE_SMOBS (Syllable_group,);
 } ;
 
-Voice_alist_entry * unsmob_voice_entry (SCM);
+Syllable_group * unsmob_voice_entry (SCM);
 
 
 #endif // LYRIC_PHRASING_ENGRAVER_HH