]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-1.3.0
authorfred <fred>
Tue, 26 Mar 2002 22:42:39 +0000 (22:42 +0000)
committerfred <fred>
Tue, 26 Mar 2002 22:42:39 +0000 (22:42 +0000)
flower/include/string.hh
lily/staff-performer.cc
lily/tie-engraver.cc
lily/time-signature-engraver.cc
lily/timing-engraver.cc
lily/translator-group.cc
lily/translator.cc
po/GNUmakefile

index 24b975949a48e54b950f55cd485238807608a7db..b0bf9f8952980b466fec339dbc05a4a06162cdaf 100644 (file)
@@ -90,16 +90,7 @@ public:
   void operator += (String s);
 
   bool empty_b  () const;
-#if 0
-  /** is the string empty?
 
-    Ugh-ugh-thank-you-cygnus.  W32 barfs on this
-   */
-  operator bool  () const;
-  {
-    return length_i  (); 
-  }
-#endif
   void append (String);
   void prepend (String);
 
index 927285702be46cd4ef00e8c357ff03ce91492a45..853af03f630dca484aec616446067ea1f9116b4f 100644 (file)
@@ -96,21 +96,17 @@ String
 Staff_performer::new_instrument_str () 
 { 
   // mustn't ask Score for instrument: it will return piano!
-  String str = get_property ("midiInstrument", 0);
-  if (!str.length_i ())
-    str = get_property ("instrument", 0);
-  if (str == instrument_str_)
+  SCM minstr = get_property ("midiInstrument", 0);
+
+  if (!gh_string_p(minstr))
+    minstr = get_property ("instrument", 0);
+
+  if (ly_scm2string (minstr) == instrument_str_)
     return "";
 
-  instrument_str_ = str;
+  instrument_str_ = ly_scm2string (minstr);
 
   return instrument_str_;
-
-/* ugh, but can 't
-  if (properties_dict_.elem_b ("instrument"))
-    return properties_dict_["instrument"];
-  return "";
-*/
 }
 
 void 
index 4d3c8ca01c37c4ca482b3250610afef6a2027011..946f8e93671c96deea57b417a8ef1174229126b4 100644 (file)
@@ -26,7 +26,9 @@ Tie_engraver::do_try_music (Music *m)
   if (Tie_req * c = dynamic_cast<Tie_req*> (m))
     {
       req_l_ = c;
-      if (get_property ("automaticMelismata",0).to_bool ())
+      SCM m = get_property ("automaticMelismata",0);
+      bool am = gh_boolean_p (m) &&gh_scm2bool (m);
+      if (am)
        {
          set_melisma (true);
        }
@@ -43,7 +45,7 @@ Tie_engraver::set_melisma (bool m)
   if (!where)
     where = daddy_trans_l_;
     
-  daddy_trans_l_->set_property ("tieMelismaBusy", m ? "1" :"0");
+  daddy_trans_l_->set_property ("tieMelismaBusy", m ? SCM_BOOL_T : SCM_BOOL_F);
 }
 
 void
@@ -76,89 +78,55 @@ Tie_engraver::do_process_requests ()
 void
 Tie_engraver::process_acknowledged ()
 {
-  bool old_behavior = get_property ("oldTieBehavior", 0).to_bool ();
-  
   if (req_l_)
     {
-
-      /*
-       JUNKME!
-       */
-      if (old_behavior)
+      now_heads_.sort (CHead_melodic_tuple::pitch_compare);
+      stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
+      int i=0;
+      int j=0;
+      int tie_count=0;
+      while  ( i < now_heads_.size () && j < stopped_heads_.size ())
        {
-         if (now_heads_.size () != stopped_heads_.size ())
-           {
-             req_l_->warning (_ ("unequal number of note heads for tie"));
-           }
-         int sz = now_heads_.size () <? stopped_heads_.size ();
-
-         /* hmm. Should do something more sensible.
-       because, we assume no more noteheads come along after the 1st pass.
-         */
-         if (sz <= tie_p_arr_.size ())
-           return;
+         int comp
+           = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
+                                     stopped_heads_[j].req_l_->pitch_);
 
-         now_heads_.sort (CHead_melodic_tuple::pitch_compare);
-         stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
-
-         for (int i=0; i < sz; i++)
+         if (comp)
            {
-             Tie * p = new Tie;
-             p->set_head (LEFT, stopped_heads_[i].head_l_);
-             p->set_head (RIGHT, now_heads_[i].head_l_);
-             tie_p_arr_.push (p);
-             announce_element (Score_element_info (p, req_l_));
+             (comp < 0) ? i ++ : j++;
+             continue;
            }
-       }
-      else
-       {
-         now_heads_.sort (CHead_melodic_tuple::pitch_compare);
-         stopped_heads_.sort(CHead_melodic_tuple::pitch_compare);
-         int i=0;
-         int j=0;
-         int tie_count=0;
-         while  ( i < now_heads_.size () && j < stopped_heads_.size ())
+         else
            {
-             int comp
-               = Musical_pitch::compare (now_heads_[i].req_l_->pitch_ ,
-                                         stopped_heads_[j].req_l_->pitch_);
+             tie_count ++;
 
-             if (comp)
+             /* don't go around recreating ties that were already
+                made. Not infallible. Due to reordering in sort (),
+                we will make the wrong ties when noteheads are
+                added.  */
+             if (tie_count > tie_p_arr_.size ())
                {
-                 (comp < 0) ? i ++ : j++;
-                 continue;
+                 Tie * p = new Tie;
+                 p->set_head (LEFT, stopped_heads_[j].head_l_);
+                 p->set_head (RIGHT, now_heads_[i].head_l_);
+                 tie_p_arr_.push (p);
+                 announce_element (Score_element_info (p, req_l_));
                }
-             else
-               {
-                 tie_count ++;
-
-                 /* don't go around recreating ties that were already
-                 made. Not infallible. Due to reordering in sort (),
-                 we will make the wrong ties when noteheads are
-                 added.  */
-                 if (tie_count > tie_p_arr_.size ())
-                   {
-                     Tie * p = new Tie;
-                     p->set_head (LEFT, stopped_heads_[j].head_l_);
-                     p->set_head (RIGHT, now_heads_[i].head_l_);
-                     tie_p_arr_.push (p);
-                     announce_element (Score_element_info (p, req_l_));
-                   }
-                 i++;
-                 j++;
+             i++;
+             j++;
 
-               }
            }
+       }
 
-         if (!tie_p_arr_.size ())
-           {
-             req_l_->warning (_ ("No ties were created!"));
-           }
-         
+      if (!tie_p_arr_.size ())
+       {
+         req_l_->warning (_ ("No ties were created!"));
        }
+         
     }
 }
 
+
 void
 Tie_engraver::do_pre_move_processing ()
 {
@@ -168,14 +136,14 @@ Tie_engraver::do_pre_move_processing ()
     }
   now_heads_.clear ();
 
-  Scalar dir (get_property ("tieVerticalDirection", 0));
-  Scalar dir2 (get_property ("verticalDirection", 0));
+  SCM dir (get_property ("tieVerticalDirection", 0));
+  SCM dir2 (get_property ("verticalDirection", 0));
 
   Direction tie_dir = CENTER;
-  if (dir.length_i () && dir.isnum_b ())
-    tie_dir = (Direction) sign (int(dir));
-  else if (dir2.length_i () && dir2.isnum_b ())
-    tie_dir = (Direction) sign (int (dir2));
+  if (SCM_NUMBERP(dir))
+    tie_dir = to_dir (dir);
+  else if (isdir_b (dir2))
+    tie_dir = to_dir (dir2);
   
   for (int i=0; i<  tie_p_arr_.size (); i++)
    {
@@ -188,7 +156,8 @@ Tie_engraver::do_pre_move_processing ()
 void
 Tie_engraver::do_post_move_processing ()
 {
-  if (get_property ("automaticMelismata",0).to_bool ())
+  SCM m = get_property ("automaticMelismata",0);
+  if (gh_boolean_p (m) && gh_scm2bool (m))
     {
       set_melisma (false);
     }
index a71769709fe8b67c9a9786d95fac946643669246..d9051d59aee360913ab2f5cc3aab0e03233c1ea2 100644 (file)
@@ -54,10 +54,10 @@ Time_signature_engraver::do_pre_move_processing()
 {
   if (time_signature_p_) 
     {
-      Scalar sigstyle = get_property ("timeSignatureStyle", 0);
-      if (sigstyle.length_i ())
+      SCM sigstyle = get_property ("timeSignatureStyle", 0);
+      if (gh_string_p (sigstyle))
        {
-         time_signature_p_->time_sig_type_str_ = sigstyle;
+         time_signature_p_->time_sig_type_str_ = ly_scm2string (sigstyle);
        }
 
       typeset_element (time_signature_p_);
index 3fa208f15d6269026d7a76f5408a104a6f4fcbe1..29ee1d6d8c508f29f03e69e1f2c4e30a432a0e76 100644 (file)
@@ -53,12 +53,15 @@ Timing_engraver::which_bar ()
       if (!now_mom ())
        return "|";
 
-      Scalar nonauto = get_property ("barNonAuto", 0);
-      if (!nonauto.to_bool ())
+      SCM nonauto = get_property ("barNonAuto", 0);
+      if (!gh_boolean_p (nonauto) && gh_scm2bool (nonauto))
        {
-         Scalar always = get_property ("barAlways", 0);
-         if (!time_.whole_in_measure_ || always.to_bool ())
-           return get_property ("defaultBarType" ,0);
+         SCM always = get_property ("barAlways", 0);
+         if (!time_.whole_in_measure_ || gh_boolean_p (always) && gh_scm2bool (always))
+           {
+             SCM def=get_property ("defaultBarType" ,0);
+             return (gh_string_p (def))? ly_scm2string (def) : "";
+           }
        }
       return "";
     }
index fc4ca2a44d6ea8814ca68c0544a834ce32e08fe7..cffdaf8905afa3a7896f97778785fafd925b4c18 100644 (file)
@@ -10,7 +10,7 @@
 #include "translator-group.hh"
 #include "translator.hh"
 #include "debug.hh"
-#include "rational.hh"
+#include "moment.hh"
 #include "dictionary-iter.hh"
 
 #include "killing-cons.tcc"
@@ -373,10 +373,8 @@ Translator_group::do_print() const
 #ifndef NPRINT
   if (!flower_dstream)
     return ;
-  for (Dictionary_iter<Scalar> i (properties_dict_); i.ok (); i++)
-    {
-      DEBUG_OUT << i.key () << "=" << i.val () << '\n';
-    }
+
+  gh_display (properties_dict_.self_scm_);
   if (status == ORPHAN)
     {
       DEBUG_OUT << "consists of: ";
@@ -449,29 +447,29 @@ Translator_group::do_add_processing ()
     }
 }
 
-Scalar
+SCM
 Translator_group::get_property (String id,
                                Translator_group **where_l) const
 {
-  if (properties_dict_.elem_b (id))
+  SCM  sym = ly_symbol (id);
+  if (properties_dict_.elem_b (sym))
     {
       if (where_l)
        *where_l = (Translator_group*) this; // ugh
-      return properties_dict_[id];
+      return properties_dict_[sym];
     }
 
-#if 1
   if (daddy_trans_l_)
     return daddy_trans_l_->get_property (id, where_l);
-#endif
   
   if (where_l)
     *where_l = 0;
-  return "";
+
+  return SCM_UNDEFINED;
 }
 
 void
-Translator_group::set_property (String id, Scalar val)
+Translator_group::set_property (String id, SCM val)
 {
-  properties_dict_[id] = val;
+  properties_dict_[ly_symbol (id)] = val;
 }
index a5a3b68d51238b5843b6dfaba96c9e958f2b3246..218a8c142339f7c83eca4a5c637919c899888827 100644 (file)
@@ -11,7 +11,7 @@
 #include "debug.hh"
 #include "translator-group.hh"
 
-#include "rational.hh"
+#include "moment.hh"
 
 char const*
 Translator::name() const
@@ -163,7 +163,7 @@ Translator::output_def_l () const
   return output_def_l_;
 }
 
-Scalar
+SCM
 Translator::get_property (String id, Translator_group **where_l) const
 {
   return daddy_trans_l_->get_property (id, where_l);
index c6540da3b1b6ee6e90047f6f5d19e181057e514c..fb421f78908c3fe1a490f26d23f4870b4b570cb1 100644 (file)
@@ -15,7 +15,6 @@ EXTRA_DIST_FILES = TODO $(PO_FILES) $(POT_FILES)
 STEPMAKE_TEMPLATES=podir
 
 include $(depth)/make/stepmake.make 
-include $(stepdir)/po-rules.make
 
 default: $(MO_FILES)