]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/score-engraver.cc
* input/regression/hairpin-dashed.ly: new file.
[lilypond.git] / lily / score-engraver.cc
index 66b95a251850f191edd56039144aa9f609724953..d19bf5dd91861990541035de24c80603a8787981 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "all-font-metrics.hh"
@@ -15,7 +15,7 @@
 #include "score-engraver.hh"
 #include "paper-score.hh"
 #include "paper-column.hh"
-#include "command-request.hh"
+
 #include "paper-def.hh"
 #include "axis-group-interface.hh"
 #include "translator-def.hh"
@@ -55,11 +55,8 @@ Score_engraver::make_columns ()
       Grob_info i2 (musical_column_);
       i2.origin_trans_ = this;
 
-  
       announce_grob (i1);
       announce_grob (i2);
-
-      
     }
 }
 
@@ -97,10 +94,10 @@ Score_engraver::finish ()
 void
 Score_engraver::initialize ()
 {
-  Font_metric *fm =
-    all_fonts_global->find_afm("feta20");
+  Font_metric *fm = all_fonts_global->find_afm("feta20");
   if (!fm)
-    error (_("Could not find feta20.afm. Fonts have not been installed properly; Aborting"));
+    error (_f ("can't find `%s'", "feta20.afm")
+          + "\n" +_ ("Fonts have not been installed properly.  Aborting"));
    
   unsmob_translator_def (definition_)->apply_property_operations (this);
 
@@ -145,6 +142,8 @@ Score_engraver::one_time_step ()
     }
   
   stop_translation_timestep ();
+  
+  apply_finalizations ();
   check_removal ();
 
 
@@ -176,7 +175,6 @@ Score_engraver::typeset_grob (Grob *elem)
   if (!elem)
     programming_error ("Score_engraver: empty elt\n");
   else
-
     elems_.push (elem);
 }
 
@@ -281,30 +279,26 @@ Score_engraver::try_music (Music*r)
 {
   bool gotcha = Engraver_group_engraver::try_music (r);  
 
-  if (!gotcha)
+  if (!gotcha && r->is_mus_type ("break-event"))
     {
-      if (Break_req* b = dynamic_cast<Break_req *> (r))
-       {
-         gotcha = true;
+      gotcha = true;
 
+      SCM pen = command_column_->get_grob_property ("penalty");
+      Real total_penalty = gh_number_p (pen)
+       ? gh_scm2double (pen)
+       : 0.0;
 
-         SCM pen = command_column_->get_grob_property ("penalty");
-         Real total_penalty = gh_number_p (pen)
-           ? gh_scm2double (pen)
-           : 0.0;
-
-         SCM rpen = b->get_mus_property ("penalty");
-         if (gh_number_p (rpen))
-           total_penalty +=  gh_scm2double (rpen);
+      SCM rpen = r->get_mus_property ("penalty");
+      if (gh_number_p (rpen))
+       total_penalty +=  gh_scm2double (rpen);
          
-         if (total_penalty > 10000.0) //  ugh. arbitrary.
-           forbid_breaks ();
+      if (total_penalty > 10000.0) //  ugh. arbitrary.
+       forbid_breaks ();
 
-         command_column_->set_grob_property ("penalty",
-                                              gh_double2scm (total_penalty));
-       }
+      command_column_->set_grob_property ("penalty",
+                                         gh_double2scm (total_penalty));
     }
-   return gotcha;
+  return gotcha;
 }
 
 /*
@@ -317,7 +311,7 @@ Score_engraver::forbid_breaks ()
     result is junked.
    */
   if (command_column_)
-    command_column_->remove_grob_property ("breakable");
+    command_column_->set_grob_property ("breakable", SCM_EOL);
 }
   
 void
@@ -340,19 +334,17 @@ Score_engraver::acknowledge_grob (Grob_info gi)
 
 
 ENTER_DESCRIPTION(Score_engraver,
-/* descr */       "Top level engraver. Takes care of generating columns and the complete  system (ie. System)
-
-
-This engraver decides whether a column is breakable. The default is
-that a column is always breakable. However, when every Bar_engraver
-that does not have a barline at a certain point will call
-Score_engraver::forbid_breaks to stop linebreaks.  In practice, this
-means that you can make a breakpoint by creating a barline (assuming
-that there are no beams or notes that prevent a breakpoint.)
-
-
-",
-/* creats*/       "System PaperColumn NonMusicalPaperColumn",
+/* descr */       "Top level engraver. Takes care of generating columns and the complete  system (ie. System) "
+"\n\n "
+"This engraver decides whether a column is breakable. The default is "
+"that a column is always breakable. However, when every Bar_engraver "
+"that does not have a barline at a certain point will call "
+"Score_engraver::forbid_breaks to stop linebreaks.  In practice, this "
+"means that you can make a breakpoint by creating a barline (assuming "
+"that there are no beams or notes that prevent a breakpoint.) "
+,
+/* creats*/       "System PaperColumn NonMusicalPaperColumn", 
+/* accepts */     "break-event",
 /* acks  */       "note-spacing-interface staff-spacing-interface",
 /* reads */       "currentMusicalColumn currentCommandColumn",
 /* write */       "");