dn-m / MusicXML

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

[WIP] Add nice APIs for Key and Time #74

Closed jsbean closed 5 years ago

jsbean commented 5 years ago

The Key and Time types can each represent one of a couple known kinds.

Instead of having to initialize Key and Time with the Kind directly, this PR adds multiple initializers that cut directly to defining the Kind.

For example, now you can define a Time element like this:

let _ = Time(4,4)
let _ = Time(3, 16, staff: 3)

or

let _ = Time(symbol: "XXX")