]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.11
authorfred <fred>
Sun, 24 Mar 2002 19:56:04 +0000 (19:56 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:56:04 +0000 (19:56 +0000)
13 files changed:
lily/bar-number-grav.cc
lily/command-request.cc
lily/dynamic-grav.cc
lily/general-script-def.cc
lily/head-column.cc
lily/include/direction.hh [new file with mode: 0644]
lily/include/drul-array.hh [new file with mode: 0644]
lily/include/general-script-def.hh
lily/include/midi-def.hh
lily/include/music-output-def.hh [new file with mode: 0644]
lily/include/music-output.hh [new file with mode: 0644]
lily/include/staff-side.hh
lily/include/text-def.hh

index 4a468119c7960e816c47670a33ec1a6ed5cf75d1..1414f7b7de6a7e7112dd315f927de0c7a34c4039 100644 (file)
 #include "text-def.hh"
 #include "command-request.hh"
 #include "bar.hh"
+#include "time-description.hh"
 
 Bar_number_grav::Bar_number_grav()
 {
-  number_i_ =1;
   script_p_ =0;
 }
 
@@ -25,27 +25,31 @@ void
 Bar_number_grav::acknowledge_element (Score_elem_info i)
 {
   if (i.origin_grav_l_arr_.size() == 1 &&
-       i.elem_l_->is_type_b (Bar::static_name()) && !script_p_) 
-         {
-
-       script_p_ = new Script;
-       Text_def *td_p =new Text_def;
-       td_p->text_str_ = number_i_++;
-       script_p_->specs_l_ = td_p;
-       script_p_->breakable_b_ = true;
-       script_p_->dir_i_ = 1;
-
-       announce_element (Score_elem_info (script_p_, &dummy));
+      i.elem_l_->is_type_b (Bar::static_name()) && !script_p_) 
+    {
+      Time_description const * time = get_staff_info().time_C_;
+      if (!time || time->cadenza_b_)
+       return ;
+      
+      script_p_ = new Script;
+      Text_def *td_p =new Text_def;
+      td_p->text_str_ = time->bars_i_;
+
+      script_p_->specs_l_ = td_p;
+      script_p_->breakable_b_ = true;
+      script_p_->dir_ = UP;
+
+      announce_element (Score_elem_info (script_p_, &dummy));
     }
 }
 
 void
 Bar_number_grav::do_pre_move_processing()
 {
-  if ( script_p_) 
+  if (script_p_) 
     {
-       typeset_element (script_p_);
-       script_p_ =0;
+      typeset_element (script_p_);
+      script_p_ =0;
     }
 }
 
index 051ce84465731951952cc2894cf32f607ec4158c..69e7f4b7dbbb23d91c831d95ffbd8779a81cc075 100644 (file)
@@ -21,7 +21,7 @@ IMPLEMENT_IS_TYPE_B1(Command_script_req,Command_req);
 IMPLEMENT_IS_TYPE_B1(Cadenza_req, Timing_req);
 
 void
-Cadenza_req::do_print()const
+Cadenza_req::do_print() const
 {
 #ifndef NPRINT
   DOUT << on_b_;
@@ -29,7 +29,7 @@ Cadenza_req::do_print()const
 }
 
 bool
-Cadenza_req::do_equal_b (Request*r)const
+Cadenza_req::do_equal_b (Request*r) const
 {
   Cadenza_req*cad =  r->command()->timing ()->cadenza ();
   
@@ -44,7 +44,7 @@ Cadenza_req::Cadenza_req (bool b)
 
 
 bool
-Bar_req::do_equal_b (Request*r)const
+Bar_req::do_equal_b (Request*r) const
 {
   Bar_req * b = r->command()->bar ();
   return type_str_ == b->type_str_;
@@ -70,7 +70,7 @@ Partial_measure_req::Partial_measure_req (Moment m)
 }
 
 bool
-Partial_measure_req::do_equal_b (Request* r)const
+Partial_measure_req::do_equal_b (Request* r) const
 {
   Partial_measure_req *p = r->command()->timing ()->partial ();
 
@@ -81,18 +81,18 @@ Partial_measure_req::do_equal_b (Request* r)const
 IMPLEMENT_IS_TYPE_B1(Timing_req,Command_req);
 
 void
-Timing_req::do_print()const{}
+Timing_req::do_print() const{}
 
 
 IMPLEMENT_IS_TYPE_B1(Command_req,Request);
 
 void
-Command_req::do_print()const{}
+Command_req::do_print() const{}
 
 IMPLEMENT_IS_TYPE_B1(Disallow_break_req,Command_req);
 
 void
-Disallow_break_req::do_print()const
+Disallow_break_req::do_print() const
 {
 }
 /* *************** */
@@ -103,7 +103,7 @@ void
 Barcheck_req::do_print() const{}
 
 bool
-Barcheck_req::do_equal_b (Request*)const
+Barcheck_req::do_equal_b (Request*) const
 {
   return true;
 }
@@ -158,12 +158,12 @@ Meter_change_req::do_print() const
 }
 
 bool
-Meter_change_req::do_equal_b (Request * r)const
+Meter_change_req::do_equal_b (Request * r) const
 {
   Meter_change_req * m = r->command()->timing ()->meterchange ();
   
   return m->beats_i_ == beats_i_ 
-       && one_beat_i_ == m->one_beat_i_;
+    && one_beat_i_ == m->one_beat_i_;
 }
 
 Meter_change_req::Meter_change_req()
@@ -187,14 +187,14 @@ Tempo_req::Tempo_req()
 }
 
 void
-Tempo_req::do_print()const
+Tempo_req::do_print() const
 {
   DOUT << dur_.str() << " = " <<metronome_i_ ;
 }
 IMPLEMENT_IS_TYPE_B1(Tempo_req, Timing_req);
 
 bool
-Tempo_req::do_equal_b (Request *r)const
+Tempo_req::do_equal_b (Request *r) const
 {
   Tempo_req *t = r->command()->timing ()->tempo ();
   
@@ -211,13 +211,13 @@ Measure_grouping_req::do_print() const
 {
   for (int i=0; i < elt_length_arr_.size(); i++) 
     {
-       DOUT << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
+      DOUT << beat_i_arr_[i] <<"*" << elt_length_arr_[i]<<" ";
     }
 }
 
 
 bool 
-Measure_grouping_req::do_equal_b (Request*)const
+Measure_grouping_req::do_equal_b (Request*) const
 {
   return false;                // todo
 }
@@ -225,12 +225,12 @@ Measure_grouping_req::do_equal_b (Request*)const
 /* *************** */
 
 void
-Key_change_req::transpose (Melodic_req const & d)const
+Key_change_req::transpose (Melodic_req const & d) const
 {
   WARN << "don't know how to transpose a key. \n";
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->transpose (d);
+      melodic_p_arr_[i]->transpose (d);
     }
 }
 
@@ -241,7 +241,7 @@ Key_change_req::squash_octaves()
 {
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->octave_i_ = 0;
+      melodic_p_arr_[i]->octave_i_ = 0;
     }
 }
 
@@ -251,62 +251,62 @@ Key_change_req::do_print() const
 #ifndef NPRINT
   for (int i=0; i < melodic_p_arr_.size(); i++) 
     {
-       melodic_p_arr_[i]->print();
+      melodic_p_arr_[i]->print();
     }
 #endif
 }
 
 Key_change_req::Key_change_req()
 {
-       minor_b_ = false;
-       multi_octave_b_= false;
+  minor_b_ = false;
+  multi_octave_b_= false;
 }
 
 Key_change_req::Key_change_req (Key_change_req const&c)
 {
-       for (int i=0; i < c.melodic_p_arr_.size(); i++) 
-               melodic_p_arr_.push (c.melodic_p_arr_[i]->clone()->musical ()->melodic ());
-       minor_b_ = c.minor_b_;
-       multi_octave_b_ = c.multi_octave_b_;
+  for (int i=0; i < c.melodic_p_arr_.size(); i++) 
+    melodic_p_arr_.push (c.melodic_p_arr_[i]->clone()->musical ()->melodic ());
+  minor_b_ = c.minor_b_;
+  multi_octave_b_ = c.multi_octave_b_;
 }
 
 Key_change_req::~Key_change_req()
 {
-       for (int i=0; i < melodic_p_arr_.size(); i++)
-               delete melodic_p_arr_[i];
+  for (int i=0; i < melodic_p_arr_.size(); i++)
+    delete melodic_p_arr_[i];
 }
 
 int
 Key_change_req::flats_i()
 {
-       int flats_i = 0;
-       for ( int i = 0; i < melodic_p_arr_.size(); i++) 
-         {
-               Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
-               assert (mel_l);
-               if ( mel_l->accidental_i_ < 0)
-                       flats_i -= mel_l->accidental_i_;
-         }
-       return flats_i;
+  int flats_i = 0;
+  for (int i = 0; i < melodic_p_arr_.size(); i++) 
+    {
+      Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
+      assert (mel_l);
+      if (mel_l->accidental_i_ < 0)
+       flats_i -= mel_l->accidental_i_;
+    }
+  return flats_i;
 }
 
 int
 Key_change_req::minor_b()
 {
-       return minor_b_;        
+  return minor_b_;     
 }
 
 int
 Key_change_req::sharps_i()
 {
-       int sharps_i = 0;
-       for ( int i = 0; i < melodic_p_arr_.size(); i++) 
-         {
-               Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
-               assert (mel_l);
-               if ( mel_l->accidental_i_ > 0)
-                       sharps_i+= mel_l->accidental_i_;
-         }
-       return sharps_i;
+  int sharps_i = 0;
+  for (int i = 0; i < melodic_p_arr_.size(); i++) 
+    {
+      Melodic_req* mel_l = melodic_p_arr_[i]->melodic();
+      assert (mel_l);
+      if (mel_l->accidental_i_ > 0)
+       sharps_i+= mel_l->accidental_i_;
+    }
+  return sharps_i;
 }
 
index a159d32d7268dfa34460f2bff1ad64a107962f5f..9da5b1386ca53657b63287e5e8b4e2d04737cceb 100644 (file)
@@ -18,7 +18,7 @@
 
 Dynamic_engraver::Dynamic_engraver()
 {
-  dir_i_ =0;
+  dir_ = CENTER;
   do_post_move_processing();
   dynamic_p_ =0;
   to_end_cresc_p_ = cresc_p_ = 0;
@@ -36,7 +36,7 @@ Dynamic_engraver::do_try_request (Request * r)
 {
   Musical_req * m = r->musical();
   if (!m || !m->dynamic())
-       return false;
+    return false;
   dynamic_req_l_arr_.push (m->dynamic());
   return true;
 }
@@ -46,58 +46,58 @@ Dynamic_engraver::do_process_requests()
   Crescendo*  new_cresc_p=0; 
   for (int i=0; i < dynamic_req_l_arr_.size(); i++) 
     {
-       Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
-       if (dreq_l->absdynamic()) 
-         {
-           Text_def * td_p = new Text_def;
-           td_p->align_i_ = 0;
-           String loud =Dynamic_req::loudness_str (
-               dreq_l->absdynamic()->loudness_);
+      Dynamic_req *dreq_l = dynamic_req_l_arr_[i];
+      if (dreq_l->absdynamic()) 
+       {
+         Text_def * td_p = new Text_def;
+         td_p->align_i_ = 0;
+         String loud =Dynamic_req::loudness_str (
+                                                 dreq_l->absdynamic()->loudness_);
            
-           td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex;
-           td_p->style_str_ = "dynamic";
+         td_p->text_str_ = paper()->lookup_l ()->dynamic (loud).tex;
+         td_p->style_str_ = "dynamic";
 
-           assert (!dynamic_p_) ; // TODO
+         assert (!dynamic_p_) ; // TODO
                
-           dynamic_p_ = new Text_item (td_p);
-           announce_element (Score_elem_info (dynamic_p_, dreq_l));
-         }
-       else if (dreq_l->span_dynamic()) 
-         {
+         dynamic_p_ = new Text_item (td_p);
+         announce_element (Score_elem_info (dynamic_p_, dreq_l));
+       }
+      else if (dreq_l->span_dynamic()) 
+       {
 
-           Span_dynamic_req* span_l = dreq_l->span_dynamic();
-           if (span_l->spantype == Span_req::STOP) 
-             {
-               if (!cresc_p_) 
-                 {
-                   span_l->warning ("Can't find cresc to end ");
-                 }
-               else 
-                 {
-                   assert (!to_end_cresc_p_);
-                   to_end_cresc_p_ =cresc_p_;
-                   cresc_p_ = 0;
-                 }
-             }
-           else if (span_l->spantype == Span_req::START) 
-             {
-               cresc_req_l_ = span_l;
-               assert (!new_cresc_p);
-               new_cresc_p  = new Crescendo;
-               new_cresc_p->grow_dir_i_ = span_l->dynamic_dir_i_;
-               announce_element (Score_elem_info (new_cresc_p, span_l));
-             }
-         }
+         Span_dynamic_req* span_l = dreq_l->span_dynamic();
+         if (span_l->spantype == Span_req::STOP) 
+           {
+             if (!cresc_p_) 
+               {
+                 span_l->warning ("Can't find cresc to end ");
+               }
+             else 
+               {
+                 assert (!to_end_cresc_p_);
+                 to_end_cresc_p_ =cresc_p_;
+                 cresc_p_ = 0;
+               }
+           }
+         else if (span_l->spantype == Span_req::START) 
+           {
+             cresc_req_l_ = span_l;
+             assert (!new_cresc_p);
+             new_cresc_p  = new Crescendo;
+             new_cresc_p->grow_dir_ = span_l->dynamic_dir_;
+             announce_element (Score_elem_info (new_cresc_p, span_l));
+           }
+       }
     }
 
-  if ( new_cresc_p) 
+  if (new_cresc_p) 
     {
-       cresc_p_ = new_cresc_p;
-       cresc_p_->left_col_l_ = get_staff_info().musical_l ();
-       if (dynamic_p_) 
-         {
-           cresc_p_->left_dyn_b_ = true;
-         }
+      cresc_p_ = new_cresc_p;
+      cresc_p_->set_bounds(LEFT,get_staff_info().musical_l ());
+      if (dynamic_p_) 
+       {
+         cresc_p_->dyn_b_drul_[LEFT] = true;
+       }
     }
 }
 
