]> git.donarmstrong.com Git - lilypond.git/commitdiff
(LY_DEFINE): add ly:stencil-origin
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 28 Oct 2004 08:22:00 +0000 (08:22 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 28 Oct 2004 08:22:00 +0000 (08:22 +0000)
ChangeLog
lily/stencil-scheme.cc
lily/stencil.cc
scripts/etf2ly.py
scripts/midi2ly.py
scripts/mup2ly.py

index cee8330a6a4b1f3576c1d7755c69f11aca418f37..287af839fdccb12cec7fe586e65289daf56e4d40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-10-28  Han-Wen Nienhuys  <hanwen@xs4all.nl>
+
+       * lily/stencil-scheme.cc (LY_DEFINE): add ly:stencil-origin
+
 2004-10-28  Werner Lemberg  <wl@gnu.org>
 
        * Documentation/user/music-glossary.tely: More fixes to improve
index 310bb5a1766e2a69a1f4ad6eb3f435bc1db131b0..ccf7e37ebd54122ecf687a2af9ef53209a0c2c27 100644 (file)
@@ -86,6 +86,20 @@ LY_DEFINE (ly_stencil_get_extent, "ly:stencil-extent",
   return ly_interval2scm (s->extent (Axis (scm_to_int (axis))));
 }
 
+
+LY_DEFINE (ly_stencil_origin, "ly:stencil-origin",
+          2, 0, 0, (SCM stil, SCM axis),
+          "Return a pair of numbers signifying the origin @var{stil} in "
+          "@var{axis} direction (0 or 1 for x and y axis respectively).")
+{
+  Stencil *s = unsmob_stencil (stil);
+  SCM_ASSERT_TYPE (s, stil, SCM_ARG1, __FUNCTION__, "stencil");
+  SCM_ASSERT_TYPE (is_axis (axis), axis, SCM_ARG2, __FUNCTION__, "axis");
+
+  return scm_from_double (s->origin()[Axis (scm_to_int (axis))]);
+}
+
+
 LY_DEFINE (ly_stencil_moved_to_edge, "ly:stencil-moved-to-edge",
           4, 2, 0, (SCM first, SCM axis, SCM direction, SCM second,
                     SCM padding, SCM minimum),
index 25215052e166fdc8960e81534d2227fe83baac89..4b642e596a98804b45c55f2fe14d801ef9e66c25 100644 (file)
@@ -316,3 +316,4 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression",
 
   return SCM_UNSPECIFIED;
 }
+
index c4627a611d41efca94e003d30a0bdae7e8f174d0..599ddfccb3e101befb84745873ad55c940a93ea0 100644 (file)
@@ -579,7 +579,7 @@ class Staff:
                                if 'stop' in g.repeats:
                                        k = k + ' \\bar ":|" '
                                
-               k = '%sglobal = \\notes  { %s }\n\n ' % (self.staffid (), k)
+               k = '%sglobal = { %s }\n\n ' % (self.staffid (), k)
                return k
        
        def dump (self):
@@ -618,7 +618,7 @@ class Staff:
                                                        % (self.number, m.number))
                        if first_frame:
                                l = self.layerid (x)
-                               laystr = '%s =  \\notes { { %s } }\n\n' % (l, laystr)
+                               laystr = '%s = { { %s } }\n\n' % (l, laystr)
                                str = str  + laystr
                                layerids.append (l)
 
index 2ce6fa70fa6f511fc9a5ac20904b720cb967ae46..c92451dcc59edcc2ba3cc7765827cff2689dcc18 100644 (file)
@@ -891,7 +891,7 @@ def dump_track (channels, n):
 
                if item and item.__class__ == Note:
                        skip = 's'
-                       s = s + '%s = \\notes' % (track + channel)
+                       s = s + '%s = ' % (track + channel)
                        if not absolute_p:
                                s = s + '\\relative c '
                elif item and item.__class__ == Text:
@@ -899,8 +899,7 @@ def dump_track (channels, n):
                        s = s + '%s = \\lyricmode ' % (track + channel)
                else:
                        skip = '\\skip '
-                       # must be in \notes mode for parsing \skip
-                       s = s + '%s = \\notes ' % (track + channel)
+                       s = s + '%s =  ' % (track + channel)
                s = s + '{\n'
                s = s + '  ' + dump_channel (channels[i][0], skip)
                s = s + '}\n\n'
index b7d2d0850e98e448308f129ab5bad12bad30e8eb..98ba97c5892d72173b84ae235f522615112f4d0d 100644 (file)
@@ -524,7 +524,7 @@ class Voice:
                str = str  + ln
                id = self.idstring ()
                        
-               str = '''%s = \\context Voice = %s \\notes {
+               str = '''%s = \\context Voice = %s {
 %s
 }
 
@@ -566,9 +566,9 @@ class Key:
                if self.sharps and self.flats:
                        k = '\\keysignature %s ' % 'TODO'
                elif self.sharps:
-                       k = '\\notes\\key %s \major' % key_sharps[self.sharps]
+                       k = '\\key %s \major' % key_sharps[self.sharps]
                elif self.flats:
-                       k = '\\notes\\key %s \major' % key_flats[self.flats]
+                       k = '\\key %s \major' % key_flats[self.flats]
                return k
 
 class Time: