]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/musical-request.cc
release: 1.3.65
[lilypond.git] / lily / musical-request.cc
index 369066fa7f19a1f03462551a40510e5ca772506a..cdcda7ac0160ae4c634aa92163c461e23d9a774b 100644 (file)
@@ -3,39 +3,35 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c)  1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
 */
 
 #include "musical-request.hh"
 #include "misc.hh"
 #include "debug.hh"
-
 #include "music-list.hh"
 
 void
 Span_req::do_print () const
 {
 #ifndef NPRINT
-  DOUT << spantype_;
+  DEBUG_OUT << span_dir_;
 #endif
 }
 
-Abbreviation_req::Abbreviation_req ()
+Tremolo_req::Tremolo_req ()
 {
   type_i_ = 0;
 }
 
 void
-Abbreviation_req::do_print () const
+Tremolo_req::do_print () const
 {
 #ifndef NPRINT
-  DOUT << "type " << type_i_ << '\n';
+  DEBUG_OUT << "type " << type_i_ << '\n';
 #endif
 }
 
-
-
-
 void
 Melodic_req::transpose (Musical_pitch delta)
 {
@@ -43,7 +39,7 @@ Melodic_req::transpose (Musical_pitch delta)
   
   if (abs (pitch_.accidental_i_) > 2)
     {
-       warning (_f ("transposition by %s makes accidental larger than two",
+       warning (_f ("Transposition by %s makes accidental larger than two",
          delta.str ()));
     }
 }
@@ -51,9 +47,9 @@ Melodic_req::transpose (Musical_pitch delta)
 
 
 bool
-Melodic_req::do_equal_b (Request*r) const
+Melodic_req::do_equal_b (Request const* r) const
 {
-  Melodic_req* m= dynamic_cast <Melodic_req *> (r);
+  Melodic_req const* m= dynamic_cast <Melodic_req const*> (r);
   return m&& !compare (*m, *this);
 }
 
@@ -79,9 +75,9 @@ Rhythmic_req::compare (Rhythmic_req const &r1, Rhythmic_req const &r2)
 }
 
 bool
-Rhythmic_req::do_equal_b (Request*r) const
+Rhythmic_req::do_equal_b (Request const* r) const
 {
-  Rhythmic_req* rh = dynamic_cast <Rhythmic_req *> (r);
+  Rhythmic_req const* rh = dynamic_cast <Rhythmic_req const*> (r);
 
   return rh && !compare (*this, *rh);
 }
@@ -90,7 +86,7 @@ void
 Rhythmic_req::do_print () const
 {
 #ifndef NPRINT
-  DOUT << "duration { " <<duration_.str () << "}";
+  DEBUG_OUT << "duration { " <<duration_.str () << "}";
 #endif
 }
 
@@ -110,14 +106,17 @@ Rhythmic_req::compress (Moment m)
 void
 Lyric_req::do_print () const
 {
+#ifndef NPRINT
   Rhythmic_req::do_print ();
+  DEBUG_OUT <<  "text = " << text_str_;
+#endif
 }
 
 
 bool
-Note_req::do_equal_b (Request*r) const
+Note_req::do_equal_b (Request const* r) const
 {
-  Note_req *n = dynamic_cast<Note_req*> (r);
+  Note_req const* n = dynamic_cast<Note_req const*> (r);
   return n&& Rhythmic_req::do_equal_b (n) && Melodic_req::do_equal_b (n);
 }
 
@@ -137,95 +136,59 @@ Note_req::do_print () const
   Melodic_req::do_print ();
   if (cautionary_b_)
     {
-       DOUT << " force cautionary accidental\n";
+       DEBUG_OUT << " force cautionary accidental\n";
     }
   else if (forceacc_b_)
     {
-       DOUT << " force accidental\n";
+       DEBUG_OUT << " force accidental\n";
     }
   Rhythmic_req::do_print ();
 #endif
 }
 
 
-Abbreviation_beam_req::Abbreviation_beam_req ()
-{
-  type_i_ = 0;
-}
-
 bool
-Span_req::do_equal_b (Request*r) const
+Span_req::do_equal_b (Request const*r) const
 {
-  Span_req * s = dynamic_cast <Span_req *> (r);
-  return s && spantype_ == s->spantype_;
+  Span_req const* s = dynamic_cast <Span_req const*> (r);
+  return s && span_dir_ == s->span_dir_;
 }
 
 Span_req::Span_req ()
 {
-  spantype_ = CENTER;
+  span_dir_ = CENTER;
 }
 
-
 void
-Absolute_dynamic_req::do_print () const
-{
-#ifndef NPRINT
-  DOUT << " loudness " <<loudness_str_ ;
-#endif
-}
-
-bool
-Absolute_dynamic_req::do_equal_b (Request *r) const
-{
-  Absolute_dynamic_req *a = dynamic_cast <Absolute_dynamic_req *> (r);
-  return a&& loudness_str_ == a->loudness_str_;
-}
-
-Absolute_dynamic_req::Absolute_dynamic_req ()
+Text_script_req::do_print () const
 {
-  loudness_str_ = "fm";                // yes, "illegal" on purpose.
+  DEBUG_OUT << "text" << text_str_
+       << ", style = " << style_str_;
 }
 
-
-
 bool
-Span_dynamic_req::do_equal_b (Request *req) const
-{
-  Span_dynamic_req * s = dynamic_cast <Span_dynamic_req *> (req);
-
-  return s&& Span_req::do_equal_b (req) && s->dynamic_dir_ == dynamic_dir_;
-}
-
-Span_dynamic_req::Span_dynamic_req ()
+Text_script_req::do_equal_b (Request const* r) const
 {
-  dynamic_dir_  = CENTER;
+  Text_script_req const* t  = dynamic_cast<Text_script_req const*> (r);
+  return t && t->text_str_ == text_str_ && t->style_str_ == style_str_;
 }
 
 void
-Span_dynamic_req::do_print () const
+Articulation_req::do_print () const
 {
-#ifndef NPRINT
-  Span_req::do_print ();
-  DOUT << "softer/louder: " << dynamic_dir_;
-#endif
+  DEBUG_OUT << articulation_str_;
 }
 
-void
-Text_script_req::do_print () const
+bool
+Articulation_req::do_equal_b (Request const* r) const
 {
-  DOUT << "text" << text_str_
-       << ", style = " << style_str_;
+  Articulation_req const* a = dynamic_cast<Articulation_req const*> (r);
+  
+  return a &&  articulation_str_ == a->articulation_str_;
 }
 
-void
-Articulation_req::do_print () const
-{
-  DOUT << articulation_str_;
-}
 
-bool
-Articulation_req::do_equal_b (Request*r) const
+Script_req::Script_req ()
 {
-  Articulation_req * a = dynamic_cast<Articulation_req*>(r);
-  return articulation_str_ == a->articulation_str_;
+  set_direction (CENTER);
 }