]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.1.42
authorfred <fred>
Sun, 24 Mar 2002 20:05:12 +0000 (20:05 +0000)
committerfred <fred>
Sun, 24 Mar 2002 20:05:12 +0000 (20:05 +0000)
lily/include/plet-spanner.hh [new file with mode: 0644]
lily/plet-spanner.cc [new file with mode: 0644]
make/lelievijver.lsm
make/lilypond.lsm
make/lilypond.spec

diff --git a/lily/include/plet-spanner.hh b/lily/include/plet-spanner.hh
new file mode 100644 (file)
index 0000000..cae6472
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+  plet-spanner.hh -- part of GNU LilyPond
+
+  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#ifndef PLET_SPANNER_HH
+#define PLET_SPANNER_HH
+
+#include "bow.hh"
+
+/** supportable plet: triplets, eentweetjes, ottava, etc.  */
+
+class Plet_spanner : public Bow
+{
+public:
+
+  Plet_spanner ();
+  virtual ~Plet_spanner ();
+  void set_stem (Direction, Stem*);
+  Text_def* tdef_p_;
+  Drul_array<Stem *> stem_l_drul_;
+protected:
+  virtual Molecule* brew_molecule_p () const;
+private:
+
+
+protected:
+
+  DECLARE_MY_RUNTIME_TYPEINFO;
+  SCORE_ELEM_CLONE(Plet_spanner);
+
+  virtual void do_add_processing ();
+  virtual void do_post_processing ();
+  virtual void set_default_dir ();
+  virtual void do_substitute_dependency (Score_elem*,Score_elem*);
+};
+
+#endif // PLET_SPANNER_HH
+
diff --git a/lily/plet-spanner.cc b/lily/plet-spanner.cc
new file mode 100644 (file)
index 0000000..1290f63
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+  plet-spanner.cc -- implement Plet_spanner
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1997 Jan Nieuwenhuizen <jan@digicash.com>
+*/
+
+#include "atom.hh"
+#include "boxes.hh"
+#include "debug.hh"
+#include "lookup.hh"
+#include "molecule.hh"
+#include "p-col.hh"
+#include "paper-def.hh"
+#include "plet-spanner.hh"
+#include "stem.hh"
+#include "text-def.hh"
+
+IMPLEMENT_IS_TYPE_B1 (Plet_spanner,Bow);
+  
+Plet_spanner::Plet_spanner ()
+  : Bow ()
+{
+  stem_l_drul_[RIGHT] =0;
+  stem_l_drul_[LEFT] =0;
+
+  tdef_p_ = new Text_def;
+  tdef_p_->align_i_ = CENTER;
+  tdef_p_->style_str_ = "italic";
+}
+
+Plet_spanner::~Plet_spanner ()
+{
+  delete tdef_p_;
+}
+
+Molecule*
+Plet_spanner::brew_molecule_p () const
+{
+  Molecule* mol_p = new Molecule;
+  Real w = width ().length ();
+  
+  Real dy_f = dy_f_drul_[RIGHT] - dy_f_drul_[LEFT];
+  
+  // ugh
+  Real nwc_f = (dir_ > 0 ? paper ()->note_width () : 0) * 0.8;
+  
+  w += (dx_f_drul_[RIGHT] - dx_f_drul_[LEFT]);
+  
+  Atom a = paper ()->lookup_l ()->plet (dy_f, w, dir_);
+
+  a.translate (Offset ( (dx_f_drul_[LEFT] + nwc_f), dy_f_drul_[LEFT]));
+  mol_p->add (a);
+
+  Real interline_f = paper ()->interline_f ();
+  Real numy_f = (dir_ > 0 ? 0 : -interline_f / 2);
+  Real numx_f = interline_f / 1.5;
+  Atom num (tdef_p_->get_atom (paper (), CENTER));
+  num.translate (Offset (width ().length ()/ 2 + nwc_f - numx_f 
+                        + dx_f_drul_[LEFT], 
+                        dy_f_drul_[LEFT] + dy_f / width ().length () / 2 
+                        + dir_ * interline_f / 2 + numy_f));
+  mol_p->add (num);
+
+  return mol_p;
+}
+  
+void
+Plet_spanner::do_add_processing ()
+{
+  if (! (stem_l_drul_[LEFT] && stem_l_drul_[RIGHT]))
+    warning (_ ("Lonely plet.. "));
+
+  Direction d = LEFT;
+  Drul_array<Stem *> new_stem_drul = stem_l_drul_;
+  do {
+    if (!stem_l_drul_[d])
+      new_stem_drul[d] = stem_l_drul_[(Direction)-d];
+  } while ( (d *= -1) != LEFT);
+  stem_l_drul_ = new_stem_drul;
+}
+  
+void
+Plet_spanner::do_post_processing ()
+{
+  Real interline_f = paper ()->interline_f ();
+  assert (stem_l_drul_[LEFT] || stem_l_drul_[RIGHT]);
+
+  Direction d = LEFT;
+  do
+    {
+      dy_f_drul_[d] = .5 * interline_f * (stem_l_drul_[d] 
+                                         ? stem_l_drul_[d]->stem_end_f ()
+                                         : stem_l_drul_[(Direction)-d]->stem_end_f ());
+      dy_f_drul_[d] += dir_ * interline_f;
+    }
+  while ( (d *= -1) != LEFT);
+}
+
+void
+Plet_spanner::do_substitute_dependency (Score_elem* o, Score_elem* n)
+{
+  Stem* new_l = n ? (Stem*)n->item () : 0;
+  if (o->item () == stem_l_drul_[LEFT])
+    stem_l_drul_[LEFT] = new_l;
+  else if (o->item () == stem_l_drul_[RIGHT])
+    stem_l_drul_[RIGHT] = new_l;
+}
+  
+void
+Plet_spanner::set_default_dir ()
+{
+  Real m = (stem_l_drul_[LEFT]->stem_end_f () 
+           + stem_l_drul_[RIGHT]->stem_end_f ()) / 2;
+  dir_ =  (m < 0) ? DOWN : UP;
+}
+
+void
+Plet_spanner::set_stem (Direction d, Stem* stem_l)
+{
+  assert (!stem_l_drul_[d]);
+  stem_l_drul_[d] = stem_l;
+  set_bounds (d, stem_l);
+
+  add_dependency (stem_l);
+}
+
index 99db45d95621880d1eb1f804dc47356e01995e9c..ca2db8749dfe9efe33af4bee4ceb66b00129d227 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Titel: LilyPond
-Versie: 0.1.41
-Inschrijf datum: 19JAN98
+Versie: 0.1.42
+Inschrijf datum: 27JAN98
 Beschrijving: LilyPond is de muziek typesetter van het GNU Project.  
                Het programma genereert muziek in zichtbare of 
                hoorbare vorm uit uit een muzikale definitie file: 
@@ -16,8 +16,8 @@ Auteur: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Onderhouden door: hanwen@stack.nl (Han-Wen Nienhuys)
 Voornaamste plek: sunsite.unc.edu /pub/Linux/apps
-       395k lilypond-0.1.41.tar.gz 
+       395k lilypond-0.1.42.tar.gz 
 Oorspronkelijke plek: pcnov095.win.tue.nl /pub/lilypond/
-       395k lilypond-0.1.41.tar.gz 
+       395k lilypond-0.1.42.tar.gz 
 Copi"eer politie: GPL
 End
index 38a1ff5d743ee8b379e59d42db7628063a6856a3..7847e952cf9ca2dd691ae04f285d389804236bc8 100644 (file)
@@ -1,7 +1,7 @@
 Begin3
 Title: LilyPond
-Version: 0.1.41
-Entered-date: 19JAN98
+Version: 0.1.42
+Entered-date: 27JAN98
 Description: LilyPond is the GNU Project music typesetter.  The program
                generates visual or auditive output from a music 
                definition file: it can typeset formatted sheet music 
@@ -15,8 +15,8 @@ Author: hanwen@stack.nl (Han-Wen Nienhuys)
        jan@digicash.com (Jan Nieuwenhuizen)
 Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys)
 Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert
-       470k lilypond-0.1.41.tar.gz 
+       470k lilypond-0.1.42.tar.gz 
 Original-site: pcnov095.win.tue.nl /pub/lilypond/development/
-       470k lilypond-0.1.41.tar.gz 
+       470k lilypond-0.1.42.tar.gz 
 Copying-policy: GPL
 End
index 1ba3275d60e1a7259ce74064ae418f3b155b4914..506988b49d1e50272026654d0551e2830c2c369b 100644 (file)
@@ -1,9 +1,9 @@
 Name: lilypond
-Version: 0.1.41
+Version: 0.1.42
 Release: 1
 Copyright: GPL
 Group: Applications/Publishing
-Source0: alpha.gnu.org:/gnu/lilypond/development/lilypond-0.1.41.tar.gz
+Source0: alpha.gnu.org:/gnu/lilypond/development/lilypond-0.1.42.tar.gz
 Summary: A program for typesetting music.
 URL: http://www.stack.nl/~hanwen/lilypond
 Packager: Han-Wen Nienhuys <hanwen@stack.nl>
@@ -30,7 +30,7 @@ strip lily/out/lilypond mi2mu/out/mi2mu
 make -C Documentation gifs
 make prefix="$RPM_BUILD_ROOT/usr" install
 %files
-%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README
+%doc Documentation/out/AUTHORS.text Documentation/out/CodingStyle.text Documentation/out/INSTALL.text Documentation/out/MANIFESTO.text Documentation/out/convert-mudela.text Documentation/out/faq.text Documentation/out/gnu-music.text Documentation/out/index.text Documentation/out/internals.text Documentation/out/language.text Documentation/out/lilypond.text Documentation/out/links.text Documentation/out/literature.text Documentation/out/ly2dvi.text Documentation/out/mi2mu.text Documentation/out/mudela-book.text Documentation/out/mutopia.text Documentation/out/other-packages.text BUGS TODO NEWS DEDICATION ANNOUNCE README
 %doc input/beams.ly input/cadenza.ly input/collisions.ly input/coriolan-alto.ly input/font-body.ly input/font.ly input/font11.ly input/font13.ly input/font16.ly input/font20.ly input/font26.ly input/gallina.ly input/gallina.tex input/gourlay.ly input/keys.ly input/kortjakje.ly input/multi.ly input/pedal.ly input/rhythm.ly input/scales.ly input/scripts.ly input/scsii-menuetto.ly input/scsii-menuetto.tex input/sleur.ly input/slurs.ly input/spacing.ly input/standchen-16.ly input/standchen-16.tex input/standchen-20.ly input/standchen-20.tex input/standchen.ly input/standje.ly input/stem.ly input/toccata-fuga-E.ly input/twinkle-pop.ly input/twinkle.ly input/wtk1-fugue1.ly input/wtk1-fugue2.ly input/wtk1-prelude1.ly Documentation/mudela-course.doc Documentation/mudela-man.doc 
 %doc Documentation/out/lelie_logo.gif
 /usr/bin/convert-mudela