#include "stem.hh"
#include "stream-event.hh"
#include "text-interface.hh"
+#include "rhythmic-head.hh"
/*
Note_head::brew_ez_stencil (SCM smob)
{
Grob *me = unsmob_grob (smob);
- int log = Note_head::get_balltype (me);
+ int log = Rhythmic_head::duration_log (me);
SCM cause = me->get_property ("cause");
SCM spitch = unsmob_stream_event (cause)->get_property ("pitch");
{
Grob_info info = primitives[i];
Item *primitive = dynamic_cast<Item *> (info.grob ());
- int duration_log = Note_head::get_balltype (primitive);
+ int duration_log = Rhythmic_head::duration_log (primitive);
Stream_event *nr = info.event_cause ();
nd->get_property ("style")))
merge_possible = false;
- int upball_type = Note_head::get_balltype (nu);
- int dnball_type = Note_head::get_balltype (nd);
+ int upball_type = Rhythmic_head::duration_log (nu);
+ int dnball_type = Rhythmic_head::duration_log (nd);
/* Do not merge whole notes (or longer, like breve, longa, maxima). */
if (merge_possible && (upball_type <= 0 || dnball_type <= 0))
return ly_offset2scm (get_stem_attachment (fm, key));
}
-int
-Note_head::get_balltype (Grob *me)
-{
- SCM s = me->get_property ("duration-log");
- return scm_is_number (s) ? min (int (scm_to_int (s)), 2) : 0;
-}
ADD_INTERFACE (Note_head, "note-head-interface",
"Note head",
(Stem
. (
(direction . ,ly:stem::calc-direction)
- (duration-log . ,note-head::calc-duration-log)
+ (duration-log . ,stem::calc-duration-log)
(default-direction . ,ly:stem::calc-default-direction)
(stem-end-position . ,ly:stem::calc-stem-end-position)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; note heads
-(define-public (note-head::calc-duration-log grob)
+
+(define-public (stem::calc-duration-log grob)
(ly:duration-log
(ly:event-property (event-cause grob) 'duration)))
+(define-public (note-head::calc-duration-log grob)
+ (min 2
+ (ly:duration-log
+ (ly:event-property (event-cause grob) 'duration))))
+
(define-public (dots::calc-dot-count grob)
(ly:duration-dot-count
(ly:event-property (event-cause grob) 'duration)))