lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enabling item-interface


From: Carl D. Sorensen
Subject: Enabling item-interface
Date: Mon, 2 Mar 2009 21:05:29 -0700

I'm working to enable the chordChanges property for a FretBoards object.

I've changed the fretboard-engraver to keep track of the last fretboard,
using the chord-name-engraver as a model.  I've verified that the code works
to keep track of the changes in the fretboards.

Here's the relevant code from fretboard-engraver.

  SCM changes = get_property("chordChanges");
  if (to_boolean (changes) && scm_is_pair(last_fret_notes_)
      && ly_is_equal (last_fret_notes_, fret_notes))
    fret_board_->set_property ("begin-of-line-visible", SCM_BOOL_T);

I've added the item-interface to the fretboard grob:

   (FretBoard
     . ((stencil . ,fret-board::calc-stencil)
        (fret-diagram-details . ((finger-code . below-string)))
        (meta . ((class . Item)
                 (interfaces . (fret-diagram-interface
                                rhythmic-grob-interface
                                item-interface
                                font-interface))))))


I've added a bunch of engravers to the FretBoards context, again, copied
from the ChordNames context:

\context {
  \type "Engraver_group"
  \name "FretBoards"


  \consists "Axis_group_engraver"
  \consists "Fretboard_engraver"
  \consists "Rest_swallow_translator"
  \consists "Output_property_engraver"
  \consists "Skip_event_swallow_translator"
  \consists "Hara_kiri_engraver"
  \consists "Separating_line_group_engraver"
  \consists "Font_size_engraver"
  \consists "Instrument_name_engraver"

  predefinedDiagramTable = #fretboard-table
}

I have a regression test file:

myChords = \chordmode {
  c1 c1 \break
  c1 c1 \break
  \set chordChanges = ##t
  c1 c1 \break
  c1 c1 \break
}

<<
  \new ChordNames { \myChords }
  \new FretBoards { \myChords }
  \new Staff { \myChords }
>>



Everything compiles fine -- no errors or warnings.

But the identical fretboards still show up in the output.

Can anybody suggest what else I need to do to enable "begin-of-line-visible"
with FretBoards?

Thanks,

Carl                                                                            
     





reply via email to

[Prev in Thread] Current Thread [Next in Thread]