@@ -107,19 +107,19 @@ Dynamic_engraver::do_pre_move_processing()
   Staff_symbol* s_l = get_staff_info().staff_sym_l_;
   if (dynamic_p_) 
     {
-       dynamic_p_->set_staffsym (s_l);
-       typeset_element (dynamic_p_);
-       dynamic_p_ = 0;
+      dynamic_p_->set_staffsym (s_l);
+      typeset_element (dynamic_p_);
+      dynamic_p_ = 0;
     }
-  if ( to_end_cresc_p_) 
+  if (to_end_cresc_p_) 
     {
-       if (dynamic_p_)
-           to_end_cresc_p_->right_dyn_b_=true;
+      if (dynamic_p_)
+       to_end_cresc_p_->dyn_b_drul_[RIGHT]=true;
        
-       to_end_cresc_p_->right_col_l_ = get_staff_info().musical_l ();
-       to_end_cresc_p_->set_staffsym (s_l);
-       typeset_element (to_end_cresc_p_);
-       to_end_cresc_p_ = 0;
+      to_end_cresc_p_->set_bounds(RIGHT,get_staff_info().musical_l ());
+      to_end_cresc_p_->set_staffsym (s_l);
+      typeset_element (to_end_cresc_p_);
+      to_end_cresc_p_ = 0;
     }
 }
 
@@ -127,7 +127,7 @@ void
 Dynamic_engraver::set_feature (Feature i)
 {
   if (i.type_ == "vdir")       
-       dir_i_ = i.value_;
+    dir_ = (Direction) int(i.value_);
 }
 
 
@@ -140,7 +140,7 @@ Dynamic_engraver::~Dynamic_engraver()
   delete to_end_cresc_p_;
   if (cresc_p_) 
     {
-       cresc_req_l_->warning ("unended crescendo");
+      cresc_req_l_->warning ("unended crescendo");
     }
   delete cresc_p_;
 }
