]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.1.30
authorfred <fred>
Tue, 26 Mar 2002 21:46:58 +0000 (21:46 +0000)
committerfred <fred>
Tue, 26 Mar 2002 21:46:58 +0000 (21:46 +0000)
21 files changed:
input/test/staff-side-slur.ly [new file with mode: 0644]
lily/bar-script-engraver.cc
lily/bow.cc
lily/dimension-cache.cc
lily/extender-engraver.cc
lily/include/bar-script-engraver.hh
lily/include/bow.hh
lily/include/cons.hh
lily/include/killing-cons.tcc
lily/include/mark-engraver.hh
lily/include/molecule.hh
lily/include/slur.hh
lily/include/tie.hh
lily/paper-def.cc
lily/spanner.cc
lily/staff-margin-engraver.cc
lily/tie.cc
lily/volta-spanner.cc
ly/paper20.ly
ps/lily.ps
ps/lilyponddefs.ps

diff --git a/input/test/staff-side-slur.ly b/input/test/staff-side-slur.ly
new file mode 100644 (file)
index 0000000..d099cf6
--- /dev/null
@@ -0,0 +1,19 @@
+\score{
+       \type Staff \notes\relative c''{
+               \property Staff.instrument = "Toeters"
+               c c c c(\break
+               )c c c c ~\break
+               c c c c\break
+       }
+       \paper{
+               linewidth=60.0\mm;
+%              \translator { \HaraKiriStaffContext }
+               \translator { \OrchestralScoreContext }
+               \translator {
+                       \StaffContext
+                       \consists "Staff_margin_engraver";
+                       marginHangOnClef = 1;
+               }
+       }
+}
+
index e197da6a9c934a38ec0f9622ce30d391c401d17f..63e6155438b8bda8eb1cec69043ce6b7ebab02da 100644 (file)
@@ -9,6 +9,7 @@
 
 #include "bar-script-engraver.hh"
 #include "bar.hh"
+#include "clef-item.hh"
 #include "g-staff-side.hh"
 #include "g-text-item.hh"
 #include "lily-guile.hh"
@@ -18,31 +19,69 @@ Bar_script_engraver::Bar_script_engraver ()
   axis_ = Y_AXIS;
   staff_side_p_ = 0;
   text_p_ =0;
+  hang_on_clef_b_ = false;
   visibility_lambda_ 
     = gh_eval_str ("non_postbreak_visibility");
 }
 
 void
-Bar_script_engraver::acknowledge_element (Score_element_info i)
+Bar_script_engraver::do_creation_processing ()
+{
+  Scalar prop = get_property (type_ + "HangOnClef", 0);
+  if (prop.to_bool ())
+    {
+      hang_on_clef_b_ = true;
+    }
+}
+
+void
+Bar_script_engraver::do_acknowledge_element (Item *i)
 {
   Axis other_axis = Axis((axis_ + 1)%2);
-  
   if (staff_side_p_ && !staff_side_p_->dim_cache_[other_axis].parent_l_) 
     {
-      Bar * bar_l = dynamic_cast<Bar*> (i.elem_l_);
-      if (!bar_l)
+      staff_side_p_->dim_cache_[other_axis].parent_l_
+       = &i->dim_cache_[other_axis];
+      staff_side_p_->dim_cache_[axis_].parent_l_
+       =  &i->dim_cache_[axis_];         
+
+      staff_side_p_->add_support (i);
+      i->add_dependency (staff_side_p_); // UGH. 
+    }
+}
+
+
+Item*
+Bar_script_engraver::cast_to_interesting_item (Score_element *e)
+{
+  Item * i =0;
+  if (hang_on_clef_b_)
+    {
+      i = dynamic_cast<Clef_item*> (e);
+    }
+  else
+    {
+      i = dynamic_cast<Bar*> (e);
+    }
+  return i;
+}
+                                              
+void
+Bar_script_engraver::acknowledge_element (Score_element_info inf)
+{
+  if (inf.origin_grav_l_arr_.size () == 1)
+    {
+      Item *i=cast_to_interesting_item (inf.elem_l_);
+      if (!i)
        return;
-      
+
       /* Only put numbers on bars that are at our own level (don't put
         numbers over the staffs of a GrandStaff, only over the GrandStaff
         itself */
-      if (i.origin_grav_l_arr_.size () == 1)
-       {
-         staff_side_p_->dim_cache_[other_axis].parent_l_ =  &bar_l->dim_cache_[other_axis];
-         //      staff_side_p_->dim_cache_[axis_].parent_l_ =  &bar_l->dim_cache_[axis_];        
-         staff_side_p_->add_support (i.elem_l_);
-         bar_l->add_dependency (staff_side_p_); // UGH. 
-       }
+      if (inf.origin_grav_l_arr_.size () != 1)
+       return;
+
+      do_acknowledge_element (i);
     }
 }
 
