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

Cannot access RewindMode enum #22505

Closed
looptailG opened this issue Apr 20, 2024 · 6 comments
Closed

Cannot access RewindMode enum #22505

looptailG opened this issue Apr 20, 2024 · 6 comments

Comments

@looptailG
Copy link

Issue type

UX/Interaction bug (incorrect behaviour)

Bug description

When writing a plugin for Musescore and trying to use the enum RewindMode from the Cursor class, you get the following error message (or similar error messages, depending on which enum value you're trying to access):

14:-1: TypeError: Cannot read property 'SCORE_START' of undefined

ExampleFiles.zip

Steps to reproduce

  1. Open any file in Musescore.
  2. Run the example plugin atteched to the bug description section.
  3. You will get the following error message: Cannot read property 'SELECTION_START' of undefined

Screenshots/Screen recordings

No response

MuseScore Version

4.2.1-240230937

Regression

No.

Operating system

Windows 10

Additional context

Link to the original discussion on the forum.

@XiaoMigros
Copy link
Contributor

This is not the correct way to use the enum: Cursor.SCORE_START or Cursor.SELECTION_START work in 3.x and 4.x

@looptailG
Copy link
Author

Indeed, that way it works.

I guess we misunderstood how it works, from the documentation it seemed like you had to call it with Cursor.RewindMode.SCORE_START.

@XiaoMigros
Copy link
Contributor

A better way than the documentation is to look at existing plugins (for example, my github profile) :)

@looptailG
Copy link
Author

I'll definitely keep this in mind, thanks for the help.

@Jojo-Schmitz
Copy link
Contributor

Oops, I guess then this issue can get closes

@looptailG looptailG closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
@Jojo-Schmitz
Copy link
Contributor

There is another problem though: feeding invalid stuff as an argument to rewind() seems to be getting ignored entirely (and seem to result in 0 resp. Cursor.SCORE_START being taken).

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

No branches or pull requests

4 participants