Skip to content
Discussion options

You must be logged in to vote

The second parameter of AlphaTabApi accepts alphaTab.json.SettingsJson | alphaTab.Settings. SettingsJson is a more flexible format accepting the strict types but also some flavors like strings.

https://github.com/CoderLine/alphaTab/blob/develop/src/generated/SettingsJson.ts#L31
https://github.com/CoderLine/alphaTab/blob/develop/src/generated/DisplaySettingsJson.ts#L157
https://github.com/CoderLine/alphaTab/blob/develop/src/generated/RenderingResourcesJson.ts#L110
https://github.com/CoderLine/alphaTab/blob/develop/src/model/Color.ts#L11

In your case the cast is the problem. Settings is really a class which has to be constructed, casting a plain object to Settings is not correct.

SettingsJson

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@orrymr
Comment options

Answer selected by Danielku15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants