Skip to content

Commit edeca85

Browse files
authored
Add Value MARKs (#228)
* Fix value mark * Fix special case `value` property * Add value script * Add Value MARKs * Clean up MARK usage * Fix Mordent DynamicNodeEncoding * Fix leftovers * Fix PartSymbol implementation
1 parent 6964da3 commit edeca85

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+247
-46
lines changed

Sources/MusicXML/Complex Types/AccidentalText.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct AccidentalText {
2424
public let direction: TextDirection?
2525
public let enclosure: EnclosureShape?
2626

27-
// MARK: Elements
27+
// MARK: Value
2828

2929
public let value: AccidentalValue
3030

Sources/MusicXML/Complex Types/Arrow.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public struct Arrow {
1313

1414
public let kind: Kind
1515
public let placement: AboveBelow?
16-
16+
1717
// MARK: Attribute Groups
1818

1919
public let position: Position

Sources/MusicXML/Complex Types/BarStyleColor.swift

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
public struct BarStyleColor {
1010
// MARK: - Instance Properties
1111

12+
// MARK: Value
13+
1214
public var value: BarStyle
15+
16+
// MARK: Attributes
17+
1318
public var color: Color?
1419

1520
// MARK: - Initializers

Sources/MusicXML/Complex Types/Barre.swift

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
public struct Barre {
1212
// MARK: - Instance Properties
1313

14+
// MARK: Attributes
15+
1416
public let type: StartStop
1517
public let color: Color
1618

Sources/MusicXML/Complex Types/BassAlter.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct BassAlter {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: Double
16+
17+
// MARK: Attributes
18+
1419
public let printObject: Bool?
1520
public let location: LeftRight?
1621

Sources/MusicXML/Complex Types/BassStep.swift

+5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
public struct BassStep {
1313
// MARK: - Instance Properties
1414

15+
// MARK: Value
16+
1517
public let value: Step
18+
19+
// MARK: Attributes
20+
1621
/// The text attribute indicates how the bass should appear in a score if not using the element
1722
/// contents.
1823
public let text: String?

Sources/MusicXML/Complex Types/Beam.swift

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
public struct Beam {
1515
// MARK: - Instance Properties
1616

17+
// MARK: Value
18+
1719
public var value: BeamValue
1820
public var number: BeamLevel?
1921
public var repeater: Bool?

Sources/MusicXML/Complex Types/Beater.swift

+5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@
88
public struct Beater {
99
// MARK: - Instance Properties
1010

11+
// MARK: Value
12+
1113
public let value: BeaterValue
14+
15+
// MARK: Attributes
16+
1217
public let tip: TipDirection?
1318

1419
// MARK: - Initializers

Sources/MusicXML/Complex Types/Creator.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public struct Creator {
1414

1515
public var value: String
1616

17-
// MARK: - Attribtues
17+
// MARK: - Attributes
1818

1919
public var type: String?
2020

Sources/MusicXML/Complex Types/Degree.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public struct Degree {
2727
// MARK: - Initializers
2828

2929
public init(
30-
_ value: DegreeValue,
30+
value: DegreeValue,
3131
alter: DegreeAlter,
3232
type: DegreeType,
3333
printObject: Bool? = nil

Sources/MusicXML/Complex Types/DegreeValue.swift

+5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
public struct DegreeValue {
1414
// MARK: - Instance Properties
1515

16+
// MARK: Value
17+
1618
public let value: Int
19+
20+
// MARK: Attributes
21+
1722
public let symbol: DegreeSymbolValue?
1823
public let text: String?
1924

Sources/MusicXML/Complex Types/Distance.swift

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
public struct Distance {
1010
// MARK: - Instance Properties
1111

12+
// MARK: Value
13+
1214
public let value: Tenths
15+
16+
// MARK: Attributes
17+
1318
public let type: DistanceType
1419

1520
// MARK: - Initializers

Sources/MusicXML/Complex Types/Feature.swift

+5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
public struct Feature {
1212
// MARK: - Instance Properties
1313

14+
// MARK: Value
15+
1416
public let value: String
17+
18+
// MARK: Attributes
19+
1520
public let type: String?
1621

1722
// MARK: - Initializers

Sources/MusicXML/Complex Types/Fingering.swift

+5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
public struct Fingering {
1313
// MARK: - Instance Properties
1414

15+
// MARK: Value
16+
1517
public let value: String
18+
19+
// MARK: Attributes
20+
1621
public let substitution: Bool?
1722
public let alternate: Bool?
1823
public let placement: AboveBelow?

Sources/MusicXML/Complex Types/FirstFret.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct FirstFret {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: Int
16+
17+
// MARK: Attributes
18+
1419
public let text: String?
1520
public let location: LeftRight?
1621

Sources/MusicXML/Complex Types/Font.swift

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ public struct Font {
2323
// FIXME: Font.family should be `CommaSeparatedText`
2424
public let family: String?
2525

26-
2726
// MARK: Attribute Groups
2827

2928
public let style: FontStyle?

Sources/MusicXML/Complex Types/Fret.swift

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ public struct Fret {
1616

1717
// MARK: Attributes
1818

19-
// MARK: Attributes
20-
2119
public let color: Color?
2220

2321
// MARK: Attribute Groups

Sources/MusicXML/Complex Types/Glissando.swift

+5
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
public struct Glissando {
1313
// MARK: - Instance Properties
1414

15+
// MARK: Value
16+
1517
public let value: String
18+
19+
// MARK: Attributes
20+
1621
public let type: StartStop
1722
public let number: Int?
1823
public let lineType: LineType?

Sources/MusicXML/Complex Types/GroupBarline.swift

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
public struct GroupBarline {
1010
// MARK: - Instance Properties
1111

12+
// MARK: Value
13+
1214
public var value: GroupBarlineValue
15+
16+
// MARK: Attributes
17+
1318
public var color: Color?
1419

1520
// MARK: - Initializers

Sources/MusicXML/Complex Types/GroupName.swift

+5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
public struct GroupName {
1212
// MARK: - Instance Properties
1313

14+
// MARK: Value
15+
1416
public let value: String
17+
18+
// MARK: Attributes
19+
1520
public let justify: Justify?
1621

1722
// MARK: Attribute Groups

Sources/MusicXML/Complex Types/GroupSymbol.swift

+5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ import XMLCoder
1111
public struct GroupSymbol {
1212
// MARK: - Instance Properties
1313

14+
// MARK: Value
15+
1416
public var value: GroupSymbolValue
17+
18+
// MARK: Attributes
19+
1520
public var color: Color?
1621

1722
// MARK: Attribute Groups

Sources/MusicXML/Complex Types/HammerOnPullOff.swift

+5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@
1313
public struct HammerOnPullOff {
1414
// MARK: - Instance Properties
1515

16+
// MARK: Value
17+
1618
public let value: String
19+
20+
// MARK: Attributes
21+
1722
public let type: StartStop
1823
public let number: Int?
1924
public let placement: AboveBelow?

Sources/MusicXML/Complex Types/Handbell.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct Handbell {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: HandbellValue
16+
17+
// MARK: Attributes
18+
1419
public let placement: AboveBelow?
1520

1621
// MARK: Attribute Groups

Sources/MusicXML/Complex Types/HoleClosed.swift

+5
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
public struct HoleClosed {
1010
// MARK: - Instance Properties
1111

12+
// MARK: Value
13+
1214
public let value: HoleClosedValue
15+
16+
// MARK: Attributes
17+
1318
/// The optional location attribute indicates which portion of the hole is filled in when the
1419
/// element value is half.
1520
public let location: HoleClosedLocation?

Sources/MusicXML/Complex Types/Key.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public struct Key {
2323

2424
public let kind: Kind
2525
public let keyOctaves: [KeyOctave]
26-
26+
2727
// MARK: Attribute Groups
2828

2929
public let printStyle: PrintStyle
30-
30+
3131
// MARK: - Initializers
3232

3333
public init(number: Int? = nil, printStyle: PrintStyle = PrintStyle(), printObject: Bool? = nil, kind: Kind, keyOctaves: [KeyOctave] = []) {

Sources/MusicXML/Complex Types/LineWidth.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct LineWidth {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: Tenths
16+
17+
// MARK: Attributes
18+
1419
public let type: LineWidthType
1520

1621
// MARK: - Initializers

Sources/MusicXML/Complex Types/MIDIDevice.swift

+5
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ import XMLCoder
1313
public struct MIDIDevice {
1414
// MARK: - Instance Properties
1515

16+
// MARK: Value
17+
1618
public var value: String?
19+
20+
// MARK: Attributes
21+
1722
/// The optional port attribute is a number from 1 to 16 that can be used with the unofficial
1823
/// MIDI port (or cable) meta event.
1924
public var port: Int?

Sources/MusicXML/Complex Types/MeasureNumbering.swift

+2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
public struct MeasureNumbering {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: MeasureNumberingValue
1416

1517
// MARK: Attribute Groups

Sources/MusicXML/Complex Types/MetronomeBeam.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct MetronomeBeam {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: BeamValue
16+
17+
// MARK: Attributes
18+
1419
public let number: BeamLevel?
1520

1621
// MARK: - Initializers

Sources/MusicXML/Complex Types/MetronomeTuplet.swift

+5
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@
1010
public struct MetronomeTuplet {
1111
// MARK: - Instance Properties
1212

13+
// MARK: Value
14+
1315
public let value: TimeModification
16+
17+
// MARK: Attributes
18+
1419
public let type: StartStop
1520
public let bracket: Bool?
1621
public let showNumber: ShowTuplet?

Sources/MusicXML/Complex Types/Mordent.swift

+1-7
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ extension Mordent: Codable {
4141
case long
4242
case approach
4343
case departure
44-
case value = ""
4544
}
4645

4746
// MARK: Encodable
@@ -68,11 +67,6 @@ extension Mordent: Codable {
6867
import XMLCoder
6968
extension Mordent: DynamicNodeEncoding {
7069
public static func nodeEncoding(for key: CodingKey) -> XMLEncoder.NodeEncoding {
71-
switch key {
72-
case CodingKeys.value:
73-
return .element
74-
default:
75-
return .attribute
76-
}
70+
return .attribute
7771
}
7872
}

Sources/MusicXML/Complex Types/Notations.swift

+3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ public struct Notations {
2222

2323
public var footnote: FormattedText?
2424
public var level: Level?
25+
26+
// MARK: Value
27+
2528
public var values: [Notation]
2629

2730
// MARK: - Initializers

Sources/MusicXML/Complex Types/NoteSize.swift

+5
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@
1414
public struct NoteSize {
1515
// MARK: - Instance Properties
1616

17+
// MARK: Value
18+
1719
// FIXME: Use `NonNegativeDecimal` if that is wise.
1820
public let value: Double
21+
22+
// MARK: Attributes
23+
1924
public let type: NoteSizeType
2025

2126
// MARK: - Initializers

0 commit comments

Comments
 (0)