From: Han-Wen Nienhuys Date: Thu, 28 Oct 2004 08:22:00 +0000 (+0000) Subject: (LY_DEFINE): add ly:stencil-origin X-Git-Tag: release/2.3.25~3 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=a6a63d43762b71bb1f0b5ea5f70eb8fcf4dcce5e;p=lilypond.git (LY_DEFINE): add ly:stencil-origin --- diff --git a/ChangeLog b/ChangeLog index cee8330a6a..287af839fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-10-28 Han-Wen Nienhuys + + * lily/stencil-scheme.cc (LY_DEFINE): add ly:stencil-origin + 2004-10-28 Werner Lemberg * Documentation/user/music-glossary.tely: More fixes to improve diff --git a/lily/stencil-scheme.cc b/lily/stencil-scheme.cc index 310bb5a176..ccf7e37ebd 100644 --- a/lily/stencil-scheme.cc +++ b/lily/stencil-scheme.cc @@ -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), diff --git a/lily/stencil.cc b/lily/stencil.cc index 25215052e1..4b642e596a 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -316,3 +316,4 @@ LY_DEFINE (ly_interpret_stencil_expression, "ly:interpret-stencil-expression", return SCM_UNSPECIFIED; } + diff --git a/scripts/etf2ly.py b/scripts/etf2ly.py index c4627a611d..599ddfccb3 100644 --- a/scripts/etf2ly.py +++ b/scripts/etf2ly.py @@ -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) diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index 2ce6fa70fa..c92451dcc5 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -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' diff --git a/scripts/mup2ly.py b/scripts/mup2ly.py index b7d2d0850e..98ba97c589 100644 --- a/scripts/mup2ly.py +++ b/scripts/mup2ly.py @@ -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: