-
Notifications
You must be signed in to change notification settings - Fork 117
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
Migrate VexTab to VexFlow 4.0.0. #137
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ class VexTab | |
notation_option = option | ||
throw error("'#{option.key}' must be 'true' or 'false'") if option.value not in ["true", "false"] | ||
when "key" | ||
throw error("Invalid key signature '#{option.value}'") unless _.has(Vex.Flow.keySignature.keySpecs, option.value) | ||
throw error("Invalid key signature '#{option.value}'") unless Vex.Flow.hasKeySignature(option.value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seemed cleaner to have a method called hasKeySignature(), so I added it to VexFlow. |
||
when "clef" | ||
clefs = ["treble", "bass", "tenor", "alto", "percussion", "none"] | ||
throw error("'clef' must be one of #{clefs.join(', ')}") if option.value not in clefs | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,7 +197,7 @@ class VexTabTests | |
|
||
# KEY SIGNATURE TESTS | ||
|
||
for key of Vex.Flow.keySignature.keySpecs | ||
for key of Vex.Flow.getKeySignatures() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similarly, I added a getter here instead of allowing client code to reach into the internals of VexFlow. |
||
assert.notEqual null, tab.parse("tabstave key=" + key) | ||
assert.notEqual null, tab.parse("tabstave notation=true key=" + key) | ||
assert.notEqual null, tab.parse("tabstave notation=true tablature=true key=" + key) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible bug fix? Or did an old version of VexFlow have the arguments reversed? Anyways, it was throwing an exception so I switched the two arguments.