Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ jobs:
fail_ci_if_error: false

linux:
name: Linux build
# The modules that use no Apple framework must build on Linux, where SoundcheckPlayer tests its pure targets (#13).
# Not the whole package: CoreAudioIO, MixerLink, Appearance and Meters need AudioToolbox, Network and SwiftUI, and
# BroadcastWaveTests needs AVFoundation. `swift test` builds every test target, so the tests run on macOS only.
name: Linux build and tests
# The whole package builds on Linux, where SoundcheckPlayer tests its pure targets (#13, #16). A file that needs an
# Apple framework (AudioToolbox, AVFoundation, Network, SwiftUI) is inside `#if canImport(...)`, so it and its tests
# are left out here; the tests that need none run. A new file that needs one gets the same guard.
runs-on: ubuntu-latest
container: swift:6.2
timeout-minutes: 15
Expand All @@ -75,9 +75,8 @@ jobs:
- name: Show toolchain
run: swift --version

- name: Build the modules and test targets that use no Apple framework
run: |
for target in AudioIO BroadcastWave OSC AutoGain Telemetry Destinations TakeFile Shows \
AudioIOTests OSCTests AutoGainTests TelemetryTests DestinationsTests ShowsTests; do
swift build --target "$target"
done
- name: Build
run: swift build

- name: Package tests
run: swift test
2 changes: 2 additions & 0 deletions Sources/Appearance/AppearanceStyle.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import SwiftUI

