Skip to content

Commit

Permalink
ProTools.SessionInfo: Added Sendable conformance to all types
Browse files Browse the repository at this point in the history
  • Loading branch information
orchetect committed Sep 22, 2024
1 parent 2c3652f commit 9e0d2d6
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import Foundation

extension ProTools.SessionInfo {
public enum ParseMessage: Error {
public enum ParseMessage {
/// Info message.
/// Can be disregarded and only useful for debugging.
case info(String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ extension ProTools.SessionInfo {
public internal(set) var online: Bool = true
}
}

extension ProTools.SessionInfo.Clip: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ extension ProTools.SessionInfo {
public internal(set) var online: Bool = true
}
}

extension ProTools.SessionInfo.File: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ extension ProTools.SessionInfo {
public internal(set) var audioFileCount: Int?
}
}

extension ProTools.SessionInfo.Main: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ extension ProTools.SessionInfo {
}
}

extension ProTools.SessionInfo.Marker: Sendable { }

extension ProTools.SessionInfo.Marker {
/// Marker track type.
public enum TrackType: String, Equatable, Hashable {
Expand All @@ -129,3 +131,5 @@ extension ProTools.SessionInfo.Marker {
case track = "Track"
}
}

extension ProTools.SessionInfo.Marker.TrackType: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ extension ProTools.SessionInfo {
public internal(set) var content: [String]
}
}

extension ProTools.SessionInfo.OrphanData: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ extension ProTools.SessionInfo {
public internal(set) var numberOfInstances: String = ""
}
}

extension ProTools.SessionInfo.Plugin: Sendable { }
30 changes: 23 additions & 7 deletions Sources/DAWFileKit/ProTools/SessionInfo/SessionInfo Track.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ extension ProTools.SessionInfo {
}
}

extension ProTools.SessionInfo.Track: Sendable { }

// MARK: - State

extension ProTools.SessionInfo.Track {
/// A track's state.
public enum State: String {
Expand All @@ -30,6 +34,10 @@ extension ProTools.SessionInfo.Track {
}
}

extension ProTools.SessionInfo.Track.State: Sendable { }

// MARK: - Clip

extension ProTools.SessionInfo.Track {
/// Represents a clip contained on a track.
public struct Clip: Equatable, Hashable {
Expand All @@ -40,12 +48,20 @@ extension ProTools.SessionInfo.Track {
public internal(set) var endTime: ProTools.SessionInfo.TimeValue?
public internal(set) var duration: ProTools.SessionInfo.TimeValue?
public internal(set) var state: State = .unmuted

/// A clip's state (such as 'Muted', 'Unmuted')
public enum State: String {
// ***** there may be more states possible than this -- need to test
case muted = "Muted"
case unmuted = "Unmuted"
}
}
}

extension ProTools.SessionInfo.Track.Clip: Sendable { }

// MARK: - Clip State

extension ProTools.SessionInfo.Track.Clip {
/// A clip's state (such as 'Muted', 'Unmuted')
public enum State: String {
// TODO: there may be more states possible than this -- need to test
case muted = "Muted"
case unmuted = "Unmuted"
}
}

extension ProTools.SessionInfo.Track.Clip.State: Sendable { }
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ extension ProTools.SessionInfo {
}
}

extension ProTools.SessionInfo.MarkersListingVersion: Sendable { }

extension ProTools.SessionInfo.MarkersListingVersion {
public var columnCount: Int {
switch self {
Expand Down
2 changes: 2 additions & 0 deletions Sources/DAWFileKit/ProTools/SessionInfo/SessionInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ extension ProTools {
}
}

extension ProTools.SessionInfo: Sendable { }

// MARK: - Constants

extension ProTools.SessionInfo {
Expand Down

0 comments on commit 9e0d2d6

Please sign in to comment.