Hi Mike,
thanks for your quick answer!
Am 03.07.2012 21:13, schrieb address@hidden
<mailto:address@hidden>:
[...]
Hey Marc,
If the function is reused three times, you can rewrite it in Scheme.
Sorry for not having picked up on that. You can do a module call-up
as you had suggested before.
I don't get it right, compilation fails
note-spacing.cc: In static member function 'static Spring
Note_spacing::get_spacing(Grob*, Item*, Real, Real)':
note-spacing.cc:96:72: error: no matching function for call to
'Pointer_group_interface::find_grob(Item*&, SCM, bool&)'
note-spacing.cc:96:72: note: candidate is:
./include/pointer-group-interface.hh:36:16: note: static Grob*
Pointer_group_interface::find_grob(Grob*, SCM, bool (*)(Grob*))
./include/pointer-group-interface.hh:36:16: note: no known
conversion for argument 3 from 'bool' to 'bool (*)(Grob*)'
make[1]: *** [out/note-spacing.o] Error 1
This is how I tried to include the bar-line::non-empty-barline
function, defined as
(define-public (bar-line::non-empty-barline grob)
(and (grob::has-interface grob 'bar-line)
(pair? (ly:grob-extent grob grob X))))
diff --git a/lily/note-spacing.cc b/lily/note-spacing.cc
index 4772367..074ad8d 100644
--- a/lily/note-spacing.cc
+++ b/lily/note-spacing.cc
@@ -20,7 +20,6 @@
#include "note-spacing.hh"
#include "accidental-placement.hh"
-#include "bar-line.hh"
#include "directional-element-interface.hh"
#include "grob-array.hh"
#include "moment.hh"
@@ -90,9 +89,11 @@ Note_spacing::get_spacing (Grob *me, Item *right_col,
&& !skys[RIGHT].is_empty ()
&& to_boolean (me->get_property ("space-to-barline")))
{
+ bool non_empty_barline =
+ ly_scm2bool (scm_call_1 (ly_lily_module_constant
("bar-line::non-empty-barline"), right_col->self_scm ()));
Grob *bar = Pointer_group_interface::find_grob (right_col,
ly_symbol2scm
("elements"),
- Bar_line::non_empty_barline);
+ non_empty_barline);
if (bar)
{