dn-m / MusicXML

Implementation of the musicXML specification in Swift
MIT License
74 stars 20 forks source link

Enable decoding position and unpitched notes #102

Closed DJBen closed 5 years ago

DJBen commented 5 years ago

This PR enables position decoding and fixes unpitched notes decoding.

Because of the nature of how positions are decoded, the decoder is passed to the position initializer directly to decode the defaultX, defaultY, relativeX and relativeY. If all four are nil, the Position will be empty of any properties but not nil.

Thus for structs that have positions, I provide a default initializer let position: Position = Position().

codecov-io commented 5 years ago

Codecov Report

Merging #102 into latest will increase coverage by 1.15%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           latest     #102      +/-   ##
==========================================
+ Coverage   44.14%   45.29%   +1.15%     
==========================================
  Files          47       48       +1     
  Lines        1323     1349      +26     
==========================================
+ Hits          584      611      +27     
+ Misses        739      738       -1
Impacted Files Coverage Δ
Sources/MusicXML/Complex Types/Note.swift 77.77% <100%> (+6.86%) :arrow_up:
Sources/MusicXML/Simple Types/Tenths.swift 70% <100%> (+20%) :arrow_up:
Sources/MusicXML/Complex Types/Stem.swift 100% <100%> (ø)
...es/MusicXML/Complex Types/PitchUnpitchedRest.swift 47.05% <0%> (+5.88%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c781f2c...4b30168. Read the comment docs.

jsbean commented 5 years ago

Cool, I am going to test this against this PR on XMLCoder, just in case there is any relation here.