@@ -149,10 +149,10 @@ Dynamic_engraver::acknowledge_element (Score_elem_info i)
 {
   if (i.elem_l_->name() == Note_column::static_name ()) 
     {
-       if (dynamic_p_) dynamic_p_->add_support (i.elem_l_);
-       if (to_end_cresc_p_)
-           to_end_cresc_p_->add_support (i.elem_l_);
-       if (cresc_p_) 
-           cresc_p_->add_support (i.elem_l_);
+      if (dynamic_p_) dynamic_p_->add_support (i.elem_l_);
+      if (to_end_cresc_p_)
+       to_end_cresc_p_->add_support (i.elem_l_);
+      if (cresc_p_) 
+       cresc_p_->add_support (i.elem_l_);
     }
 }
index f3b202e8055ed5dba03a7c30de404a2c1789ad35..70c2b740af0b49ab8ca852a8f2bf4759afda2edc 100644 (file)
 #include "general-script-def.hh"
 #include "debug.hh"
 #include "symbol.hh"
-int
-General_script_def::staff_dir_i()const
+Direction
+General_script_def::staff_dir() const
 {
-  return -1;
+  return DOWN;
 }
-int
-General_script_def::rel_stem_dir_i()const
+
+Direction
+General_script_def::rel_stem_dir() const
 {
-  return 0;
+  return CENTER;
 }
 int
-General_script_def::priority_i()const
+General_script_def::priority_i() const
 {
   return 1000;
 }
 
 bool
-General_script_def::inside_b()const
+General_script_def::inside_b() const
 {
   return false;
 }
 
 bool
-General_script_def::equal_b (General_script_def const&g)const
+General_script_def::equal_b (General_script_def const&g) const
 {
   if (name() != g.name ())
-       return false;
+    return false;
 
   return do_equal_b (&g);
 }
 
 bool
-General_script_def::do_equal_b (General_script_def const*)const
+General_script_def::do_equal_b (General_script_def const*) const
 {
   return true;
 }
@@ -62,7 +63,7 @@ General_script_def::do_print() const
 }
 
 Atom
-General_script_def::get_atom (Paper_def*, int)const
+General_script_def::get_atom (Paper_def*, Direction) const
 {
   Symbol s;
   return Atom (s);
index a5d1ecbebd9363e773823c74f964e8e6997b2cbb..b8707965a65003ffb1d0c0823ef208f6cf52a220 100644 (file)
 Head_column::Head_column()
 {
   stem_l_ = 0;
-  dir_i_ =0;
+  dir_ =CENTER;
 }
 
 void
 Head_column::do_substitute_dependency (Score_elem*o,
-                                     Score_elem*n)
+                                      Score_elem*n)
 {
   Script_column::do_substitute_dependency (o,n);
   if (o->name() == Note_head::static_name ()) 
     {
-       head_l_arr_.substitute ((Note_head*)o->item(), 
-                               (n)? (Note_head*)n->item() : 0);
+      head_l_arr_.substitute ((Note_head*)o->item(), 
+                             (n)? (Note_head*)n->item() : 0);
     }
   if (stem_l_ == o) 
     {
-       stem_l_ = n ? (Stem*)n->item():0;
+      stem_l_ = n ? (Stem*)n->item():0;
     }
 }
 
@@ -40,8 +40,8 @@ Head_column::set (Stem*stem_l)
 {
   stem_l_ = stem_l;
   Score_elem::add_dependency (stem_l);
-  for (int i=0; script_l_arr_.size(); i++)
-       script_l_arr_[i]->set_stem (stem_l);
+  for (int i=0; i < script_l_arr_.size(); i++)
+    script_l_arr_[i]->set_stem (stem_l);
 }
 
 void
@@ -49,7 +49,7 @@ Head_column::add (Script *script_l)
 {
   Script_column::add (script_l) ;
   if  (stem_l_)
-       script_l->set_stem (stem_l_);
+    script_l->set_stem (stem_l_);
 }
 void
 Head_column::add (Note_head *n_l)
