]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.76
authorfred <fred>
Sun, 24 Mar 2002 19:47:59 +0000 (19:47 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:47:59 +0000 (19:47 +0000)
lily/include/head-column.hh [new file with mode: 0644]
lily/include/rest-column.hh
lily/rest-column.cc

diff --git a/lily/include/head-column.hh b/lily/include/head-column.hh
new file mode 100644 (file)
index 0000000..ea5e9a7
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+  head-column.hh -- declare Head_column
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef HEAD_COLUMN_HH
+#define HEAD_COLUMN_HH
+
+#include "script-column.hh"
+
+class Head_column : public Script_column
+{ 
+public:
+    Link_array<Note_head> head_l_arr_;
+    /** The relative position of the "voice" containing this
+      chord. Normally this would be the same as the stem direction,
+      but rests do not have stems.  
+
+      Hmm. outdated.. Rests *do* have stems.
+      */
+
+    int dir_i_;
+    Stem* stem_l_;
+
+    void add(Note_head*);
+    void add(Script*s) { Script_column::add(s) ; }
+    virtual void set(Stem*);
+    Head_column();
+    NAME_MEMBERS();
+protected:
+
+
+    virtual void do_pre_processing();
+    virtual void do_print()const;
+    virtual void do_substitute_dependency(Score_elem*,Score_elem*);
+};
+#endif // HEAD_COLUMN_HH
index 05327cbc6c0b0a3d29ca35b0522deb791b5e440d..86aa7f96e0f6fa6b7a40733f4fc3250029d10e31 100644 (file)
 #define REST_COLUMN_HH
 
 #include "script-column.hh"
+#include "head-column.hh"
 
 /** 
   struct to treat a set of rests as union (one voicegroup should
   only produce one rest.
   */
-class Rest_column : public Script_column {
-    Link_array<Note_head> head_l_arr_;
+class Rest_column : public Head_column {
 public:
-    int dir_i_;
-    Stem* stem_l_;
-    void add(Note_head *);
-    void add(Stem *);
     NAME_MEMBERS();
-    Rest_column();
     void translate_heads(int dy);
-protected:
-    virtual void do_print() const;
-    virtual void do_substitute_dependency(Score_elem*, Score_elem*);
 };
 
 #endif // REST_COLUMN_HH
index a58e73846f9424379187f62180ca187e64b24867..9f811d39ded19fbf045bff551be9f8d1954cea96 100644 (file)
 #include "stem.hh"
 
 IMPLEMENT_STATIC_NAME(Rest_column);
-IMPLEMENT_IS_TYPE_B1(Rest_column,Item);
-
-Rest_column::Rest_column()
-{
-    dir_i_ = 0;
-    stem_l_ = 0;
-}
-    
-void
-Rest_column::add(Note_head *n_l)
-{
-    add_support(n_l);
-    head_l_arr_.push(n_l);
-}
-
-void
-Rest_column::add(Stem*stem_l)
-{
-    stem_l_ = stem_l;
-    add_dependency(stem_l);
-//    add_support(stem_l);
-}
-
-void
-Rest_column::do_print() const
-{
-#ifndef NPRINT
-    mtor << "heads: " << head_l_arr_.size();
-#endif
-}
-
-void
-Rest_column::do_substitute_dependency(Score_elem*o,Score_elem*n)
-{
-    Script_column::do_substitute_dependency(o,n);
-    if (o == stem_l_)
-       stem_l_ = n? (Stem*)n->item() :0;
-    
-    if (o->is_type_b( Note_head::static_name()) ) 
-       head_l_arr_.substitute( (Note_head*)o->item(), 
-                               (n)? (Note_head*)n->item() : 0);
-}
+IMPLEMENT_IS_TYPE_B1(Rest_column,Head_column);
 
 
 /**