]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.16
authorfred <fred>
Sun, 24 Mar 2002 19:58:26 +0000 (19:58 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:58:26 +0000 (19:58 +0000)
24 files changed:
flower/dstream.cc
flower/text-stream.cc
lib/includable-lexer.cc
lib/mapped-file-storage.cc
lib/simple-file-storage.cc
lily/include/line-spacer.hh
lily/item.cc
lily/line-spacer.cc
lily/midi-stream.cc
lily/music-iterator.cc
lily/music.cc
lily/musical-request.cc
lily/my-lily-lexer.cc
lily/outputter.cc
lily/p-score.cc
lily/performance.cc
lily/property-iterator.cc
lily/scoreline.cc
lily/span-bar.cc
lily/spanner.cc
lily/tex-stream.cc
lily/timing-translator.cc
lily/translator-group.cc
tex/taupindefs.tex

index 16d83d6890245c929f90c506ca3cb225abeb52d6..533cd13a7ce312df91ccd321c2250cffe3f3735d 100644 (file)
@@ -105,7 +105,7 @@ Dstream::output (String s)
   if (local_silence_b_|| !os_l_)
     return ;
   
-  for (char const *cp = s  ; *cp; cp++)
+  for (char const *cp = s.ch_C (); *cp; cp++)
     switch (*cp) 
       {
       case '{':
index 530c6f8ecd5f1c5b5b84fa7627b3b3e6c1ab70ab..f9a8307226bcaf03fdaed9d45feb4a02152d3aa2 100644 (file)
@@ -12,7 +12,7 @@ Text_stream::Text_stream (String fn)
        else 
            {
            name = fn;      
-           f = fopen (fn, "r");
+           f = fopen (fn.ch_C (), "r");
              }
        
        if (!f) 
index 05d9d9aa4255989744fa539489bd77a50baf9a25..fbb5c920d28e5b50705002bd3856035d4ce77bee 100644 (file)
@@ -26,7 +26,8 @@ Includable_lexer::new_input(String s, Sources  * global_sources)
   Source_file * sl = global_sources->get_file_l(s);
   if (!sl) 
     {
-      LexerError("Can't find file `" + s+ "'");
+      String msg ="Can't find file `" + s+ "'";
+      LexerError(msg.ch_C ());
       return; 
     }
 
index 2267164ae704766f1ad4b076fe093198b5910a9e..d260569570c1592c76eaddcefa1badd2f3ec9d9b 100644 (file)
@@ -53,7 +53,7 @@ Mapped_file_storage::map()
 void
 Mapped_file_storage::open(String name_str)
 {
-  fildes_i_ = ::open(name_str, O_RDONLY);      
+  fildes_i_ = ::open(name_str.ch_C (), O_RDONLY);      
            
   if (fildes_i_ == -1) 
     {
index b618e11634220e91c0f0969ce883c71b01647854..3ef231a3e49bad9938809be1cde2e65320e2e303 100644 (file)
@@ -34,7 +34,7 @@ Simple_file_storage::Simple_file_storage(String s)
     let's hope that "b" opens anything binary, and does not apply 
     CR/LF translation
     */
-  FILE * f =  (s) ?  fopen (s.ch_C(), "rb") : stdin;
+  FILE * f =  (s.length_i ()) ?  fopen (s.ch_C(), "rb") : stdin;
   
   if (!f) 
     {
index 053e59a902495388883914d4a62beff5119c5c0b..d91901bdfefe5ccc504e0086dc3bf290c53959d9 100644 (file)
@@ -25,47 +25,48 @@ class Line_spacer
 {
     
 public:
-    Paper_def * paper_l_;
-    Paper_def *paper_l() const;
-    Line_spacer();
+  Paper_def * paper_l_;
+  Paper_def *paper_l() const;
+  Line_spacer();
     
-    /** solve the spacing problem
-      */
-    virtual void solve (Col_hpositions *) const=0;
+  /** solve the spacing problem
+   */
+  virtual void solve (Col_hpositions *) const=0;
 
-    /**
-      Approximate the spacing problem:
-      return a lower bound on the energy
-     */
-    virtual void lower_bound_solution (Col_hpositions *) const=0;
+  /**
+    Approximate the spacing problem:
+    return a lower bound on the energy
+    */
+  virtual void lower_bound_solution (Col_hpositions *) const=0;
     
-    /** add a col to the problem. columns have to be added left to
-      right. The column contains info on it's minimum width.  */
-    virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0)=0;
+  /** add a col to the problem. columns have to be added left to
+    right. The column contains info on it's minimum width.  */
+  virtual void add_column (Paper_column  *, bool fixed=false, Real fixpos=0.0)=0;
 
-    /**
-      can the posed problem be solved?
+  /**
+    can the posed problem be solved?
       
-      @pre
+    @pre
 
-      prepare() was called
+    prepare() was called
       
-     */
-    virtual bool check_constraints (Vector v) const=0;
+    */
+  virtual bool check_constraints (Vector v) const=0;
 
-    /**
-      generate a solution which can't fail
-     */
-    virtual Vector default_solution() const=0;
+  /**
+    generate a solution which can't fail
+    */
+  virtual Vector default_solution() const=0;
 
     
-    virtual void OK() const{}
-    virtual void print() const{}
+  virtual void OK() const{}
+  virtual void print() const{}
     
-    /**
-      Call after construction before solving
-     */
-    virtual void prepare(){}
+  /**
+    Call after construction before solving
+    */
+  virtual void prepare(){}
+  virtual ~Line_spacer ();
 };
 
 #endif
index 40df46783f43af907e52f245f34fc1a635b7dcd0..21c96bc27397d7c3d823b631628c0ed7e83c8291 100644 (file)
@@ -145,6 +145,8 @@ Item::do_junk_links()
 void
 Item::do_unlink()
 {
+  Link_array<Spanner> attached = attached_span_l_arr_;
+
   for (int i=0; i < attached_span_l_arr_.size (); i++) {
     Spanner *&s= attached_span_l_arr_[i];
     if (s->spanned_drul_[LEFT] == this)
index c59589481a49085f6217cf8fdb709d0dbfc3cf35..6f9c317fd94eff93985fc008805d2958b15c7505 100644 (file)
@@ -18,3 +18,7 @@ Line_spacer::paper_l() const
 { 
   return paper_l_ ;
 }
+
+Line_spacer::~Line_spacer ()
+{
+}
index 874f367a42be3afd30323fd0fa571b964f16a12a..05d942138893b9d54c0424e23f7a69ca4ad46db8 100644 (file)
@@ -62,7 +62,7 @@ Midi_stream::operator <<(int i)
 void
 Midi_stream::open()
 {
-  os_p_ = new ofstream (filename_str_);
+  os_p_ = new ofstream (filename_str_.ch_C ());
   if (!*os_p_)
     error ("can't open `" + filename_str_ + "\'");
 }
index 9c1f2c733e1ad815c58c228432fcc40665eac182..9c792489141b1adf2616f6abff51941a28cbfca8 100644 (file)
@@ -135,7 +135,7 @@ Music_iterator::static_get_iterator_p (Music *m,
   else if (m->is_type_b (Change_translator::static_name ()))
     p = new Change_iterator((Change_translator*) m);
   
-  if (m -> translator_type_str_)
+  if (m -> translator_type_str_.length_i ())
     {
       Translator_group* a =report_l->
        find_create_translator_l (m-> translator_type_str_, m->translator_id_str_);
index 053275cc1f4dfda7b0421d5a91b1def08c9c6c1e..93a3f093b001ab9b5f354669eac9f335ab8ea6c0 100644 (file)
@@ -24,7 +24,7 @@ Music::print() const
   if (! check_debug)
        return ;
   DOUT << name() << "{";
-  if  (translator_type_str_)
+  if  (translator_type_str_.length_i ())
        DOUT << translator_type_str_ << " = " << translator_id_str_;
   do_print();
   DOUT << "}\n";
index 5b69a4f5813cfa39e2616efaf8e403f46996cbaf..4c6ce789dee2aee321d7e463ab10d60804941804 100644 (file)
@@ -451,7 +451,7 @@ String
 Absolute_dynamic_req::loudness_str () const
 {
   String s = loudness_static_str (loudness_);
-  if (!s)
+  if (s.empty_b ())
     {
       s = "mf";
       warning (String ("Never heard of dynamic scale ") 
index 13a479956c65a6f235cfa7f0b2df48059f938034..4c7f72e598d682e16679e9dfbd23b19006b72e11 100644 (file)
@@ -79,7 +79,7 @@ My_lily_lexer::My_lily_lexer()
 int
 My_lily_lexer::lookup_keyword (String s)
 {
-  return keytable_p_->lookup (s);
+  return keytable_p_->lookup (s.ch_C ());
 }
 
 Identifier*
index a533ea8e48c41488edccf23deae9b90f2b4e4f38..81ef2c793e002ce610e2a08c94414a94a0829b41 100644 (file)
@@ -23,7 +23,7 @@ void
 Tex_outputter::output_molecule (Molecule const*m, Offset o)
 {
   String t = m->TeX_string();
-  if (!t)
+  if (t.empty_b ())
     return ;
 
   String s ("\\placebox{%}{%}{%}");
index 0591e5cc1e2000ce999d4605680f309908e89439..39de484d984c9ceeec2c38d3fec2f8a0de2b0298 100644 (file)
@@ -190,7 +190,7 @@ Paper_score::tex_output ()
 {
   // output
   String outname = paper_l_->outfile_str_ ;
-  if (!outname)
+  if (outname.empty_b ())
     outname = default_out_str_+ ".tex";
   
   *mlog << "TeX output to " <<  outname << " ...\n";
index 439e6c719018531ddbf7c113f91019a28d9a6c56..ed74df07b46ec88ec74d594dc39a2aa29f823335 100644 (file)
@@ -114,7 +114,7 @@ Performance::process()
   print ();
   
   String out=midi_l_->outfile_str_;
-  if (!out)
+  if (out.empty_b ())
     out = default_out_str_ + ".midi";
 
   Midi_stream midi_stream (out);
index 7fbab5fe9d9f2dacdb58b6ff8fb456ce14dd3d5c..2a191dead80b25da68f43f2a11fb4d3b8c8727ea 100644 (file)
@@ -18,7 +18,7 @@ Property_iterator::Property_iterator (Translation_property *prop_l)
 void
 Property_iterator::process_and_next (Moment m)
 {
-  if (property_l_->var_str_)
+  if (property_l_->var_str_.length_i ())
     report_to_l ()->set_property (property_l_->var_str_, property_l_->value_);
   Music_iterator::process_and_next (m);
 }
index f65690cafba48c48d4fed974463a69e795693a5e..9a6438a5edc39a6bb74be2c6eab0a3b393a62a3d 100644 (file)
@@ -126,6 +126,7 @@ Line_of_score::get_extra_dependencies () const
 void
 Line_of_score::do_unlink () 
 {
+  Spanner::do_unlink ();
   for (int i=0; i < cols.size (); i++)
     cols[i]->line_l_ =0;
   cols.set_size (0);
index d4bd26f0a99662e2f69a9844080632856103852b..6076dd7d86255a75838af5eb77523ccd5f93a291 100644 (file)
@@ -68,9 +68,9 @@ Span_bar::do_pre_processing()
     }
   else 
     {
-      if (!type_str_)
+      if (type_str_.empty_b ())
        type_str_ = spanning_l_arr_[0]->type_str_;
-      if (!type_str_
+      if (type_str_.empty_b ()
        {
          transparent_b_=true;
          set_empty (true);
index 3685865b8f97efc94f69f15386ef00275788290d..1dafeadf866dc94a0dc43ff3b8d9c98f4e4e81ec 100644 (file)
@@ -78,7 +78,6 @@ Spanner::set_my_columns()
 void
 Spanner::set_bounds(Direction d, Item*i)
 {
-    
   if (spanned_drul_[d])
     spanned_drul_[d]->attached_span_l_arr_.substitute(this,0);
   
@@ -164,16 +163,8 @@ Spanner::broken_b() const
 void
 Spanner::do_unlink() 
 {
-  if (spanned_drul_[LEFT]) 
-    {
-      spanned_drul_[LEFT]->attached_span_l_arr_.substitute (this,0);
-      spanned_drul_[LEFT] =0;
-    }
-  if (spanned_drul_[RIGHT]) 
-    {
-      spanned_drul_[RIGHT]->attached_span_l_arr_.substitute (this,0);
-      spanned_drul_[RIGHT] = 0;
-    }
+  set_bounds (LEFT, 0);
+  set_bounds (RIGHT, 0);
 }
 
 void
index a9d826c3c77b522e91793dc7e95037a67c551b9b..eed823e575fdd6695c29a5fbeed6bdba9aa29de8 100644 (file)
@@ -24,7 +24,7 @@ const int MAXLINELEN = 200;
 
 Tex_stream::Tex_stream (String filename) 
 {
-  os = new ofstream (filename);
+  os = new ofstream (filename.ch_C ());
   if (!*os)
        error ("can't open `" + filename+"\'");
   nest_level = 0;
@@ -51,7 +51,7 @@ Tex_stream &
 Tex_stream::operator<<(String s)
 {
   
-  for (char const *cp = s; *cp; cp++) 
+  for (char const *cp = s.ch_C (); *cp; cp++) 
     {
        if (outputting_comment) 
          {
index c282d0c6088180a5274a381881bfcea28dda79bf..8bb57faf35faf7a7efdccf9a606dd494a730f13f 100644 (file)
@@ -73,7 +73,7 @@ Timing_translator::do_process_requests()
        {
          Moment m = tr_l->partial()->duration_;
          String error = time_.try_set_partial_str (m);
-         if (error) 
+         if (error.length_i ()
            {
              tr_l->warning (error);
            }
index 29bd652dedfbfc2cb785906cbc9df580b35b1f22..1521ede70d64ae93bb96ff250711c36acdafd8d8 100644 (file)
@@ -66,7 +66,7 @@ Translator_group::removable_b() const
 Translator_group * 
 Translator_group::find_existing_translator_l (String n, String id)
 {
-  if (is_alias_b (n) && (id_str_ == id || !id)) 
+  if (is_alias_b (n) && (id_str_ == id || id.empty_b ())) 
     return this;
   Translator_group* r = 0;
   for (int i =0; !r && i < group_l_arr ().size(); i++) 
@@ -290,7 +290,7 @@ Translator_group::do_print() const
     }
   else
     {
-      if (id_str_)
+      if (id_str_.length_i ())
        DOUT << "ID: " << id_str_ ;
       DOUT << " iterators: " << iterator_count_<< "\n";
     }
index 0469356a63381bfdb2f32dd7879526949567b3ee..769d2a48800e2fb29a55de08d307238f3b6da1fe 100644 (file)
@@ -14,7 +14,7 @@
         \font\italicfont=cmti10
         \font\dynfont=dyn10 scaled \magstep2
         \font\musicmathfont=cmsy10
-       \font\fontentja=font-en-tja20
+        \font\fontentja=font-en-tja20
 }
 
 
@@ -33,7 +33,7 @@
         \font\dynfont=dyn10 scaled \magstep1
         \font\musicdraw=musixsps
         \font\musicmathfont=cmsy8
-       \font\fontentja=font-en-tja16
+        \font\fontentja=font-en-tja16
 }
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % provide interface to musixtex fonts 
@@ -52,9 +52,8 @@
 \musicdef\longaball{'047}
 \musicdef\halfrest{'074}
 \musicdef\wholerest{'075}
-
 \musicdef\breverest{'072}
-\musicdef\breverest{'073} %% <- Mats, is this cool?
+\musicdef\longarest{'073}
 
 %% hmm
 \musicdef\outsidehalfrest{10}