@@ -73,10 +73,10 @@ Head_column::do_print() const
 void
 Head_column::do_pre_processing()
 {
-  if (!dir_i_)
+  if (!dir_)
     {
-       if (stem_l_)
-           dir_i_ = stem_l_->dir_i_;
+      if (stem_l_)
+       dir_ = stem_l_->dir_;
     }
   Script_column::do_pre_processing();
 }
diff --git a/lily/include/direction.hh b/lily/include/direction.hh
new file mode 100644 (file)
index 0000000..032effc
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+  direction.hh -- declare 
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DIRECTION_HH
+#define DIRECTION_HH
+
+enum Direction 
+{
+  UP=1,
+  DOWN=-1,
+  LEFT=-1,
+  RIGHT=1,
+  CENTER=0,
+  SMALLER=-1,
+  BIGGER=1,
+
+};
+
+
+#endif // DIRECTION_HH
diff --git a/lily/include/drul-array.hh b/lily/include/drul-array.hh
new file mode 100644 (file)
index 0000000..69db537
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+  drul-array.hh -- declare Drul_array
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef DRUL_ARRAY_HH
+#define DRUL_ARRAY_HH
+
+#include "direction.hh"
+
+/**
+  Left/right or Up/down arrays. Drul is nicer sounding than udlr
+ */
+template<class T>
+struct Drul_array
+{
+  T array_[2];
+  T &operator[] (Direction d)
+  {
+    assert (d==1 || d== -1);
+    return array_[(d+1)/2];
+  }
+  T operator[]  (Direction d) const
+  {
+    assert (d==1 || d== -1);
+    return array_[(d+1)/2];
+  }
+};
+
+#endif // DRUL_ARRAY_HH
index 4f927b2dfd73a5a5a1d8f6858ff0426dc01b6ca7..3788df867cbd0fddc933595376e7b05076ddd891 100644 (file)
@@ -13,6 +13,8 @@
 #include "lily-proto.hh"
 #include "input.hh"
 #include "virtual-methods.hh"
+#include "direction.hh"
+
 /**
   Definition of anything that is put aside staff/notes.
  */
@@ -20,18 +22,18 @@ class General_script_def : public Input {
 public:
     VIRTUAL_COPY_CONS(General_script_def,General_script_def);
     DECLARE_MY_RUNTIME_TYPEINFO;
-    virtual int staff_dir_i()const;
+    virtual Direction staff_dir() const;
     void print() const;
-    virtual int rel_stem_dir_i()const;
-    virtual int priority_i()const;
-    virtual bool inside_b()const;
-    virtual Atom get_atom (Paper_def* p, int dir_i_)const;
-    bool equal_b (General_script_def const&)const;
+    virtual Direction rel_stem_dir() const;
+    virtual int priority_i() const;
+    virtual bool inside_b() const;
+    virtual Atom get_atom (Paper_def* p, Direction dir_) const;
+    bool equal_b (General_script_def const&) const;
     virtual ~General_script_def() {}
     
 protected:
-    virtual bool do_equal_b (General_script_def const *)const;
-    virtual void do_print()const;
+    virtual bool do_equal_b (General_script_def const *) const;
+    virtual void do_print() const;
 };
 
 #endif // GENERAL_SCRIPT_DEF_HH
index bb96d961e897f50cc4aee9b1f7faaf61eae8ef62..115158dfdcd0cec62a0545452a65f0d5d3c66b09 100644 (file)
 #include "real.hh"
 #include "string.hh"
 #include "moment.hh"
-
+#include "music-output-def.hh"
 
 /** 
   definitions for midi output. Rather empty
  */
