wbsoft/frescobaldi — Issue #6: wish: more extensive snippet api
Author: wbsoft
Created: 2011-11-19 19:46:13+00:00
State: open

(sumbitted by Nicolas M) via the frescobaldi mailinglist)

I'd like for example moving the cursor to the next/previous note with
keyboard shortcuts. but I think it's not currently possible.
it would be nice to provide a custom mode with access to QPlainTextEdit
to provide the method setTextCursor.
and/or, better yet, create a small API with methods to facilitate access
to QTextDocument like jedit:
http://www.jedit.org/api/org/gjt/sp/jedit/textarea/TextArea.html.
This will facilitate access to people who are not familiar with Python
and PyQt.

you could create methods like:
goToNextNote
goToPreviousNote
goToNextMeasure
goToNextLine
moveCursorPosition
insertText
setSelectedText
...

and facilitate access to modules "music.py" and "tokeniter.py"
getNotesInBlock
getNoteAfterCursor
getTokensInBlock
isChordAt
getTimeSignatureAt
...

it would be nice also to provide a debug mode with a console, to use
"print" in the code or create a "print" method which sends an event to
this console.
this is already possible by running frescobaldi in a console, but it is
not practical.

you could also eventually create a database, allowing users to share
snippets.