]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.47
authorfred <fred>
Sun, 24 Mar 2002 19:59:36 +0000 (19:59 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:59:36 +0000 (19:59 +0000)
lily/include/abbrev.hh [new file with mode: 0644]
lily/stem-grav.cc

diff --git a/lily/include/abbrev.hh b/lily/include/abbrev.hh
new file mode 100644 (file)
index 0000000..9428be7
--- /dev/null
@@ -0,0 +1,27 @@
+/*   
+  abbrev.hh -- declare Abbreviation
+  
+  source file of the GNU LilyPond music typesetter
+  
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+  
+ */
+
+#ifndef ABBREV_HH
+#define ABBREV_HH
+
+#include "item.hh"
+class Abbreviation : public Item {
+  Stem * stem_l_;
+protected:
+  virtual void do_print () const;
+  virtual Molecule *brew_molecule_p () const;
+  virtual void do_substitute_dependent (Score_elem*, Score_elem*);
+public:
+  int abbrev_flags_i_;
+  Abbreviation ();
+  void set_stem (Stem *);
+};
+
+#endif /* ABBREV_HH */
+
index 4cef2a9594ad8ec1003324a7401ca2e4e1e2cc9a..1a552bcf2c03a642a9aaf20bf7e146a9dd2152ca 100644 (file)
 #include "musical-request.hh"
 #include "duration-convert.hh"
 #include "misc.hh"
+#include "abbrev.hh"
 
 Stem_engraver::Stem_engraver()
 {
   abbrev_req_l_ = 0;
   stem_p_ = 0;
+  abbrev_p_ = 0;
   default_abbrev_i_ = 16;
   dir_ = CENTER;
 }
@@ -52,7 +54,10 @@ Stem_engraver::acknowledge_element(Score_elem_info i)
                t = default_abbrev_i_;
              else
                default_abbrev_i_ = t;
-             stem_p_->abbrev_flag_i_ =intlog2 (t) - (durlog_i>? 2);
+
+             abbrev_p_ = new Abbreviation;
+             announce_element (Score_elem_info (abbrev_p_, abbrev_req_l_));
+             abbrev_p_->abbrev_flags_i_ =intlog2 (t) - (durlog_i>? 2);
            }
          announce_element (Score_elem_info (stem_p_, r));
        }
@@ -63,6 +68,12 @@ Stem_engraver::acknowledge_element(Score_elem_info i)
 void
 Stem_engraver::do_pre_move_processing()
 {
+  if (abbrev_p_)
+    {
+      abbrev_p_->set_stem (stem_p_);
+      typeset_element (abbrev_p_);
+      abbrev_p_ = 0;
+    }
   if (stem_p_)
     {
       Scalar prop = get_property ("ydirection");