index 146969f025a386cde91100d1ef6d26f3c9b6a85d..873613b121babb52ff21c0bc74502914e388e445 100644 (file)
@@ -92,6 +92,7 @@ Bow::do_height () const
   return iv;
 }
 
+#if 0
 Interval
 Bow::do_width () const    
 {
@@ -99,6 +100,7 @@ Bow::do_width () const
   Real dx = i.length();
   return Interval (0, dx);
 }
+#endif
 
 Array<Offset>
 Bow::get_controls () const
index 4d96032f6949f97fdb4ead964e3f39462ac48dcb..6fb7842dcf6325b4dbc88137f96b5d8dd78ed8e1 100644 (file)
@@ -78,10 +78,15 @@ Dimension_cache::absolute_coordinate () const
   return r;
 }
 
+/*
+  what *should* these functions *do* anyway.
+ */
 Real
 Dimension_cache::relative_coordinate (Dimension_cache *d) const
 {
   Real r =0.0;
+  if (d == this)               // UGH
+    return 0.0;
 
   for (Dimension_cache* c = parent_l_;
        c != d;
index 000568dfa4b779990229e11798911d62f20235c8..3cf5b3455c9c487e484a3c40e90b0332a2a14ac0 100644 (file)
@@ -63,10 +63,7 @@ Extender_engraver::do_removal_processing ()
   if (extender_spanner_p_)
     {
       span_reqs_drul_[LEFT]->warning (_ ("unterminated extender"));
-      extender_spanner_p_->unlink ();
-      delete extender_spanner_p_;
-      extender_spanner_p_ = 0;
-      span_reqs_drul_[RIGHT] = span_reqs_drul_[LEFT] = 0;
+      extender_spanner_p_->set_bounds(RIGHT, get_staff_info ().command_l ());
     }
 }
 
index cfd2b7c266c7a4d3e68e2584bf44abe4ce10f800..7b9ddbfde7d3ac8ca1f2e3d13c9ffe2c89769145 100644 (file)
@@ -13,7 +13,8 @@
 #include "protected-scm.hh"
 
 /**
-  put stuff over or next to  bars
+  put stuff over or next to  bars.  Examples: bar numbers, marginal notes,
+  rehearsal marks.
  */
 class Bar_script_engraver : public Engraver
 {
@@ -23,9 +24,18 @@ protected:
   Protected_scm visibility_lambda_;
   String type_;
   Axis axis_;
-
+  bool hang_on_clef_b_;
 protected:
+  /**
+    Put the script on #it#
+   */
+  void do_acknowledge_element (Item *it);
+  /**
+     Return non-nil if we want to hang something on this.
+   */
+  Item *cast_to_interesting_item (Score_element*);
   Bar_script_engraver ();
+  virtual void do_creation_processing ();
   virtual void do_pre_move_processing ();
   virtual void acknowledge_element (Score_element_info);
   void create_items(Request*);
index 359a03e545c157bfce21edb46400cc76af838aed..ba7e20ff6eaf886c94f4a6ce96aecab1924803cb 100644 (file)
@@ -31,7 +31,7 @@ public:
 
 protected:
   virtual Molecule* do_brew_molecule_p () const;
-  virtual Interval do_width () const;    
+  //  virtual Interval do_width () const;    
   Array<Offset> get_controls () const;
   virtual Array<Offset> get_encompass_offset_arr () const;
   virtual Interval do_height () const;
index 4b4de47e55c4e3d6db22e9008b13629a1b6fa79a..472f0a89a8ca05e98a96349e2221bddb73f0f1b4 100644 (file)
@@ -1,5 +1,5 @@
 /*   
-  cons.hh -- declare 
+  cons.hh -- declare LISP like datatypes
   
   source file of the GNU LilyPond music typesetter
   
@@ -9,6 +9,30 @@
 
 #ifndef CONS_HH
 #define CONS_HH
+#if 0 
+template<class T, class U>
+class NCons
+{
+public:
+  T car_;
+  U cdr_;
+  NCons (T t, U u) : car_ (t), cdr_ (u) {}
+  virtual ~NCons () {}
+};
+
+template<class T>
+class Pointer_cons : public NCons<T, NCons*>
+{
+  Pointer_cons () : Cons<T, Cons*> (0,0){}
+  Pointer_cons (T t, Pointer_cons<T>*c)
+    : Cons<T, Cons*> (t,c)
+    {
+      car_ = t;
+      next_ = c;
+    }
+};
+#endif 
+
 
 template<class T>
 class Cons
@@ -16,7 +40,6 @@ class Cons
 public:
   T * car_;
   Cons * next_;
-  virtual ~Cons ();
   Cons () {
     car_=0;
     next_ =0;
@@ -26,6 +49,10 @@ public:
       car_ = t;
       next_ = c;
     }
+ virtual ~Cons ()
+    {
+      delete next_;
+    }
 };
 
 template<class T>
@@ -39,5 +66,22 @@ public:
   virtual ~Killing_cons ();
 };
 
+
+template<class T>
+class Cons_list
+{
+public:
+  Cons<T> * head_;
+  Cons<T> ** tail_;
+  Cons_list () { head_ =0; tail_ = &head_; }
+};
+
+
+template<class T>
+Cons_list<T> copy_killing_cons_list (Cons<T> *src);
+template<class T>
+Cons_list<T> clone_killing_cons_list (Cons<T> *src);
+
+
 #endif /* CONS_HH */
 
index 3c9a9710e7638dc2d9dad3cef70ecebe67309d27..d67e6b56b787183e93a5c01d3b5cab28c86af5f4 100644 (file)
 #ifndef KILLING_CONS_TCC
 #define KILLING_CONS_TCC
 
+
 template<class T>
-Cons<T>::~Cons ()
+Killing_cons<T>::~Killing_cons ()
 {
+  delete car_;
 }
 
 template<class T>
-Killing_cons<T>::~Killing_cons ()
+Cons_list<T>
+copy_killing_cons_list (Cons<T> *src)
 {
-  delete car_;
-  delete next_;
+  Cons_list<T> kl;
+
+  for (; src; src  = src->next_)
+    {
+      T *t = new T(*src->car_);
+      *kl.tail_ = new Killing_cons<T> (t, 0);
+      kl.tail_ = &(*kl.tail_)->next_;
+    }
+  
+  return kl;
+}
+
+template<class T>
+Cons_list<T>
+clone_killing_cons_list (Cons<T> *src)
+{
+  Cons_list<T> kl;
+
+  for (; src; src  = src->next_)
+    {
+      T *t = src->car_->clone ();
+      *kl.tail_ = new Killing_cons<T> (t, 0);
+      kl.tail_ = &(*kl.pp)->next_;
+    }
+  
+  return kl;
 }
 
 
index 952df5a3565da60c0423d0305a4070189cec162c..314da60c17937682c63b52e350e85ca42cc1e804 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "bar-script-engraver.hh"
 
-/**
+/**Print rehearsal marks.
   */
 class Mark_engraver : public Bar_script_engraver 
 {
index de52b56e5f417ff413cc4b222a194faabcb39d35..461993e482d2f1921a4e3253325a8fb582c7bde7 100644 (file)
@@ -20,7 +20,7 @@
     to the top, to the right, etc.  */
 class Molecule {
   //  Protected_scm atom_list_;        // change to List<Atom>?
-  Killing_cons<Atom> *atom_list_;
+  Cons<Atom> *atom_list_;
   friend class Paper_outputter;
 public:
   Box dim_;
index 6e94b024cec738ab3ef27d342993c447eecffc3b..affb2d0c0a9b1516d23b13550f5a655b07248db4 100644 (file)
@@ -31,7 +31,6 @@ protected:
   virtual void do_add_processing ();
   virtual void do_pre_processing ();
   virtual void do_substitute_dependency (Score_element*, Score_element*);
-  virtual Interval do_width () const;
   Array<Rod> get_rods () const;
 };
 
index c4488caef0c4b160093aa04e8e139e2e0bcb1972..861c93fb4f8ea5a6d2b46ca6d61fbfcc61bfc9e1 100644 (file)
@@ -21,8 +21,6 @@ class Tie : public Bow
 public:
   Tie ();
   void set_head (Direction, Note_head*head_l);
-  
-  
   VIRTUAL_COPY_CONS(Score_element);
   
   bool same_pitch_b_;
@@ -33,8 +31,7 @@ protected:
   virtual void do_post_processing ();
   virtual void set_default_dir();
   virtual void do_substitute_dependency (Score_element*,Score_element*);
-  virtual Interval do_width () const;
-  Array<Rod> get_rods () const;
+  virtual Array<Rod> get_rods () const;
 
   Array<Offset> get_controls () const;
 };
index aaaa2e610bc3be03867457ab0aee498619197bf7..68d95c238b778cdb4f18be538be3f063bf8d52e5 100644 (file)
@@ -248,11 +248,14 @@ Paper_def::paper_outputter_p (Paper_stream* os_p, Header* header_l, String origi
   if (scope_p_)
     p->output_scope (scope_p_, "mudelapaper");
   
+#if 0
   if (output_global_ch == String("tex"))
     {
       *p->outstream_l_ << *scope_p_->elem ("texsetting")->access_content_String (false);
     }
-  
+#endif
+
+  *p->outstream_l_  << *scope_p_->elem (String (output_global_ch) + "setting")->access_content_String (false);
 
   SCM scm = gh_list (ly_symbol ("experimental-on"), SCM_UNDEFINED);
   p->output_scheme (scm);
index cf4932b47f2acc7a3da40fe81ce854dab75cc398..c2358c2cb97dafd3c3add50ad10541e504c68e1a 100644 (file)
@@ -146,6 +146,8 @@ Spanner::output_processing ()
 Interval
 Spanner::do_width() const
 {
+  
+  
   Real l = spanned_drul_[LEFT]->absolute_coordinate (X_AXIS);
   Real r = spanned_drul_[RIGHT]->absolute_coordinate (X_AXIS);
 
index 7363f07a992258e1c6778585bc5ac04f35fc7932..ce66cb52651c700ef70d4d0da0ce380126f3b018 100644 (file)
@@ -23,10 +23,8 @@ Staff_margin_engraver::Staff_margin_engraver ()
 }
 
 
-
 /*
     TODO
-    fix alignment/support
 
     should be able to set whole paragraph (multiple lines, centre) to
     left (right?) of staff, e.g.:
@@ -37,13 +35,10 @@ Staff_margin_engraver::Staff_margin_engraver ()
                   |______________
 */
 void
-Staff_margin_engraver::acknowledge_element (Score_element_info i)
+Staff_margin_engraver::acknowledge_element (Score_element_info inf)
 {
-  Bar * b =dynamic_cast<Bar *> (i.elem_l_);
-  if (!b)
-    return ;
-
-  if (i.origin_grav_l_arr_.size() != 1)
+  Item *i = cast_to_interesting_item (inf.elem_l_);
+  if (!i || inf.origin_grav_l_arr_.size() != 1)
     return;
 
 
@@ -58,7 +53,7 @@ Staff_margin_engraver::acknowledge_element (Score_element_info i)
   create_items (0);
   text_p_->text_str_ = long_str;
   staff_side_p_->dir_ = LEFT;
-  Bar_script_engraver::acknowledge_element(i);
+  Bar_script_engraver::do_acknowledge_element (i);
 }
 
 
index e559e8ed0eb94800c9b64c5493ac5e5e70c3d5e5..20b63a8cf99f8399175825e2af617d51b447dfda 100644 (file)
@@ -151,13 +151,15 @@ Tie::do_substitute_dependency (Score_element*o, Score_element*n)
     head_l_drul_[RIGHT] = new_l;
 }
 
+#if 0
 Interval
 Tie::do_width () const
 {
-  Real min_f = paper ()->get_var ("tie_x_minimum");
+  Real min_f = 
   Interval width_int = Bow::do_width ();
   return width_int.length () < min_f ? Interval (0, min_f) : width_int;
 }
+#endif
 
 Array<Rod>
 Tie::get_rods () const
@@ -165,7 +167,7 @@ Tie::get_rods () const
   Array<Rod> a;
   Rod r;
   r.item_l_drul_ = spanned_drul_;
-  r.distance_f_ = do_width ().length ();
+  r.distance_f_ = paper ()->get_var ("tie_x_minimum");
   a.push (r);
   return a;
 }
index a9836484d07e9eea548ff83a76dee4dfdd69a9b5..5162ac429c94bcb234a743c3c624c03517ea93dc 100644 (file)
@@ -81,7 +81,8 @@ Volta_spanner::do_add_processing ()
       set_bounds (RIGHT, column_arr_.top ());  
     }
 
