]> git.donarmstrong.com Git - lilypond.git/commitdiff
partial: 0.1.61.jcn
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 3 May 1998 23:33:15 +0000 (01:33 +0200)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 3 May 1998 23:33:15 +0000 (01:33 +0200)
lily/encompass-info.cc [new file with mode: 0644]
lily/include/encompass-info.hh [new file with mode: 0644]

diff --git a/lily/encompass-info.cc b/lily/encompass-info.cc
new file mode 100644 (file)
index 0000000..193ef48
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+  encompass-info.cc -- implement Encompass_info
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <jan@digicash.com>
+
+*/
+
+#include "proto.hh"
+#include "stem.hh"
+#include "note-column.hh"
+#include "paper-def.hh"
+#include "encompass-info.hh"
+
+Encompass_info::Encompass_info ()
+{
+  assert (0);
+}
+
+Encompass_info::Encompass_info (Note_column const* note, Direction dir)
+{
+  Paper_def* paper = note->paper ();
+  Real interline = paper->interline_f ();
+  Real notewidth = paper->note_width ();
+  Real internote = interline / 2;
+
+  Stem* stem = note->stem_l_;
+  /* 
+    set o_.x () to middle of notehead or on eo_.x ()act o_.x () position of stem,
+    according to slur direction
+       */
+  o_.x () = stem->hpos_f ();
+
+  if (stem->dir_ != dir)
+    {
+      o_.x () += 0.5 * notewidth;
+      // ugh
+      if (dir == DOWN)
+       o_.x () -= 0.5 * notewidth;
+      else
+       o_.x () += 0.5 * notewidth;
+    }
+  else if (stem->dir_ == UP)
+    o_.x () += 1.0 * notewidth;
+
+//  o_.x () -= left_o_.x ();
+
+  o_.y () = stem->height ()[dir];
+
+  /*
+    leave a gap: slur mustn't touch head/stem
+   */
+  if (stem->dir_ != dir)
+    o_.y () += 3.0 * internote * dir;
+  else
+    o_.y () += 2.0 * internote * dir;
+
+  // ugh
+  if (dir == DOWN)
+    o_.y () += 1.5 * internote * dir;
+
+//  o_.y () -= left_o_.y ();
+}
+
diff --git a/lily/include/encompass-info.hh b/lily/include/encompass-info.hh
new file mode 100644 (file)
index 0000000..6180ba3
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+  encompass-info.hh -- declare Encompass_info
+
+  source file of the GNU LilyPond music typesetter
+
+  (c) 1998 Jan Nieuwenhuizen <jan@digicash.com>
+
+*/
+
+#ifndef ENCOMPASS_INFO_HH
+#define ENCOMPASS_INFO_HH
+
+#include "lily-proto.hh"
+#include "direction.hh"
+#include "offset.hh"
+
+struct Encompass_info
+{
+  Encompass_info ();
+  Encompass_info (Note_column const*, Direction);
+
+  Offset o_;
+};
+
+#endif // ENCOMPASS_INFO_HH