Skip to content

Commit

Permalink
Merge pull request #72 from orchetect/dev-addremove-connections
Browse files Browse the repository at this point in the history
Dev merge
  • Loading branch information
orchetect authored Feb 28, 2022
2 parents 7c18de6 + 5a0b5f2 commit e767c38
Show file tree
Hide file tree
Showing 73 changed files with 1,794 additions and 819 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@
repositoryURL = "https://github.com/orchetect/OTCore";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.1.26;
minimumVersion = 1.3.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
repositoryURL = "https://github.com/orchetect/OTCore.git";
requirement = {
kind = upToNextMajorVersion;
minimumVersion = 1.1.26;
minimumVersion = 1.3.0;
};
};
/* End XCRemoteSwiftPackageReference section */
Expand Down
27 changes: 26 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ let package = Package(
],

dependencies: [
.package(url: "https://github.com/orchetect/SwiftRadix", from: "1.0.3")
.package(url: "https://github.com/orchetect/SwiftRadix", from: "1.0.3"),

// testing-only:
.package(url: "https://github.com/orchetect/XCTestUtils", from: "1.0.1")
],

targets: [
Expand All @@ -34,10 +37,32 @@ let package = Package(
dependencies: [
.target(name: "MIDIKit"),
.product(name: "SwiftRadix", package: "SwiftRadix"),
.product(name: "XCTestUtils", package: "XCTestUtils")
]
)
],

swiftLanguageVersions: [.v5]

)

func addShouldTestFlag() {
var swiftSettings = package.targets
.first(where: { $0.name == "MIDIKitTests" })?
.swiftSettings ?? []

swiftSettings.append(.define("shouldTestCurrentPlatform"))

package.targets
.first(where: { $0.name == "MIDIKitTests" })?
.swiftSettings = swiftSettings
}

// Swift version in Xcode 12.5.1 which introduced watchOS testing
#if os(watchOS) && swift(>=5.4.2)
addShouldTestFlag()
#elseif os(watchOS)
// don't add flag
#else
addShouldTestFlag()
#endif
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Abstractions are built as optional extensions in their own repos.

- In a Swift Package, add it to the Package.swift dependencies:
```swift
.package(url: "https://github.com/orchetect/MIDIKit", from: "0.3.0")
.package(url: "https://github.com/orchetect/MIDIKit", from: "0.4.0")
```

1. Import the library:
Expand Down
7 changes: 7 additions & 0 deletions Sources/MIDIKit/IO/Managed/Input.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ extension MIDI.IO {

extension MIDI.IO.Input {

/// Returns the input's endpoint in the system.
public var endpoint: MIDI.IO.InputEndpoint {

.init(coreMIDIInputPortRef ?? 0)

}

/// Queries the system and returns true if the endpoint exists (by matching port name and unique ID)
internal var uniqueIDExistsInSystem: MIDIEndpointRef? {

Expand Down
Loading

0 comments on commit e767c38

Please sign in to comment.