-struct Midi_def {
-    // ugh!
-    static int den_i_s;
-    static int num_i_s;
-
-    /// output file name
-    String outfile_str_;
-
-    Input_translator* itrans_p_;
-
-    /// duration of whole note
-    Real whole_seconds_f_;
-
-    Midi_def();
-    Midi_def (Midi_def const& midi_c_r);
-    ~Midi_def();
-
-    Real duration_to_seconds_f (Moment);
-    Global_translator* get_global_translator_p() const;
-    int get_tempo_i (Moment moment);
-    void print() const;
-    void set (Input_translator* itrans_p);
-    void set_tempo (Moment moment, int count_per_minute_i);
+class Midi_def : public Music_output_def {
+public:
+  // ugh!
+  static int den_i_s;
+  static int num_i_s;
+  VIRTUAL_COPY_CONS(Midi_def, Music_output_def);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  Input_translator* itrans_p_;
+
+  /// duration of whole note
+  Real whole_seconds_f_;
+
+  Midi_def();
+  Midi_def (Midi_def const& midi_c_r);
+  ~Midi_def();
+
+  Real duration_to_seconds_f (Moment);
+  int get_tempo_i (Moment moment);
+  void print() const;
+  void set (Input_translator* itrans_p);
+  void set_tempo (Moment moment, int count_per_minute_i);
+protected:
+  virtual Global_translator * get_global_translator_p ();  
 };
 
 #endif // MIDI_DEF_HH
diff --git a/lily/include/music-output-def.hh b/lily/include/music-output-def.hh
new file mode 100644 (file)
index 0000000..b0b8316
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+  music-output-def.hh -- declare Music_output_def
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Music_output_DEF_HH
+#define Music_output_DEF_HH
+#include "string.hh"
+#include "lily-proto.hh"
+#include "virtual-methods.hh"
+
+/**
+  Definition of how to output mudela. 
+ */
+class Music_output_def  
+{
+public:
+  VIRTUAL_COPY_CONS(Music_output_def, Music_output_def);
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  virtual void print () const {}
+  virtual ~Music_output_def () {}
+  virtual Global_translator * get_global_translator_p () { return 0; }
+  String outfile_str_;
+};
+#endif // Music_output_DEF_HH
diff --git a/lily/include/music-output.hh b/lily/include/music-output.hh
new file mode 100644 (file)
index 0000000..f777f1b
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+  music-output.hh -- declare Music_output
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+*/
+
+
+#ifndef Music_output_HH
+#define Music_output_HH
+
+#include "string.hh"
+#include "lily-proto.hh"
+
+/**
+  Output something that was defined in a mudela file. 
+ */
+class Music_output 
+{
+public:
+  Header * header_l_;
+  String default_out_str_;
+  String origin_str_;
+  int errorlevel_i_;
+
+  virtual void process() {} 
+  virtual ~Music_output (){}
+  Music_output() 
+  {
+    errorlevel_i_ = 0;
+  }
+       
+};
+#endif // Music_output_HH
index 7e7a75ea0254693ed113e245aec94a54957f0e9d..c682c9efbd24d9dcf0e16bc6a36567e0ca66a28c 100644 (file)
@@ -12,6 +12,7 @@
 
 #include "score-elem.hh"
 #include "interval.hh"
+#include "direction.hh"
 
 /** A symbol which sits along a staff.
 
@@ -19,9 +20,9 @@
 class Staff_side : virtual Score_elem {
     Link_array<Score_elem> support_l_arr_;
     int staff_size_i_;
-    Interval support_height()const;
+    Interval support_height() const;
     Staff_symbol* staff_sym_l_;
-    int get_position_i()const;
+    int get_position_i() const;
 
     void read_staff_sym();
 public:
@@ -29,7 +30,7 @@ public:
     /**
       Vertical dir of symbol relative to staff. -1 = below staff?
       */
-    int dir_i_;
+    Direction dir_;
     Interval sym_int_;
     
     /// follow the support inside the staff?
index 3f13add20511664f9e11c7050220da09411d67ae..d40a4c7b2778da142c53f7bf1c9070ec47ab0fbf 100644 (file)
@@ -14,7 +14,7 @@
 
 class Text_def : public General_script_def {
 protected:
-    virtual Atom get_atom (Paper_def* p, int dir_i_)const;
+    virtual Atom get_atom (Paper_def* p, Direction dir_) const;
     DECLARE_MY_RUNTIME_TYPEINFO;
     VIRTUAL_COPY_CONS(Text_def,General_script_def);
 public:
@@ -30,7 +30,7 @@ public:
     
     virtual void do_print() const;
     virtual ~Text_def() {};
-    virtual bool do_equal_b (const General_script_def*)const;
+    virtual bool do_equal_b (const General_script_def*) const;
     Text_def();
     virtual void print() const;
     Interval width (Paper_def*) const;