Update callers.
* lily/context-scheme.cc (ly:context-now): Move from translator.
Update callers.
+2005-04-21 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily/translator-scheme.cc (ly:translator-property): Remove.
+ Update callers.
+
+ * lily/context-scheme.cc (ly:context-now): Move from translator.
+ Update callers.
+
2005-04-21 Han-Wen Nienhuys <hanwen@xs4all.nl>
* input/regression/grid-lines.ly (skips): refine example.
* input/regression/grid-lines.ly (Module): new file.
- * lily/grid-point-engraver.cc (Module): new file
+ * lily/grid-point-engraver.cc (Module): new file.
* lily/grid-line.cc (Module): new file.
Auto_beam_engraver::test_moment (Direction dir, Moment test)
{
return scm_call_3 (get_property ("autoBeamCheck"),
- self_scm (),
+ context ()->self_scm (),
scm_from_int (dir),
test.smobbed_copy ())
!= SCM_BOOL_F;
return SCM_BOOL_F;
}
+LY_DEFINE (ly_context_now, "ly:context-now",
+ 1, 0, 0, (SCM context),
+ "Return now-moment of context CONTEXT")
+{
+ Context *ctx = unsmob_context (context);
+ SCM_ASSERT_TYPE (ctx, context, SCM_ARG1, __FUNCTION__, "Context");
+ return ctx->now_mom ().smobbed_copy ();
+}
*/
+#include "grid-line-interface.hh"
+
+#include "grob.hh"
#include "group-interface.hh"
+#include "lookup.hh"
#include "output-def.hh"
#include "stencil.hh"
-#include "lookup.hh"
-#include "grid-line-interface.hh"
-#include "grob.hh"
MAKE_SCHEME_CALLBACK (Grid_line_interface, print, 1);
ADD_INTERFACE (Grid_point_interface, "grid-point-interface",
"A spanning point for grid lines. ",
"");
-
return ly_symbol2scm (nm);
}
-LY_DEFINE (ly_translator_now, "ly:translator-now",
- 1, 0, 0, (SCM trans),
- "Return now-moment of translater TRANS")
-{
- Translator *tr = unsmob_translator (trans);
- SCM_ASSERT_TYPE (tr, trans, SCM_ARG1, __FUNCTION__, "Translator");
- return tr->now_mom ().smobbed_copy ();
-}
-
LY_DEFINE (ly_translator_description, "ly:translator-description",
1, 0, 0, (SCM me),
"Return an alist of properties of translator @var{me}.")
return tr->translator_description ();
}
-LY_DEFINE (ly_translator_property, "ly:translator-property",
- 2, 0, 0, (SCM translator, SCM sym),
- "Return the value of a value in translator @var{g} of property @var{sym}. "
- "It will return @code{' ()} (end-of-list) "
- "if @var{sym} is undefined in @var{g}."
- "\n\n")
-{
- Translator *sc = unsmob_translator (translator);
- SCM_ASSERT_TYPE (sc, translator, SCM_ARG1, __FUNCTION__, "translator");
- SCM_ASSERT_TYPE (scm_is_symbol (sym), sym, SCM_ARG2, __FUNCTION__, "symbol");
-
- return sc->internal_get_property (sym);
-}
-
int
Translator::print_smob (SCM s, SCM port, scm_print_state *)
{
;; 4. exceptions for specific time signature
;; 5. easy catch-all rule for non-specified measure types
-(define-public (default-auto-beam-check translator dir test)
+(define-public (default-auto-beam-check context dir test)
(define (get name default)
- (let ((value (ly:translator-property translator name)))
+ (let ((value (ly:context-property context name)))
(if (not (null? value)) value default)))
- (if (!= (ly:moment-grace-numerator (ly:translator-now translator)) 0)
+ (if (!= (ly:moment-grace-numerator (ly:context-now context)) 0)
;; No auto beaming for grace notes
#f
(let* ((beat-length (get 'beatLength (ly:make-moment 1 1)))