]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.130
authorfred <fred>
Wed, 27 Mar 2002 00:56:11 +0000 (00:56 +0000)
committerfred <fred>
Wed, 27 Mar 2002 00:56:11 +0000 (00:56 +0000)
13 files changed:
Documentation/header.html.in
input/bugs/dynamic-switch.ly
input/regression/dynamics-line.ly [new file with mode: 0644]
input/test/lyrics-bar.ly [new file with mode: 0644]
input/test/mark.ly
input/tricks/staff-container.ly [new file with mode: 0644]
lily/align-interface.cc
lily/bar.cc
lily/dynamic-engraver.cc
lily/item.cc
lily/mark-engraver.cc
lily/spanner.cc
ly/params.ly

index ce6b4db7fca293fed5e1e201bec9d973525ba914..05a32d05aebb7911421912692308c8b8736871aa 100644 (file)
@@ -53,7 +53,7 @@ which substitutes some @AT_VARIABLES@ as well.
        <a href="http://appel.lilypond.org/wiki?LilyPondFaqs">Full FAQ</a><br>
        <a href="@TOP@Documentation/user/out-www/lilypond/lilypond.html">User manual</a><br>
        <a href="@TOP@Documentation/out-www/regression-test.html">Regression Test</a><br>
-       <a href="http://appel.lilypond.org/wiki?LilyPondToDo">To do</a><br>
+       <a href="@TOP@Documentation/user/out-www/lilypond-internals/lilypond-internals.html">Documentation of internals</a><br>
 <br>
       </td></tr>
       <tr><td bgcolor="#e8e8ff">
index 0c2a69f763924d7b1770e2ae3676e104c1bd6ab8..543ffa9a40bd7e12f4e196ae016836eb1d6b4735 100644 (file)
@@ -1,7 +1,7 @@
 \score{
        \context Staff <
-               \context Voice=one\skip 1;
-               \context Voice=two\skip 1;
+               \context Voice=one \skip 1;
+               \context Voice=two \skip 1;
                \context Voice=one \partcombine Voice
                        \context Thread=one \notes\relative c'' {
                                c2 \clef bass; c2
diff --git a/input/regression/dynamics-line.ly b/input/regression/dynamics-line.ly
new file mode 100644 (file)
index 0000000..70bdeb3
--- /dev/null
@@ -0,0 +1,29 @@
+\header{
+texidoc=" Dynamics appear below or above the staff.  If multiple
+dynamics are linked with (de)crescendi, they should be on the same
+line. Isolated dynamics may be forced up or down.  ";
+}
+
+\version "1.3.122";
+
+\score{
+\notes\relative c''{
+a1^\sfz
+a1-\fff\> \!c,,-\pp a'' a-\p
+
+% We need this to test if we get two Dynamic line spanners
+a
+
+% because do_removal_processing ()
+% doesn't seem to post_process elements
+d\f
+
+a
+
+}
+\paper{
+}
+\midi{
+\tempo 1 = 60;
+}
+}
diff --git a/input/test/lyrics-bar.ly b/input/test/lyrics-bar.ly
new file mode 100644 (file)
index 0000000..7be6f4c
--- /dev/null
@@ -0,0 +1,37 @@
+\header{
+texidoc="
+Adding a @code{Bar_engraver} to the LyricsVoice context makes sure that
+lyrics don't collide with barlines.
+";
+}
+
+\score {
+       \context StaffGroup <
+       \notes \context Staff {
+               b1 b1 \bar "|.";
+       }
+       \lyrics\context Lyrics <
+               \context LyricsVoiceWithBars {
+%                      thisContextHasSpanBarEngraver1  added
+                       ThisContextCertainlyHasSpanBarEngraverAddedButTheresSomethingFunny1.  Here.
+               }
+               \context LyricsVoice {
+                       this4 one has no SpanBarEngraverAddedToContext1
+               }
+       >
+       \notes \context Staff = SB { b1 b1 }
+       >
+       \paper {
+               linewidth = -1.0\cm;
+               \translator {
+                       \LyricsContext
+                       \accepts "LyricsVoiceWithBars";
+               }
+               \translator {
+                       \LyricsVoiceContext
+                       \consists "Bar_engraver";
+                       \name "LyricsVoiceWithBars";
+               }
+               
+       }
+}
index 948f23019772f53fd0daeb3bd95ac8e0158e11e2..538cdfbf9b41053fefeec9369a9a2788a4e615e2 100644 (file)
@@ -3,6 +3,7 @@
 global =  \notes {
   s1 | \mark "A";
   s1 | \mark ; 
+  s1 | \mark ; 
   s1 | \mark "12";
   s1 | \mark ; 
   s1 | \mark "A2";
diff --git a/input/tricks/staff-container.ly b/input/tricks/staff-container.ly
new file mode 100644 (file)
index 0000000..fb67f54
--- /dev/null
@@ -0,0 +1,36 @@
+
+\header {
+
+ texidoc = "By splitting the grouping (Axis_group_engraver) and
+creation functionality into separate contexts, you can override
+interesting things. You can also drop the \consistsend feature.";
+
+}
+
+
+\score  {
+ \notes <
+       \context StaffContainer = SA { \property StaffContainer.StaffSymbol \set
+         #'staff-space = #0.8
+         \context Staff {        c4 c4 } }
+       \context StaffContainer =SB { \context Staff { d f  } }
+ >
+
+\paper {
+       \translator {
+               \ScoreContext
+               \accepts StaffContainer;
+               \denies Staff;
+       }
+       \translator {
+               \type Engraver_group_engraver;
+               \consists "Axis_group_engraver";
+               \accepts "Staff";
+               \name StaffContainer;
+
+       }
+       \translator {
+               \StaffContext
+               \remove Axis_group_engraver;
+       }
+}
index da303bd33e2b2233a8205933ad53cf2896cf0fae..d335966f7f0e6abf33ca43e8922ebdad1e801873 100644 (file)
@@ -107,7 +107,7 @@ Align_interface::align_to_extents (Grob * me, Axis a)
 
   Link_array<Grob> elems;
   Link_array<Grob> all_grobs
-    = Pointer_group_interface__extract_elements (  me, (Grob*) 0, "elements");
+    = Pointer_group_interface__extract_elements (me, (Grob*) 0, "elements");
   for (int i=0; i < all_grobs.size(); i++) 
     {
       Interval y = all_grobs[i]->extent(me, a);
@@ -122,7 +122,6 @@ Align_interface::align_to_extents (Grob * me, Axis a)
              && gh_number_p (gh_cdr (min_dims)))
            {
              y.unite (ly_scm2interval (min_dims));
-             
            }
          
          SCM extra_dims = e->remove_grob_property ("extra-space");
index b74122d0725705f5c400b85d610512884c2fd4cb..0ee7890743f93e6a0ef6b325480b18f957a8b5c4 100644 (file)
@@ -197,8 +197,15 @@ Bar::get_staff_bar_size (SCM smob)
   SCM size = me->get_grob_property ("bar-size");
   if (gh_number_p (size))
     return gh_double2scm (gh_scm2double(size)*ss);
-  else
+  else if (Staff_symbol_referencer::staff_symbol_l (me))
     {
+      /*
+       If there is no staff-symbol, we get -1 from the next
+       calculation. That's a nonsense value, which would collapse the
+       barline so we return 0.0 in the next alternative.
+      */
       return gh_double2scm ((Staff_symbol_referencer::line_count (me) -1) * ss);
     }
+  else
+    return gh_int2scm (0);
 }
index ef3576f881d273694f525a2472376ddd6b9f1b42..83b2def70ad042d47db7656ca8bd77909929da87 100644 (file)
@@ -65,8 +65,7 @@ protected:
   virtual void acknowledge_grob (Grob_info);
   virtual bool try_music (Music *req_l);
   virtual void stop_translation_timestep ();
-
-  virtual void create_grobs ();  
+  virtual void process_music ();  
   virtual void start_translation_timestep ();
 };
 
@@ -129,7 +128,7 @@ Dynamic_engraver::try_music (Music * m)
 }
 
 void
-Dynamic_engraver::create_grobs ()
+Dynamic_engraver::process_music ()
 {
   if (accepted_spanreqs_drul_[START] || accepted_spanreqs_drul_[STOP] || script_req_l_)
     {
@@ -187,8 +186,7 @@ Dynamic_engraver::create_grobs ()
       /*
        finish side position alignment if the (de)cresc ends here, and
        there are no new dynamics.
-    
-   */
+       */
  
       if ( !cresc_p_)
        {
@@ -203,12 +201,15 @@ Dynamic_engraver::create_grobs ()
          cresc_p_->set_bound (RIGHT, script_p_
                               ? script_p_
                               : unsmob_grob (get_property ("currentMusicalColumn")));
+         add_bound_item (line_spanner_, cresc_p_->get_bound (RIGHT));
+         
 
          finished_cresc_p_ = cresc_p_;
          cresc_p_ = 0;
          current_cresc_req_ = 0;
        }
     }
+  
   if (accepted_spanreqs_drul_[START])
     {
       if (current_cresc_req_)
@@ -224,27 +225,27 @@ Dynamic_engraver::create_grobs ()
 
          /*
            TODO: Use symbols.
-          */
+         */
 
          String start_type = ly_scm2string (accepted_spanreqs_drul_[START]->get_mus_property ("span-type"));
 
          /*
            ugh. Use push/pop?
-          */
+         */
          SCM s = get_property ((start_type + "Spanner").ch_C());
          if (!gh_symbol_p (s) || s == ly_symbol2scm ("hairpin"))
            {
              cresc_p_  = new Spanner (get_property ("Hairpin"));
              cresc_p_->set_grob_property ("grow-direction",
-                                         gh_int2scm ((start_type == "crescendo")
-                                                     ? BIGGER : SMALLER));
+                                          gh_int2scm ((start_type == "crescendo")
+                                                      ? BIGGER : SMALLER));
              
            }
          /*
            This is a convenient (and legacy) interface to TextSpanners
            for use in (de)crescendi.
            Hmm.
-          */
+         */
          else
            {
              cresc_p_  = new Spanner (get_property ("TextSpanner"));
@@ -256,7 +257,7 @@ Dynamic_engraver::create_grobs ()
              if (gh_string_p (s))
                {
                  cresc_p_->set_grob_property ("edge-text",
-                                             gh_cons (s, ly_str02scm ("")));
+                                              gh_cons (s, ly_str02scm ("")));
                  daddy_trans_l_->set_property (start_type + "Text",
                                                SCM_UNDEFINED);
                }
@@ -267,18 +268,24 @@ Dynamic_engraver::create_grobs ()
                               : unsmob_grob (get_property ("currentMusicalColumn")));
 
          Axis_group_interface::add_element (line_spanner_, cresc_p_);
+
+         add_bound_item (line_spanner_, cresc_p_->get_bound (LEFT));
+         
          announce_grob (cresc_p_, accepted_spanreqs_drul_[START]);
        }
     }