extension Color {
Expand Down Expand Up @@ -34,3 +35,4 @@ public struct SecondaryText: ViewModifier {
extension View {
public func secondaryText() -> some View { modifier(SecondaryText()) }
}
#endif
2 changes: 2 additions & 0 deletions Sources/CoreAudioIO/InputSession.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AudioToolbox)
import AudioIO
import AudioToolbox
import CoreAudio
Expand Down Expand Up @@ -150,3 +151,4 @@ private func inputProc(
func check(_ step: String, _ status: OSStatus) throws {
guard status == noErr else { throw CoreAudioError.status(step, status) }
}
#endif
2 changes: 2 additions & 0 deletions Sources/Meters/MeterGrid.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import Appearance
import MixerLink
import Observation
Expand Down Expand Up @@ -462,3 +463,4 @@ extension MixerColor {
}
.padding()
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/DetectingMixerDriver.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Synchronization

/// Finds out which family's Mixer answers at a host and talks to it with that family's driver (#199, #442).
Expand Down Expand Up @@ -149,3 +150,4 @@ public final class DetectingMixerDriver: MixerDriver {
return driver
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixHoldDesk.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain
import OSC

Expand Down Expand Up @@ -287,3 +288,4 @@ extension MixHoldDesk {
if case .float(let value)? = message.arguments.first { sent[message.address] = value }
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixHoldRanges.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain

extension MixHoldDesk {
Expand All @@ -10,3 +11,4 @@ extension MixHoldDesk {
compressorThreshold: scale(of: .compressorThreshold).dbRange, offDb: fader.lowerBound)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerFamily.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import OSC
import Synchronization
Expand Down Expand Up @@ -135,3 +136,4 @@ extension MixerFamily {
return .xAir
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerLink.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation

/// Where a Mixer listens for OSC. Each family has its own port (`MixerFamily.probe`): X-Air mixers use UDP 10024, the
Expand Down Expand Up @@ -207,3 +208,4 @@ public struct MixerColor: Equatable, Sendable {
self.init(hue: Hue(rawValue: clamped % 8) ?? .off, inverted: clamped >= 8)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerLinkController.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import Observation

Expand Down Expand Up @@ -295,3 +296,4 @@ extension MixerEndpoint {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerLinkStatusText.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation

extension MixerLinkStatus {
Expand Down Expand Up @@ -63,3 +64,4 @@ extension MixerFamily {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerQueries.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import OSC

/// Reading one value at a time from a Behringer Mixer over OSC, shared by the X-Air and X32 drivers: both answer a
Expand Down Expand Up @@ -68,3 +69,4 @@ struct MixerQueries: Sendable {
return identity
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerScan.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import OSC

Expand Down Expand Up @@ -159,3 +160,4 @@ extension ScanRange {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/MixerSession.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain
import Foundation
import Observation
Expand Down Expand Up @@ -282,3 +283,4 @@ public final class MixerSession {
/// Where the address has always been kept, so an update finds the Mixer the operator set before.
static let addressKey = "mixerAddress"
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/OSCUDPClient.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import Network
import OSC
Expand Down Expand Up @@ -212,3 +213,4 @@ extension MixerLinkProblem {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/USBReturnRouting.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation

/// Which Mixer inputs take their signal from USB instead of their preamp (SoundcheckPlayer #8): on an X-Air, input
Expand Down Expand Up @@ -84,3 +85,4 @@ public protocol USBReturnControl: Sendable {
/// Writes exactly the inputs `routing` lists, nothing else.
func setUSBReturns(_ routing: USBReturnRouting) async
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/USBReturnTrims.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation

/// The trim on each Mixer input's USB return, in dB (SoundcheckPlayer #76): on an X-Air, input channels 1-16
Expand Down Expand Up @@ -25,3 +26,4 @@ public protocol USBTrimControl: Sendable {
/// Writes exactly the trims `trims` lists, nothing else.
func setUSBTrims(_ trims: USBReturnTrims) async
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/WingDriver.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import Network
import OSC
Expand Down Expand Up @@ -212,3 +213,4 @@ extension MixerColor {
self.init(hue: hue, inverted: false)
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/X32Driver.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import OSC
import Synchronization

Expand Down Expand Up @@ -135,3 +136,4 @@ public final class X32Driver: MixerDriver {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/X32Gain.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain
import OSC

Expand Down Expand Up @@ -193,3 +194,4 @@ extension MixHold.Parameter {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/XAirDriver.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import OSC
import Synchronization

Expand Down Expand Up @@ -143,3 +144,4 @@ public final class XAirDriver: MixerDriver {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/XAirGain.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain
import OSC

Expand Down Expand Up @@ -130,3 +131,4 @@ extension XAirDriver: GainControl, MixHoldDesk {
}
}
}
#endif
2 changes: 2 additions & 0 deletions Sources/MixerLink/XAirUSBReturn.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import OSC

/// The X-Air's USB switches (SoundcheckPlayer #8), at the addresses the XR18 spike used (SoundcheckPlayer #13):
Expand Down Expand Up @@ -53,3 +54,4 @@ extension XAirDriver: USBTrimControl {
/// -18 to +18 dB in 0.25 dB steps.
static let usbTrim = X32Values(steps: 144, toDb: { -18 + $0 * 36 }, toFloat: { (max(-18, min(18, $0)) + 18) / 36 })
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/CrashSafeStemTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
import AVFoundation
@testable import BroadcastWave
import Foundation
Expand Down Expand Up @@ -196,3 +197,4 @@ extension UnreadableStemResumeTests {
#expect(file.fileFormat.sampleRate == 44_100)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/RF64StemTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
import AVFoundation
@testable import BroadcastWave
import Foundation
Expand Down Expand Up @@ -160,3 +161,4 @@ struct RF64StemTests {
#expect(try Self.read(url) == samples)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/StemFileTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
@testable import BroadcastWave
import Foundation
import Testing
Expand Down Expand Up @@ -78,3 +79,4 @@ struct StemFileTests {
#expect(throws: (any Error).self) { try StemFile.inspect(folder.appending(path: "missing.wav")) }
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/StemMarkerTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
import AVFoundation
@testable import BroadcastWave
import Foundation
Expand Down Expand Up @@ -76,3 +77,4 @@ struct StemMarkerTests {
#expect(try CuePoints(contentsOf: url).points == [.init(position: 3, label: "C")])
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/StemReadTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
@testable import BroadcastWave
import Foundation
import Testing
Expand Down Expand Up @@ -111,3 +112,4 @@ struct StemReadTests {
try writer.finalize()
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/BroadcastWaveTests/StemRepairTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(AVFoundation)
@testable import BroadcastWave
import Foundation
import Testing
Expand Down Expand Up @@ -63,3 +64,4 @@ struct StemRepairTests {
#expect(try StemWriter.readSamples(url: target, frames: 0..<1_000) == take)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MetersTests/MeterGridTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(SwiftUI)
import Testing
@testable import Meters

Expand All @@ -11,3 +12,4 @@ struct MeterGridTests {
#expect(MeterGrid.fraction(forDbfs: 6) == 1)
}
}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import MixerLink
import Synchronization
import Testing
Expand Down Expand Up @@ -74,3 +75,4 @@ struct DetectingMixerDriverConnectionTests {
#expect(factory.made.last?.family == .x32)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/DetectingMixerDriverTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import MixerLink
import Testing

Expand Down Expand Up @@ -99,3 +100,4 @@ struct DetectingMixerDriverTests {
#expect(driver.gainControl is X32Driver)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixHoldLagTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import AutoGain
@testable import MixerLink
import OSC
Expand Down Expand Up @@ -190,3 +191,4 @@ struct MixHoldLagTests {
Self.expectSteady(Self.drift(mixer, gain: "/headamp/000/gain", start: (14, 0)), "X32 boost")
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixerCapabilitiesTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import MixerLink
import Testing

Expand Down Expand Up @@ -27,3 +28,4 @@ struct MixerCapabilitiesTests {
#expect(capabilities.usbChannelCount == nil)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixerFamilyTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import MixerLink
import OSC
import Testing
Expand Down Expand Up @@ -87,3 +88,4 @@ struct MixerFamilyTests {
}
}

#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixerGainControlTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import MixerLink
import Testing
Expand Down Expand Up @@ -47,3 +48,4 @@ struct MixerGainControlTests {
#expect(link.gainControl == nil)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixerLinkControllerTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import MixerLink
import Synchronization
Expand Down Expand Up @@ -262,3 +263,4 @@ struct MixerLinkControllerTests {
#expect(MixerLinkController().status == .idle)
}
}
#endif
2 changes: 2 additions & 0 deletions Tests/MixerLinkTests/MixerLinkEndToEndTests.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if canImport(Network)
import Foundation
import MixerLink
import Testing
Expand Down Expand Up @@ -29,3 +30,4 @@ struct MixerLinkEndToEndTests {
#expect(await eventually(30) { link.sources[safe: 1]?.name == "Snare" })
}
}
#endif
Loading
Loading