Atoll/DynamicIsland/models/PlaybackState.swift
2025-10-06 00:07:02 +05:30

44 lines
1.2 KiB
Swift

//
// PlaybackState.swift
// DynamicIsland
//
// Created by Alexander Greco on 2025-03-29.
//
import Foundation
enum RepeatMode: Int, Codable {
case off = 1
case one = 2
case all = 3
}
struct PlaybackState {
var bundleIdentifier: String
var isPlaying: Bool = false
var title: String = "I'm Handsome"
var artist: String = "Me"
var album: String = "Self Love"
var currentTime: Double = 0
var duration: Double = 0
var playbackRate: Double = 1
var isShuffled: Bool = false
var repeatMode: RepeatMode = .off
var lastUpdated: Date = Date.distantPast
var artwork: Data?
}
extension PlaybackState: Equatable {
static func == (lhs: PlaybackState, rhs: PlaybackState) -> Bool {
return lhs.bundleIdentifier == rhs.bundleIdentifier
&& lhs.isPlaying == rhs.isPlaying
&& lhs.title == rhs.title
&& lhs.artist == rhs.artist
&& lhs.album == rhs.album
&& lhs.currentTime == rhs.currentTime
&& lhs.duration == rhs.duration
&& lhs.isShuffled == rhs.isShuffled
&& lhs.repeatMode == rhs.repeatMode
&& lhs.artwork == rhs.artwork
}
}