Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin API: alter Cursor API for better usage in interactive plugins #5657

Merged
merged 6 commits into from
Apr 22, 2020

Conversation

dmitrio95
Copy link
Contributor

This PR implements changes in Cursor API which could be useful for interactive plugins functioning. The most important of the proposed changes is to allow plugins explicitly choose whether Cursor actions (changing its position, adding notes) should influence score input state. It is proposed to make it independent of score input state by default while still offering an option of full synchronization of Cursor state with score input state (which hasn't been possible before). This should allow plugins to make use of onScoreStateChanged handler to modify score editing process while not breaking note input cursor behavior and even potentially co-existing with other plugins which might use Cursor in either mode as well (see this discussion for a possible example: dmitrio95/fretboard-plugin#1).

Other changes are less important but could still be useful:

  • include convenience API for rewinding cursor to a particular tick (otherwise plugins would just implement the logic similar to Score::tick2segment());
  • ensure that endCmd() does always get called once on undo/redo actions to make sure that plugins are always properly notified of undo/redo changes. This may be useful to prevent unwanted plugin-originated changes on undo/redo actions.
  • add Cursor.stringNumber property for better integration with tablature note input.

This PR also contains an interactive version of Note Names plugin to demonstrate some basic usage of this framework. I planned to create it after #5626, but it turned out to be problematic to create something fully usable before decoupling Cursor state from input state in Score. Other changes in this PR also make implementation of this plugin simpler.

@Jojo-Schmitz
Copy link
Contributor

Jojo-Schmitz commented Feb 7, 2020

As mentioned briefly on FOSDEM, that interactive note names plugin doesn't work well in the dark theme

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants