music-encoding / sibmei

Sibelius MEI Plugin
MIT License
40 stars 16 forks source link

Rework text, symbol and line handlers #222

Closed th-we closed 6 months ago

th-we commented 7 months ago

This pull requests makes handling of text, symbols and lines work the same way. Specifically, we can get rid of the double bookkeeping for symbols, and we can use templates for text objects now, adding text in a declarative way. This also should make it simpler to create extensions, even for people with very limited coding experience.

The declarative text feature made a breaking change in the API necessary because MeiFactory() needed a second argument. I took this as a chance to rework the API and make it easier to document and (hopefully) to use and maintain. It now works with fewer methods. Additionally, I changed all the related "internal" code to work the same way and use the same names, so documentation applies to both extensions and internal code and should be pretty thorough now.

Old extensions should still work - they are passed a legacy version of the API. (Would be interesting to know if there actually are any such extensions out there apart from the 2-3 I've written myself.)