Skip to content

Commit d84d0ea

Browse files
authored
Merge pull request #50 from orchetect/dev
Dev merge
2 parents 5f9917f + 96e13e9 commit d84d0ea

File tree

4 files changed

+18
-298
lines changed

4 files changed

+18
-298
lines changed

Sources/MIDIKit/Common/Utilities/DataReader.swift

Lines changed: 0 additions & 76 deletions
This file was deleted.

Sources/MIDIKit/Events/Event/System Exclusive/SysEx/SysEx.swift

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,14 @@ extension MIDI.Event {
5757
extension MIDI.Event.SysEx {
5858

5959
@inline(__always)
60-
public func midi1RawBytes() -> [MIDI.Byte] {
60+
public func midi1RawBytes(
61+
leadingF0: Bool = true,
62+
trailingF7: Bool = true
63+
) -> [MIDI.Byte] {
6164

62-
[0xF0] + manufacturer.bytes + data + [0xF7]
65+
(leadingF0 ? [0xF0] : [])
66+
+ manufacturer.bytes + data
67+
+ (trailingF7 ? [0xF7] : [])
6368

6469
}
6570

Sources/MIDIKit/Events/Event/System Exclusive/UniversalSysEx/UniversalSysEx.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,18 @@ extension MIDI.Event {
7171
extension MIDI.Event.UniversalSysEx {
7272

7373
@inline(__always)
74-
public func midi1RawBytes() -> [MIDI.Byte] {
74+
public func midi1RawBytes(
75+
leadingF0: Bool = true,
76+
trailingF7: Bool = true
77+
) -> [MIDI.Byte] {
7578

76-
[0xF0,
77-
MIDI.Byte(universalType.rawValue),
78-
deviceID.uInt8Value,
79-
subID1.uInt8Value,
80-
subID2.uInt8Value]
81-
+ data
82-
+ [0xF7]
79+
(leadingF0 ? [0xF0] : [])
80+
+ [MIDI.Byte(universalType.rawValue),
81+
deviceID.uInt8Value,
82+
subID1.uInt8Value,
83+
subID2.uInt8Value]
84+
+ data
85+
+ (trailingF7 ? [0xF7] : [])
8386

8487
}
8588

Tests/MIDIKitTests/Common/Utilities/DataReader Tests.swift

Lines changed: 0 additions & 212 deletions
This file was deleted.

0 commit comments

Comments
 (0)