Expose melisma/hyphenation info to plugins

• Feb 1, 2016 - 21:26

After a quick session with MarcSabatella about this, I(/we)'d like to hear opinions/preferences from other developers and/or plugin developers:

The easy-and-obvious route:
Expose ticks() and isMelisma(). Combining the latter with the already exposed syllabic provides one with all the needed info.
--- is found because syllabic == START||MIDDLE and isMelisma == true
___ is detected because syllabic == SINGLE||END and isMelisma == true, in that case the duration of the melisma can be found reading ticks

The alternative QML-only-property route:
Expose a property called melismaDuration which would return the value of ticks if it is an ending melisma (see conditions above), otherwise it would return 0
___ is detected by reading a melismaDuration != 0
--- is implied by having syllabic == START||MIDDLE and no lyric-text on the next note/segment(s)

Marc prefers the first method, as it stays close to the actual data structure and member functions.
The second proposition was what I originally came up with in the mindset of 'not simply throwing all internals out there'


Comments

Reading back the summary I just now wrote, there is one big advantage to the bare-exposing approach that jumps into my mind:
Originally I only thought of these properties as read-only with regards to the plugin framework, but when they are/should become writable as well, staying closer to the actual structure greatly simplifies that implementation wise.

This puts the 'vote' at +2 for simple exposure vs 0 for my own property-proposition…
Still other points of view/agreement are very welcome before I spend PR-time

If the melismaDuration() function seems generally useful (not just for your paritcular application), then it seems adding it to the Lyrics class makes sense, and then exposing it as well as the other two. But the other two definitely exist already and should probably be exposed in my opinion.

Do you still have an unanswered question? Please log in first to post your question.