-  script_req_l_ = 0;
-  accepted_spanreqs_drul_[START] = 0;
-  accepted_spanreqs_drul_[STOP] = 0;
 }
 
 void
 Dynamic_engraver::stop_translation_timestep ()
 {
   typeset_all ();
+  if (script_req_l_ && !current_cresc_req_)
+    {
+      finished_line_spanner_ = line_spanner_;
+      line_spanner_ =0;
+      typeset_all ();
+    }
 }
 
 void
@@ -304,11 +311,16 @@ Dynamic_engraver::typeset_all ()
 {  
   if (finished_cresc_p_)
     {
-#if 1
-      finished_cresc_p_->set_bound (RIGHT, script_p_
-                          ? script_p_
-                          : unsmob_grob (get_property ("currentMusicalColumn")));
-#endif         
+      if (!finished_cresc_p_->get_bound (RIGHT))
+       {
+         finished_cresc_p_->set_bound (RIGHT, script_p_
+                                       ? script_p_
+                                       : unsmob_grob (get_property ("currentMusicalColumn")));
+
+         if (finished_line_spanner_)
+           add_bound_item (finished_line_spanner_,
+                           finished_cresc_p_->get_bound (RIGHT));
+       }
       typeset_grob (finished_cresc_p_);
       finished_cresc_p_ =0;
     }
@@ -320,8 +332,24 @@ Dynamic_engraver::typeset_all ()
     }
   if (finished_line_spanner_)
     {
+      /*
+       To make sure that this works
+      */
       Side_position::add_staff_support (finished_line_spanner_);
-      extend_spanner_over_elements (finished_line_spanner_);
+      /*
+       We used to have
+       
+            extend_spanner_over_elements (finished_line_spanner_);
+
+       but this is rather kludgy, since finished_line_spanner_
+       typically has a staff-symbol field set , extending it over the
+       entire staff.
+
+      */
+
+      if (!finished_line_spanner_->get_bound (RIGHT))
+       finished_line_spanner_->set_bound (RIGHT, finished_line_spanner_->get_bound (LEFT));
+      
       typeset_grob (finished_line_spanner_);
       finished_line_spanner_ = 0;
     }
index 0d5c67b74e844084e140d1246ad86b62f2dd566e..f157b480a2a1e11f41fe9ebe1363c2bd50c5f046 100644 (file)
@@ -47,7 +47,8 @@ Item::breakable_b (Grob*me)
 Paper_column *
 Item::column_l () const
 {
-  return dynamic_cast<Item*> (parent_l (X_AXIS))->column_l ();
+  Item *parent = dynamic_cast<Item*> (parent_l (X_AXIS));
+  return parent ? parent->column_l () : 0;
 }
 
 Line_of_score *
index 42dcb8751389ca182a071b85f4a64d56faaf147f..70136ac143db52259f68dc32e8f275a33138bdfa 100644 (file)
@@ -40,7 +40,7 @@ protected:
   virtual bool try_music (Music *req_l);
   virtual void start_translation_timestep ();
   virtual void initialize ();
-  virtual void create_grobs ();
+  virtual void process_music ();
   
 private:
   Mark_req * mark_req_l_;
@@ -135,8 +135,14 @@ Mark_engraver::try_music (Music* r_l)
   return false;
 }
 
+
+/*
+
+  TODO: make the increment function in Scheme.
+
+*/
 void
-Mark_engraver::create_grobs ()
+Mark_engraver::process_music ()
 {
   if (mark_req_l_)
     {
index 54f6253131ae4e0f5f8ca44cfc4d804760df664a..d6a356572903dde62a2c892b555712b188fff30c 100644 (file)
@@ -311,6 +311,9 @@ add_bound_item (Spanner* sp, Item*it)
     sp->set_bound (RIGHT, it);
 }
 
+/*
+  Extends EXTREMAL_PAIR to include IT
+ */
 static void
 extend_spanner_over_item (Item *it, SCM extremal_pair)
 {
@@ -330,6 +333,9 @@ extend_spanner_over_item (Item *it, SCM extremal_pair)
     }
 }
 
+/*
+  Extends EXTREMAL_PAIR to include every grob in VALUE
+ */
 static void
 extend_spanner_over_elements (SCM value, SCM extremal_pair)
 {
index 553e81041ee3ba326c06abdc8d41767589a79e9c..6ac3908098d29a7d6cbc5799e0ae19275e9c8b4a 100644 (file)
@@ -26,7 +26,7 @@ outputscale = \staffheight / 4.0;
 \translator { \ThreadContext}
 \translator { \PianoStaffContext}
 \translator { \LyricsVoiceContext }
-
+\translator { \StaffContainerContext }