/* * Atoll (DynamicIsland) * Copyright (C) 2024-2026 Atoll Contributors * * Originally from boring.notch project * Modified and adapted for Atoll (DynamicIsland) * See NOTICE for details. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ 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 } }