-  number_p_->style_str_ = "number";
+  // number_p_->style_str_ = "number-1";
+  number_p_->style_str_ = "volta";
 }
   
 Interval
index 2f4958a23cf34588dbcd19149f5da852ed43597c..61f5951ed94bff97d53365ed3c163fd3a4caa4b3 100644 (file)
@@ -9,8 +9,17 @@ paper_twenty = \paper {
        font_large = 12.;
        font_Large = 12.;       
        font_normal = 10.;
+
        font_finger = 5.;
-       "font_number-1" = 7.;
+       font_volta = 8.;
+       font_number = 10.;
+       font_mark = 12.;
+
+       % what about:
+       "font_number-1" = 8.;
+       %"font_number" = 10.;
+       "font_number+1" = 12.;
+
        
        % ugh see table20 for sizes
        quartwidth =  6.61\pt;
index 9c1710e3b2175cc08ff9e88a6c83f6bb782fa81e..87a5895d9008786a7bfb7ce35455aa7ce52e748f 100644 (file)
@@ -4,6 +4,15 @@
 % round cappings
 1 setlinecap
 
+% URG
+% staffheight 4 div /interline exch def
+% interline 3 div /bracket_b exch def
+% interline 2 mul /bracket_w exch def
+% stafflinethickness 2 mul /bracket_t exch def
+% interline 1.5 mul /bracket_v exch def
+% bracket_v /bracket_u exch def
+% 50 /bracket_alpha exch def
+
 /draw_beam % width slope thick
 {
         2 div /beam_thick exch def
index a862db2153221135239ab9c882dbc84229aee678..7bc7ae58ea4e5b468f9765af7dac2f22a1339260 100644 (file)
@@ -3,6 +3,9 @@
 % hmm
 /setgray { 1 add } bind def
 
+% urg
+1 /stafflinethickness exch def
+
 /xoffset 30 def
 /yoffset 700 def
 /staffrulethickness 1 def