├── .github ├── ISSUE_TEMPLATE │ ├── config.yml │ └── bug_report.yml ├── FUNDING.yml ├── images │ └── screenshot.png ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml └── workflows │ ├── ci.yml │ └── gated-checkin.yml ├── .swift-format ├── Front Row ├── Assets.xcassets │ ├── Contents.json │ ├── AppIcon.appiconset │ │ ├── icon_128x128.png │ │ ├── icon_256x256.png │ │ ├── icon_32x32.png │ │ ├── icon_512x512.png │ │ ├── icon_256x256 1.png │ │ ├── icon_512x512 1.png │ │ ├── icon_512x512@2x.png │ │ └── Contents.json │ └── AccentColor.colorset │ │ └── Contents.json ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json ├── FrontRow.entitlements ├── Support │ ├── PresentedViewManager.swift │ ├── KeyDownListener.swift │ ├── NowPlayable.swift │ ├── NowPlayable+RemoteCommands.swift │ ├── WindowController.swift │ ├── Extensions.swift │ └── PlayEngine.swift ├── Main Menu │ ├── HelpCommands.swift │ ├── WindowCommands.swift │ ├── AppCommands.swift │ ├── ViewCommands.swift │ ├── FileCommands.swift │ └── PlaybackCommands.swift ├── Views │ ├── GoToTimeView.swift │ ├── PlayerView.swift │ ├── OpenURLView.swift │ ├── ContentView.swift │ ├── SeekSliderView.swift │ └── PlayerControlsView.swift └── FrontRowApp.swift ├── crowdin.yml ├── .gitignore ├── FrontRowInfo.plist ├── .sparkle └── appcast.xml ├── CONTRIBUTING.md ├── Front Row.xcodeproj ├── xcshareddata │ └── xcschemes │ │ └── Front Row.xcscheme └── project.pbxproj ├── README.md └── LICENSE /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: itsjoshpark 2 | buy_me_a_coffee: joshuapark 3 | -------------------------------------------------------------------------------- /.swift-format: -------------------------------------------------------------------------------- 1 | { 2 | "indentation": { 3 | "spaces": 4 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /.github/images/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/.github/images/screenshot.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Front Row/Preview Content/Preview Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /crowdin.yml: -------------------------------------------------------------------------------- 1 | files: 2 | - source: /Front Row/Localizable.xcstrings 3 | translation: /Front Row/Localizable.xcstrings 4 | multilingual: 1 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | - [ ] I have read [CONTRIBUTING.md](https://github.com/itsjoshpark/FrontRow/blob/main/CONTRIBUTING.md) 2 | 3 | ### Description: 4 | -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_128x128.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_256x256.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_32x32.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_256x256 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_256x256 1.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512 1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512 1.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itsjoshpark/FrontRow/HEAD/Front Row/Assets.xcassets/AppIcon.appiconset/icon_512x512@2x.png -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AccentColor.colorset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "colors" : [ 3 | { 4 | "idiom" : "universal" 5 | } 6 | ], 7 | "info" : { 8 | "author" : "xcode", 9 | "version" : 1 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # General 2 | .DS_Store 3 | .AppleDouble 4 | .LSOverride 5 | 6 | # Icon must end with two \r 7 | Icon 8 | 9 | # Thumbnails 10 | ._* 11 | 12 | ## User settings 13 | *.xcuserstate 14 | project.xcworkspace/ 15 | xcuserdata/ 16 | 17 | ## Obj-C/Swift specific 18 | *.hmap 19 | 20 | ## App packaging 21 | *.ipa 22 | *.dSYM.zip 23 | *.dSYM 24 | 25 | ## Playgrounds 26 | timeline.xctimeline 27 | playground.xcworkspace 28 | -------------------------------------------------------------------------------- /Front Row/FrontRow.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.files.user-selected.read-only 8 | 9 | com.apple.security.network.client 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "github-actions" 9 | directory: "/" 10 | schedule: 11 | interval: "weekly" 12 | -------------------------------------------------------------------------------- /Front Row/Support/PresentedViewManager.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PresentedViewManager.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/19/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @Observable public final class PresentedViewManager { 11 | 12 | static let shared = PresentedViewManager() 13 | 14 | var isPresentingOpenURLView = false 15 | 16 | var isPresentingGoToTimeView = false 17 | 18 | var isPresenting: Bool { 19 | isPresentingOpenURLView || isPresentingGoToTimeView 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: ["main"] 6 | 7 | jobs: 8 | build: 9 | runs-on: macos-15 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v6.0.1 13 | 14 | - name: Setup Xcode Version 15 | uses: maxim-lobanov/setup-xcode@v1.6.0 16 | with: 17 | xcode-version: latest-stable 18 | 19 | - name: Build and Analyze 20 | run: > 21 | xcodebuild clean build analyze 22 | -project "Front Row.xcodeproj" 23 | -scheme "Front Row" 24 | CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]} 25 | -------------------------------------------------------------------------------- /Front Row/Main Menu/HelpCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // HelpCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/7/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct HelpCommands: Commands { 11 | var body: some Commands { 12 | CommandGroup(replacing: .help) { 13 | Link( 14 | "Website", 15 | destination: URL(string: "https://github.com/itsjoshpark/FrontRow")! 16 | ) 17 | Link( 18 | "Improve Translation", 19 | destination: URL(string: "https://crowdin.com/project/FrontRow")! 20 | ) 21 | Link( 22 | "Report a Problem", 23 | destination: URL(string: "https://github.com/itsjoshpark/FrontRow/issues")! 24 | ) 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug Report 2 | description: File a bug report 3 | labels: ["bug"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this bug report! 9 | - type: textarea 10 | id: what-happened 11 | attributes: 12 | label: What happened? 13 | description: Also tell us, what did you expect to happen? 14 | placeholder: Provide any steps necessary to reproduce the problem. 15 | validations: 16 | required: true 17 | - type: textarea 18 | id: crash-logs 19 | attributes: 20 | label: Crash Log 21 | description: If Front Row quit unexpectedly, copy the text under Problem Details and System Configuration. This will be automatically formatted, so no need for backticks. You may need to click on `Report...` to see this info. 22 | render: shell 23 | -------------------------------------------------------------------------------- /.github/workflows/gated-checkin.yml: -------------------------------------------------------------------------------- 1 | name: Gated Check-in 2 | 3 | on: 4 | pull_request: 5 | branches: ["main"] 6 | 7 | jobs: 8 | build: 9 | runs-on: macos-15 10 | steps: 11 | - name: Checkout 12 | uses: actions/checkout@v6.0.1 13 | 14 | - name: Setup Xcode Version 15 | uses: maxim-lobanov/setup-xcode@v1.6.0 16 | with: 17 | xcode-version: latest-stable 18 | 19 | - name: Install swift-format 20 | run: | 21 | brew update 22 | brew install swift-format 23 | 24 | - name: Lint using swift-format 25 | run: | 26 | /opt/homebrew/bin/swift-format lint -s -p -r ./ 27 | 28 | - name: Build and Analyze 29 | run: > 30 | xcodebuild clean build analyze 31 | -project "Front Row.xcodeproj" 32 | -scheme "Front Row" 33 | CODE_SIGNING_ALLOWED=NO | xcpretty && exit ${PIPESTATUS[0]} 34 | -------------------------------------------------------------------------------- /Front Row/Main Menu/WindowCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/18/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct WindowCommands: Commands { 11 | @Binding var playEngine: PlayEngine 12 | @Binding var windowController: WindowController 13 | 14 | var body: some Commands { 15 | CommandGroup(after: .windowSize) { 16 | Section { 17 | Button { 18 | PlayEngine.shared.fitToVideoSize() 19 | } label: { 20 | Text( 21 | "Natural Size", 22 | comment: "Fit window to video size" 23 | ) 24 | } 25 | .keyboardShortcut("0", modifiers: [.command]) 26 | .disabled(!playEngine.isLoaded || windowController.isFullscreen) 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Front Row/Views/GoToTimeView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // GoToTimeView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/19/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct GoToTimeView: View { 11 | @Namespace private var timeNamespace 12 | @State private var timecode = "" 13 | 14 | var body: some View { 15 | VStack { 16 | TextField(text: $timecode, prompt: Text(verbatim: "0:00:00")) {} 17 | .autocorrectionDisabled() 18 | .lineLimit(1) 19 | .prefersDefaultFocus(in: timeNamespace) 20 | 21 | Button("Go") { 22 | Task { await PlayEngine.shared.goToTime(timecode) } 23 | } 24 | 25 | Button("Cancel", role: .cancel) { 26 | /// Any action button will dismiss the alert 27 | } 28 | } 29 | .focusScope(timeNamespace) 30 | } 31 | } 32 | 33 | #Preview { 34 | GoToTimeView() 35 | } 36 | -------------------------------------------------------------------------------- /Front Row/Main Menu/AppCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/11/24. 6 | // 7 | 8 | import Sparkle 9 | import SwiftUI 10 | 11 | struct AppCommands: Commands { 12 | private let updater: SPUUpdater 13 | 14 | var body: some Commands { 15 | CommandGroup(after: .appInfo) { 16 | Button { 17 | updater.checkForUpdates() 18 | } label: { 19 | Text("Check for Updates…") 20 | } 21 | .disabled(!updater.canCheckForUpdates) 22 | 23 | Section { 24 | Button { 25 | Task { 26 | guard 27 | let url = URL( 28 | string: 29 | "https://media.developer.dolby.com/DDP/MP4_HPL40_30fps_channel_id_51.mp4" 30 | ) 31 | else { return } 32 | await PlayEngine.shared.openFile(url: url) 33 | } 34 | } label: { 35 | Text("Experience Spatial Audio") 36 | } 37 | } 38 | } 39 | } 40 | 41 | init(updater: SPUUpdater) { 42 | self.updater = updater 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Front Row/Views/PlayerView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayerView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/25/24. 6 | // 7 | 8 | import AVFoundation 9 | import SwiftUI 10 | 11 | struct PlayerView: NSViewRepresentable { 12 | let player: AVPlayer 13 | 14 | class PlayerNSView: NSView, CALayerDelegate { 15 | 16 | private let playerLayer = AVPlayerLayer() 17 | 18 | override func makeBackingLayer() -> CALayer { 19 | playerLayer 20 | } 21 | 22 | override func mouseDown(with event: NSEvent) { 23 | if event.type == .leftMouseDown && event.clickCount == 2 { 24 | NSApplication.shared.mainWindow?.toggleFullScreen(nil) 25 | } else { 26 | super.mouseDown(with: event) 27 | } 28 | } 29 | 30 | override func rightMouseUp(with event: NSEvent) { 31 | PlayEngine.shared.playPause() 32 | super.rightMouseUp(with: event) 33 | } 34 | 35 | init(player: AVPlayer) { 36 | super.init(frame: .zero) 37 | playerLayer.player = player 38 | } 39 | 40 | required init?(coder: NSCoder) { 41 | fatalError("init(coder:) has not been implemented") 42 | } 43 | } 44 | 45 | func makeNSView(context: Context) -> some NSView { 46 | return PlayerNSView(player: player) 47 | } 48 | 49 | func updateNSView(_ nsView: NSViewType, context: Context) { 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Front Row/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "mac", 5 | "scale" : "1x", 6 | "size" : "16x16" 7 | }, 8 | { 9 | "idiom" : "mac", 10 | "scale" : "2x", 11 | "size" : "16x16" 12 | }, 13 | { 14 | "filename" : "icon_32x32.png", 15 | "idiom" : "mac", 16 | "scale" : "1x", 17 | "size" : "32x32" 18 | }, 19 | { 20 | "idiom" : "mac", 21 | "scale" : "2x", 22 | "size" : "32x32" 23 | }, 24 | { 25 | "filename" : "icon_128x128.png", 26 | "idiom" : "mac", 27 | "scale" : "1x", 28 | "size" : "128x128" 29 | }, 30 | { 31 | "filename" : "icon_256x256 1.png", 32 | "idiom" : "mac", 33 | "scale" : "2x", 34 | "size" : "128x128" 35 | }, 36 | { 37 | "filename" : "icon_256x256.png", 38 | "idiom" : "mac", 39 | "scale" : "1x", 40 | "size" : "256x256" 41 | }, 42 | { 43 | "filename" : "icon_512x512 1.png", 44 | "idiom" : "mac", 45 | "scale" : "2x", 46 | "size" : "256x256" 47 | }, 48 | { 49 | "filename" : "icon_512x512.png", 50 | "idiom" : "mac", 51 | "scale" : "1x", 52 | "size" : "512x512" 53 | }, 54 | { 55 | "filename" : "icon_512x512@2x.png", 56 | "idiom" : "mac", 57 | "scale" : "2x", 58 | "size" : "512x512" 59 | } 60 | ], 61 | "info" : { 62 | "author" : "xcode", 63 | "version" : 1 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Front Row/Main Menu/ViewCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import AVKit 9 | import SwiftUI 10 | 11 | struct ViewCommands: Commands { 12 | @Binding var playEngine: PlayEngine 13 | @Binding var windowController: WindowController 14 | 15 | var body: some Commands { 16 | CommandGroup(replacing: .toolbar) { 17 | Button { 18 | NSApplication.shared.mainWindow?.toggleFullScreen(nil) 19 | } label: { 20 | Text(windowController.isFullscreen ? "Exit Full Screen" : "Enter Full Screen") 21 | } 22 | .keyboardShortcut(.return, modifiers: []) 23 | 24 | Toggle(isOn: $windowController.isOnTop) { 25 | Text("Float on Top") 26 | } 27 | 28 | Divider() 29 | 30 | subtitlePicker 31 | } 32 | } 33 | 34 | @ViewBuilder private var subtitlePicker: some View { 35 | if let group = playEngine.subtitleGroup { 36 | Picker("Subtitle", selection: $playEngine.subtitle) { 37 | Text("Off").tag(nil as AVMediaSelectionOption?) 38 | 39 | let optionsWithoutForcedSubs = group.options.filter { 40 | !$0.displayName.contains("Forced") 41 | } 42 | ForEach(optionsWithoutForcedSubs) { 43 | option in 44 | Text(verbatim: option.displayName).tag(Optional(option)) 45 | } 46 | } 47 | .pickerStyle(.inline) 48 | } else { 49 | Picker("Subtitle", selection: .constant(0)) { 50 | Text("None").tag(0) 51 | } 52 | .pickerStyle(.inline) 53 | .disabled(true) 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Front Row/Support/KeyDownListener.swift: -------------------------------------------------------------------------------- 1 | // 2 | // KeyDownListener.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 5/26/25. 6 | // 7 | 8 | import Carbon.HIToolbox 9 | import Cocoa 10 | 11 | final class KeyDownListener { 12 | 13 | private var eventMonitor: Any? 14 | 15 | private enum KeyCommands { 16 | case escape 17 | 18 | static func fromEvent(_ event: NSEvent) -> KeyCommands? { 19 | // `keyCode` will raise exceptions if called on 20 | // events that are not key events 21 | guard event.type == .keyDown else { return nil } 22 | 23 | switch event.keyCode { 24 | case UInt16(kVK_Escape): return .escape 25 | default: return nil 26 | } 27 | } 28 | } 29 | 30 | public func startMonitoringKeyEvents() { 31 | if eventMonitor != nil { 32 | return 33 | } 34 | 35 | eventMonitor = NSEvent.addLocalMonitorForEvents(matching: .keyDown) { event in 36 | guard let command = KeyCommands.fromEvent(event) else { 37 | return event 38 | } 39 | 40 | let allWindows = NSApp.windows 41 | let firstResponders = allWindows.compactMap { $0.firstResponder } 42 | let fieldEditors = firstResponders.filter { ($0 as? NSText)?.isEditable == true } 43 | guard fieldEditors.isEmpty else { return event } 44 | 45 | switch command { 46 | case .escape: 47 | if !WindowController.shared.isFullscreen { 48 | NSApp.hide(nil) 49 | PlayEngine.shared.pause() 50 | return nil 51 | } 52 | } 53 | return event 54 | } 55 | } 56 | 57 | public func stopMonitoringKeyEvents() { 58 | if let eventMonitor = eventMonitor { 59 | NSEvent.removeMonitor(eventMonitor) 60 | } 61 | 62 | eventMonitor = nil 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Front Row/Support/NowPlayable.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NowPlayable.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 5/26/25. 6 | // 7 | 8 | import MediaPlayer 9 | 10 | struct NowPlayableStaticMetadata { 11 | // MPNowPlayingInfoPropertyAssetURL 12 | let assetURL: URL 13 | 14 | // MPNowPlayingInfoPropertyMediaType 15 | let mediaType: MPNowPlayingInfoMediaType 16 | 17 | // MPMediaItemPropertyTitle 18 | let title: String 19 | } 20 | 21 | struct NowPlayableDynamicMetadata { 22 | // MPNowPlayingInfoPropertyPlaybackRate 23 | let rate: Float 24 | 25 | // MPNowPlayingInfoPropertyElapsedPlaybackTime 26 | let position: Float 27 | 28 | // MPMediaItemPropertyPlaybackDuration 29 | let duration: Float 30 | } 31 | 32 | final class NowPlayable { 33 | 34 | static let shared = NowPlayable() 35 | 36 | func sessionStart() { 37 | MPNowPlayingInfoCenter.default().playbackState = .paused 38 | } 39 | 40 | func sessionEnd() { 41 | MPNowPlayingInfoCenter.default().playbackState = .stopped 42 | } 43 | 44 | func setNowPlayingMetadata(_ metadata: NowPlayableStaticMetadata) { 45 | let nowPlayingInfoCenter = MPNowPlayingInfoCenter.default() 46 | var nowPlayingInfo = [String: Any]() 47 | nowPlayingInfo[MPNowPlayingInfoPropertyAssetURL] = metadata.assetURL 48 | nowPlayingInfo[MPNowPlayingInfoPropertyMediaType] = metadata.mediaType.rawValue 49 | nowPlayingInfo[MPMediaItemPropertyTitle] = metadata.title 50 | nowPlayingInfoCenter.nowPlayingInfo = nowPlayingInfo 51 | } 52 | 53 | func setNowPlayingPlaybackInfo(playing isPlaying: Bool, _ metadata: NowPlayableDynamicMetadata) 54 | { 55 | let nowPlayingInfoCenter = MPNowPlayingInfoCenter.default() 56 | var nowPlayingInfo = nowPlayingInfoCenter.nowPlayingInfo ?? [String: Any]() 57 | nowPlayingInfo[MPNowPlayingInfoPropertyPlaybackRate] = metadata.rate 58 | nowPlayingInfo[MPNowPlayingInfoPropertyDefaultPlaybackRate] = 1.0 59 | nowPlayingInfo[MPNowPlayingInfoPropertyElapsedPlaybackTime] = metadata.position 60 | nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = metadata.duration 61 | nowPlayingInfoCenter.nowPlayingInfo = nowPlayingInfo 62 | nowPlayingInfoCenter.playbackState = isPlaying ? .playing : .paused 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Front Row/Main Menu/FileCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FileCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import AVKit 9 | import SwiftUI 10 | 11 | struct FileCommands: Commands { 12 | @Binding var playEngine: PlayEngine 13 | 14 | var body: some Commands { 15 | CommandGroup(replacing: .newItem) { 16 | Button { 17 | Task { 18 | await showOpenFileDialog() 19 | } 20 | } label: { 21 | Text( 22 | "Open File...", 23 | comment: "Show the open file dialog" 24 | ) 25 | } 26 | .keyboardShortcut("O", modifiers: [.command]) 27 | 28 | Button { 29 | PresentedViewManager.shared.isPresentingOpenURLView.toggle() 30 | } label: { 31 | Text( 32 | "Open URL...", 33 | comment: "Show the open URL dialog" 34 | ) 35 | } 36 | .keyboardShortcut("O", modifiers: [.command, .shift]) 37 | 38 | Divider() 39 | 40 | Button { 41 | guard let item = PlayEngine.shared.player.currentItem else { return } 42 | guard let asset = item.asset as? AVURLAsset else { return } 43 | NSWorkspace.shared.activateFileViewerSelecting([asset.url]) 44 | } label: { 45 | Text( 46 | "Show in Finder", 47 | comment: "Show the currently playing file in Finder" 48 | ) 49 | } 50 | .disabled(!playEngine.isLocalFile) 51 | } 52 | } 53 | 54 | private func showOpenFileDialog() async { 55 | let panel = NSOpenPanel() 56 | panel.allowedContentTypes = PlayEngine.supportedFileTypes 57 | panel.allowsMultipleSelection = false 58 | panel.canChooseDirectories = false 59 | panel.canChooseFiles = true 60 | let resp = await panel.beginSheetModal(for: NSApplication.shared.mainWindow!) 61 | if resp != .OK { 62 | return 63 | } 64 | 65 | guard let url = panel.url else { return } 66 | guard await PlayEngine.shared.openFile(url: url) else { return } 67 | NSDocumentController.shared.noteNewRecentDocumentURL(url) 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /Front Row/Views/OpenURLView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // OpenURLView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/17/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct OpenURLView: View { 11 | @Environment(\.dismiss) private var dismiss 12 | @State private var url = "" 13 | @State private var displayLoading = false 14 | @State private var displayError = false 15 | 16 | var body: some View { 17 | HStack(spacing: 16) { 18 | if displayLoading { 19 | ProgressView() 20 | .controlSize(.small) 21 | } 22 | 23 | if displayError { 24 | Image(systemName: "play.slash") 25 | .foregroundStyle(.secondary) 26 | .font(.largeTitle) 27 | } 28 | 29 | TextField( 30 | text: $url, 31 | prompt: Text( 32 | "Enter URL", 33 | comment: "Prompt text for Open URL sheet text field" 34 | ) 35 | ) {} 36 | .onChange(of: url) { 37 | PlayEngine.shared.cancelLoading() 38 | withAnimation { 39 | displayLoading = false 40 | displayError = false 41 | } 42 | } 43 | .onSubmit { 44 | Task { 45 | guard let url = URL(string: url) else { 46 | withAnimation { 47 | displayLoading = false 48 | displayError = true 49 | } 50 | return 51 | } 52 | displayLoading = true 53 | guard await PlayEngine.shared.openFile(url: url) else { 54 | withAnimation { 55 | displayLoading = false 56 | displayError = true 57 | } 58 | return 59 | } 60 | withAnimation { 61 | displayLoading = false 62 | displayError = false 63 | } 64 | NSDocumentController.shared.noteNewRecentDocumentURL(url) 65 | dismiss() 66 | } 67 | } 68 | .autocorrectionDisabled() 69 | .lineLimit(1) 70 | .font(.title) 71 | .textFieldStyle(.plain) 72 | } 73 | .padding([.horizontal], 26) 74 | } 75 | } 76 | 77 | #Preview { 78 | OpenURLView() 79 | } 80 | -------------------------------------------------------------------------------- /FrontRowInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDocumentTypes 6 | 7 | 8 | CFBundleTypeExtensions 9 | 10 | mp4 11 | m4v 12 | 13 | CFBundleTypeName 14 | MPEG-4 Video 15 | CFBundleTypeRole 16 | Viewer 17 | LSHandlerRank 18 | Default 19 | 20 | 21 | CFBundleTypeExtensions 22 | 23 | m4a 24 | 25 | CFBundleTypeName 26 | MPEG-4 Audio 27 | CFBundleTypeRole 28 | Viewer 29 | LSHandlerRank 30 | Default 31 | 32 | 33 | CFBundleTypeExtensions 34 | 35 | mov 36 | qt 37 | 38 | CFBundleTypeName 39 | QuickTime Media 40 | CFBundleTypeRole 41 | Viewer 42 | LSHandlerRank 43 | Default 44 | 45 | 46 | CFBundleTypeExtensions 47 | 48 | ts 49 | mts 50 | m2ts 51 | 52 | CFBundleTypeName 53 | MPEG Transport Stream 54 | CFBundleTypeRole 55 | Viewer 56 | LSHandlerRank 57 | Default 58 | 59 | 60 | CFBundleTypeExtensions 61 | 62 | mp3 63 | 64 | CFBundleTypeName 65 | MPEG Layer III Audio 66 | CFBundleTypeRole 67 | Viewer 68 | LSHandlerRank 69 | Default 70 | 71 | 72 | CFBundleTypeExtensions 73 | 74 | wav 75 | 76 | CFBundleTypeName 77 | Waveform Audio 78 | CFBundleTypeRole 79 | Viewer 80 | LSHandlerRank 81 | Default 82 | 83 | 84 | SUEnableAutomaticChecks 85 | 86 | SUFeedURL 87 | https://github.com/itsjoshpark/FrontRow/raw/main/.sparkle/appcast.xml 88 | SUPublicEDKey 89 | j1emFUOJ+3Pou9kvxoeZIOTIFTeg1RWsfPuOoecgk/c= 90 | 91 | 92 | -------------------------------------------------------------------------------- /.sparkle/appcast.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Front Row 5 | en 6 | 7 | 8 | v2.6 9 | https://github.com/itsjoshpark/FrontRow 10 | 2.6 11 | 15.0 12 | https://github.com/itsjoshpark/FrontRow/releases 13 | Mon, 06 Jun 2025 03:05:16 +0000 14 | 19 | 21 |
  • New: Use the Now Playing control center in the menu bar to control the app
  • 22 |
  • New: Display recently opened files in the app's Dock context menu
  • 23 |
  • New: Pause and hide app by pressing Esc key
  • 24 |
  • New: Open URL shortcut is now Cmd+Shift+O
  • 25 |
  • Fixed: Open URL window UI
  • 26 | 27 | ]]> 28 |
    29 |
    30 | 31 | 32 | v2.5.4 33 | https://github.com/itsjoshpark/FrontRow 34 | 2.5.4 35 | 15.0 36 | https://github.com/itsjoshpark/FrontRow/releases 37 | Sun, 20 Apr 2025 00:59:08 +0000 38 | 43 | 45 |
  • Moved new releases back to GitHub
  • 46 | 47 |

    Front Row is moving from releasing updates on the Mac App Store back to GitHub. Apple behavior of temporarily removing your app from the store unless you pay their ongoing developer fee is hostile. Releasing new versions on GitHub allows anyone to download and run the app in the future even if I don't continue to pay Apple.

    48 | ]]> 49 |
    50 |
    51 |
    52 |
    53 | -------------------------------------------------------------------------------- /Front Row/Support/NowPlayable+RemoteCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // NowPlayable+RemoteCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 5/29/25. 6 | // 7 | 8 | import MediaPlayer 9 | 10 | extension NowPlayable { 11 | func setupRemoteCommandHandlers(playEngine: PlayEngine) { 12 | let commandCenter = MPRemoteCommandCenter.shared() 13 | 14 | commandCenter.playCommand.isEnabled = true 15 | commandCenter.playCommand.addTarget { _ in 16 | playEngine.play() 17 | return .success 18 | } 19 | 20 | commandCenter.pauseCommand.isEnabled = true 21 | commandCenter.pauseCommand.addTarget { _ in 22 | playEngine.pause() 23 | return .success 24 | } 25 | 26 | commandCenter.togglePlayPauseCommand.isEnabled = true 27 | commandCenter.togglePlayPauseCommand.addTarget { _ in 28 | playEngine.playPause() 29 | return .success 30 | } 31 | 32 | commandCenter.changePlaybackPositionCommand.isEnabled = true 33 | commandCenter.changePlaybackPositionCommand.addTarget { event in 34 | guard let event = event as? MPChangePlaybackPositionCommandEvent else { 35 | return .commandFailed 36 | } 37 | Task { 38 | await playEngine.goToTime(event.positionTime) 39 | } 40 | return .success 41 | } 42 | 43 | commandCenter.skipForwardCommand.isEnabled = true 44 | commandCenter.skipForwardCommand.preferredIntervals = [ 45 | NSNumber(value: playEngine.skipInterval) 46 | ] 47 | commandCenter.skipForwardCommand.addTarget { _ in 48 | Task { 49 | await playEngine.goForwards() 50 | } 51 | return .success 52 | } 53 | 54 | commandCenter.skipBackwardCommand.isEnabled = true 55 | commandCenter.skipBackwardCommand.preferredIntervals = [ 56 | NSNumber(value: playEngine.skipInterval) 57 | ] 58 | commandCenter.skipBackwardCommand.addTarget { _ in 59 | Task { 60 | await playEngine.goBackwards() 61 | } 62 | return .success 63 | } 64 | } 65 | 66 | func removeRemoteCommandHandlers() { 67 | let commandCenter = MPRemoteCommandCenter.shared() 68 | commandCenter.playCommand.removeTarget(nil) 69 | commandCenter.pauseCommand.removeTarget(nil) 70 | commandCenter.togglePlayPauseCommand.removeTarget(nil) 71 | commandCenter.changePlaybackPositionCommand.removeTarget(nil) 72 | commandCenter.skipForwardCommand.removeTarget(nil) 73 | commandCenter.skipBackwardCommand.removeTarget(nil) 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /Front Row/Support/WindowController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // WindowController.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/11/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | @Observable public final class WindowController { 11 | 12 | static let shared = WindowController() 13 | 14 | // MARK: - Fullscreen 15 | 16 | private(set) var isFullscreen = false 17 | 18 | func setIsFullscreen(_ isFullscreen: Bool) { 19 | self.isFullscreen = isFullscreen 20 | } 21 | 22 | // MARK: - Float on Top 23 | 24 | var isOnTop: Bool { 25 | get { 26 | access(keyPath: \.isOnTop) 27 | return NSApplication.shared.mainWindow?.level == .floating 28 | } 29 | set { 30 | withMutation(keyPath: \.isOnTop) { 31 | NSApplication.shared.mainWindow?.level = newValue ? .floating : .normal 32 | } 33 | } 34 | } 35 | 36 | // MARK: - Autohide Cursor 37 | 38 | func hideCursor() { 39 | CGDisplayHideCursor(CGMainDisplayID()) 40 | } 41 | 42 | func showCursor() { 43 | CGDisplayShowCursor(CGMainDisplayID()) 44 | } 45 | 46 | // MARK: - Autohide Titlebar 47 | 48 | private var _titlebarView: NSView? 49 | 50 | var titlebarView: NSView? { 51 | guard _titlebarView == nil else { return _titlebarView } 52 | 53 | guard let containerClass = NSClassFromString("NSTitlebarContainerView") else { return nil } 54 | guard 55 | let containerView = NSApp.windows.first?.contentView?.superview?.subviews.reversed() 56 | .first(where: { $0.isKind(of: containerClass) }) 57 | else { return nil } 58 | 59 | guard let titlebarClass = NSClassFromString("NSTitlebarView") else { return nil } 60 | guard let titlebar = containerView.subviews.first(where: { $0.isKind(of: titlebarClass) }) 61 | else { return nil } 62 | 63 | _titlebarView = titlebar 64 | 65 | return _titlebarView 66 | } 67 | 68 | func hideTitlebar() { 69 | setTitlebarOpacity(0.0) 70 | } 71 | 72 | func showTitlebar(immediately: Bool = false) { 73 | setTitlebarOpacity(1.0, immediately: immediately) 74 | } 75 | 76 | private func setTitlebarOpacity(_ opacity: CGFloat, immediately: Bool = false) { 77 | /// when the window is in full screen, the titlebar view is in another window (the "toolbar window") 78 | guard titlebarView?.window == NSApp.windows.first else { return } 79 | 80 | if immediately { 81 | self.titlebarView?.animator().alphaValue = opacity 82 | return 83 | } 84 | 85 | NSAnimationContext.runAnimationGroup( 86 | { ctx in 87 | ctx.duration = 0.4 88 | self.titlebarView?.animator().alphaValue = opacity 89 | }, completionHandler: nil) 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | Thank you for your interest in contributing! 4 | 5 | Please review the following guidelines to help keep the project in a good shape. 6 | 7 | 8 | ## Gated Check-in 9 | 10 | To prevent broken or inconsistent code from being checked-in, all Pull Request will go through a gated check-in process. 11 | This process will check that the code builds without errors and that it meets [swift-format](https://github.com/apple/swift-format)'s standards. 12 | Many swift-format warnings can be fixed by using the Format Source Code option that it provides in Xcode. 13 | 14 | ![image](https://github.com/MochiDiffusion/MochiDiffusion/assets/1341760/d4012424-bd54-484f-a0e2-7cb2ee20fbd3) 15 | 16 | 17 | ## Pull Request Commit Message Format 18 | 19 | We have very precise rules over how our Git Pull Request commit messages must be formatted. 20 | This format leads to **easier to read commit history**. 21 | Note that Pull Requests are squash merged so this rule only applies to the final commit message shown in GitHub's PR page. 22 | 23 | Each commit message consists of a **header** and a **body**. 24 | 25 | 26 | ``` 27 |
    28 | 29 | 30 | ``` 31 | 32 | The `header` is mandatory and must conform to the [Commit Message Header](#commit-header) format. 33 | 34 | The `body` is mandatory for all commits except for those of type "docs". 35 | When the body is present it must be at least 20 characters long and must conform to the [Commit Message Body](#commit-body) format. 36 | 37 | 38 | #### Commit Message Header 39 | 40 | ``` 41 | : 42 | │ │ 43 | │ └─⫸ Summary in present tense. Not capitalized. No period at the end. 44 | │ 45 | └─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test 46 | ``` 47 | 48 | The `` and `` fields are mandatory. 49 | 50 | 51 | ##### Type 52 | 53 | Must be one of the following: 54 | 55 | * **build**: Changes that affect the build system or external dependencies (Swift Packages, etc.) 56 | * **ci**: Changes to our CI configuration files and scripts (GitHub Actions, etc) 57 | * **docs**: Documentation only changes 58 | * **feat**: A new feature 59 | * **fix**: A bug fix 60 | * **perf**: A code change that improves performance 61 | * **refactor**: A code change that neither fixes a bug nor adds a feature 62 | 63 | 64 | ##### Summary 65 | 66 | Use the summary field to provide a succinct description of the change: 67 | 68 | * use the imperative, present tense: "change" not "changed" nor "changes" 69 | * don't capitalize the first letter 70 | * no dot (.) at the end 71 | 72 | 73 | #### Commit Message Body 74 | 75 | Just as in the summary, use the imperative, present tense: "fix" not "fixed" nor "fixes". 76 | 77 | Explain the motivation for the change in the commit message body. This commit message should explain _why_ you are making the change. 78 | You can include a comparison of the previous behavior with the new behavior in order to illustrate the impact of the change. 79 | -------------------------------------------------------------------------------- /Front Row.xcodeproj/xcshareddata/xcschemes/Front Row.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | 16 | 22 | 23 | 24 | 25 | 26 | 32 | 33 | 43 | 45 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 66 | 68 | 74 | 75 | 76 | 77 | 79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

    2 | 3 |

    4 | 5 |

    Front Row

    6 | 7 |

    Play HDR videos & spatial audio natively

    8 | 9 |

    10 | GitHub Release 11 | 12 | 13 |

    14 | 15 | ![Screenshot](.github/images/screenshot.png) 16 | 17 | Experience color accurate HDR videos with full surround sound using spatial audio. 18 | 19 | ## Compatibility 20 | 21 | - [HDR video compatible Macs](https://support.apple.com/en-us/102205) and/or [spatial audio compatible devices](https://support.apple.com/en-us/102469) 22 | - Apple Silicon (M1 and later) 23 | - macOS Sonoma 15.0 and later 24 | - Xcode 16 (to build) 25 | 26 | ## Frequently Asked Questions 27 | 28 | ### Why do I need this? 29 | 30 | Many movies and TV shows are available with multichannel audio. However you would need to have a full surround sound setup in order to fully enjoy that experience. Apple introduced spatial audio which allows playing multichannel audio into regular headphones, such as the AirPods Pro. This vastly improves the roominess and depth of the played audio. Unfortunately, not many video players support Apple's spatial audio. So I created a simple video player with AVKit, which is able to use spatial audio. 31 | 32 | ### What about just using QuickTime Player? 33 | 34 | Sure, that works too. But I didn't like QuickTime Player's keyboard shortcuts nor its large on screen controls which blocks the video and subtitles. 35 | 36 | ### Where is feature XYZ? 37 | 38 | I created Front Row to play those rare video files that are in HDR and/or multichannel with spatial audio. For everything else, I use IINA like you. 39 | 40 | ### Help! My video file is in MKV and doesn't open with Front Row 41 | 42 | As Front Row is based on AVKit (which is what QuickTime Player uses), it can't directly open MKV files. However MKV is a container format and it usually contains Apple supported streams such as MPEG-4 video with AAC audio. If so, you can remux the file into an MP4 file using `ffmpeg`. 43 | 44 | ``` 45 | ffmpeg -i ./input.mkv -map 0 -c copy -tag:v hvc1 ./output.mp4 46 | ``` 47 | 48 | Note: 49 | - Add `-c:s mov_text` after `-c copy` if there are built in subtitles 50 | - Use `-tag:v hvc1` for video streams encoded in H265. Use `-tag:v avc1` instead for H264 51 | 52 | ### I followed the steps above but don't hear any audio 53 | 54 | The audio stream is in a codec that is not natively supported by Apple. You'll need to transcode the audio stream into a supported format. 55 | 56 | ``` 57 | ffmpeg -i ./input.mkv -map 0 -c copy -c:a aac_at -b:a 448k -tag:v hvc1 ./output.mp4 58 | ``` 59 | 60 | Note: 61 | - Add `-c:s mov_text` after `-c copy` if there are built in subtitles 62 | - Use `-tag:v hvc1` for video streams encoded in H265. Use `-tag:v avc1` instead for H264 63 | 64 | ### I don't hear spatial audio through my supported device 65 | 66 | First, make sure that the audio track contains more than 2 channels. Also, make sure to turn on spatial audio under the audio menu bar while the video is playing. 67 | -------------------------------------------------------------------------------- /Front Row/Views/ContentView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ContentView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct ContentView: View { 11 | @Environment(PlayEngine.self) var playEngine: PlayEngine 12 | @State private var mouseIdleTimer: Timer! 13 | @State private var mouseInsideWindow = false 14 | @State private var playerControlsShown = true 15 | 16 | var body: some View { 17 | @Bindable var playEngine = playEngine 18 | 19 | ZStack(alignment: .bottom) { 20 | PlayerView(player: PlayEngine.shared.player) 21 | .onDrop( 22 | of: [.fileURL], 23 | delegate: AnyDropDelegate( 24 | onValidate: { 25 | $0.hasItemsConforming(to: PlayEngine.supportedFileTypes) 26 | }, 27 | onPerform: { 28 | guard let provider = $0.itemProviders(for: [.fileURL]).first else { 29 | return false 30 | } 31 | 32 | Task { 33 | guard let url = await provider.getURL() else { return } 34 | guard await PlayEngine.shared.openFile(url: url) else { return } 35 | NSDocumentController.shared.noteNewRecentDocumentURL(url) 36 | } 37 | 38 | return true 39 | } 40 | ) 41 | ) 42 | .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) 43 | .ignoresSafeArea() 44 | 45 | if !playEngine.isLocalFile 46 | && playEngine.timeControlStatus == .waitingToPlayAtSpecifiedRate 47 | { 48 | ProgressView() 49 | .frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .center) 50 | } 51 | 52 | PlayerControlsView() 53 | .animation(.linear(duration: 0.4), value: playerControlsShown) 54 | .opacity(playerControlsShown ? 1.0 : 0.0) 55 | } 56 | .background { 57 | Color.black.ignoresSafeArea() 58 | } 59 | .onContinuousHover { phase in 60 | switch phase { 61 | case .active: 62 | mouseInsideWindow = true 63 | resetMouseIdleTimer() 64 | showPlayerControls() 65 | WindowController.shared.showTitlebar() 66 | WindowController.shared.showCursor() 67 | case .ended: 68 | mouseInsideWindow = false 69 | hidePlayerControls() 70 | WindowController.shared.hideTitlebar() 71 | WindowController.shared.showCursor() 72 | } 73 | } 74 | } 75 | 76 | private func hidePlayerControls() { 77 | withAnimation { 78 | playerControlsShown = false 79 | } 80 | } 81 | 82 | private func showPlayerControls() { 83 | withAnimation { 84 | playerControlsShown = true 85 | } 86 | } 87 | 88 | private func resetMouseIdleTimer() { 89 | if mouseIdleTimer != nil { 90 | mouseIdleTimer.invalidate() 91 | mouseIdleTimer = nil 92 | } 93 | 94 | mouseIdleTimer = Timer.scheduledTimer(withTimeInterval: 3.0, repeats: false) { 95 | mouseIdleTimerAction($0) 96 | } 97 | } 98 | 99 | private func mouseIdleTimerAction(_ sender: Timer) { 100 | hidePlayerControls() 101 | WindowController.shared.hideTitlebar() 102 | if mouseInsideWindow { 103 | WindowController.shared.hideCursor() 104 | } 105 | } 106 | } 107 | 108 | #Preview { 109 | ContentView() 110 | } 111 | -------------------------------------------------------------------------------- /Front Row/FrontRowApp.swift: -------------------------------------------------------------------------------- 1 | // 2 | // FrontRowApp.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import Sparkle 9 | import SwiftUI 10 | 11 | @main 12 | struct FrontRowApp: App { 13 | @NSApplicationDelegateAdaptor private var appDelegate: AppDelegate 14 | @State private var playEngine: PlayEngine 15 | @State private var presentedViewManager: PresentedViewManager 16 | @State private var windowController: WindowController 17 | private let updaterController: SPUStandardUpdaterController 18 | private let keyDownListener = KeyDownListener() 19 | 20 | init() { 21 | self._playEngine = .init(wrappedValue: .shared) 22 | self._presentedViewManager = .init(wrappedValue: .shared) 23 | self._windowController = .init(wrappedValue: .shared) 24 | 25 | updaterController = SPUStandardUpdaterController( 26 | startingUpdater: true, 27 | updaterDelegate: nil, 28 | userDriverDelegate: nil 29 | ) 30 | 31 | keyDownListener.startMonitoringKeyEvents() 32 | 33 | UserDefaults.standard.set(false, forKey: "NSFullScreenMenuItemEverywhere") 34 | } 35 | 36 | var body: some Scene { 37 | Window("Front Row", id: "main") { 38 | ContentView() 39 | .preferredColorScheme(.dark) 40 | .environment(playEngine) 41 | .sheet(isPresented: $presentedViewManager.isPresentingOpenURLView) { 42 | OpenURLView() 43 | .frame(minWidth: 600) 44 | } 45 | .alert("Go to Time", isPresented: $presentedViewManager.isPresentingGoToTimeView) { 46 | GoToTimeView() 47 | } message: { 48 | Text("Enter the time you want to go to") 49 | } 50 | .onReceive( 51 | NotificationCenter.default.publisher( 52 | for: NSWindow.willEnterFullScreenNotification) 53 | ) { _ in 54 | windowController.showTitlebar(immediately: true) 55 | } 56 | .onReceive( 57 | NotificationCenter.default.publisher( 58 | for: NSWindow.didEnterFullScreenNotification) 59 | ) { _ in 60 | keyDownListener.stopMonitoringKeyEvents() 61 | windowController.setIsFullscreen(true) 62 | } 63 | .onReceive( 64 | NotificationCenter.default.publisher( 65 | for: NSWindow.didExitFullScreenNotification) 66 | ) { _ in 67 | keyDownListener.startMonitoringKeyEvents() 68 | windowController.setIsFullscreen(false) 69 | } 70 | } 71 | .windowStyle(.hiddenTitleBar) 72 | .restorationBehavior(.disabled) 73 | .commands { 74 | AppCommands(updater: updaterController.updater) 75 | FileCommands(playEngine: $playEngine) 76 | ViewCommands( 77 | playEngine: $playEngine, 78 | windowController: $windowController) 79 | PlaybackCommands( 80 | playEngine: $playEngine, 81 | presentedViewManager: $presentedViewManager) 82 | WindowCommands( 83 | playEngine: $playEngine, 84 | windowController: $windowController) 85 | HelpCommands() 86 | } 87 | } 88 | } 89 | 90 | class AppDelegate: NSObject, NSApplicationDelegate { 91 | func application(_ application: NSApplication, open urls: [URL]) { 92 | guard urls.count == 1, let url = urls.first else { return } 93 | Task { 94 | guard await PlayEngine.shared.openFile(url: url) else { return } 95 | NSDocumentController.shared.noteNewRecentDocumentURL(url) 96 | } 97 | } 98 | 99 | func applicationDidFinishLaunching(_ notification: Notification) { 100 | if let window = NSApp.windows.first { 101 | window.isMovableByWindowBackground = true 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Front Row/Support/Extensions.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Extensions.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import AVKit 9 | import Foundation 10 | import SwiftUI 11 | 12 | struct AnyDropDelegate: DropDelegate { 13 | var isTargeted: Binding? 14 | var onValidate: ((DropInfo) -> Bool)? 15 | let onPerform: (DropInfo) -> Bool 16 | var onEntered: ((DropInfo) -> Void)? 17 | var onExited: ((DropInfo) -> Void)? 18 | var onUpdated: ((DropInfo) -> DropProposal?)? 19 | 20 | func performDrop(info: DropInfo) -> Bool { 21 | onPerform(info) 22 | } 23 | 24 | func validateDrop(info: DropInfo) -> Bool { 25 | onValidate?(info) ?? true 26 | } 27 | 28 | func dropEntered(info: DropInfo) { 29 | isTargeted?.wrappedValue = true 30 | onEntered?(info) 31 | } 32 | 33 | func dropExited(info: DropInfo) { 34 | isTargeted?.wrappedValue = false 35 | onExited?(info) 36 | } 37 | 38 | func dropUpdated(info: DropInfo) -> DropProposal? { 39 | onUpdated?(info) 40 | } 41 | } 42 | 43 | extension NSItemProvider: @unchecked Sendable {} 44 | 45 | extension NSItemProvider { 46 | func loadObject(ofClass: T.Type) async throws -> T? where T: NSItemProviderReading { 47 | try await withCheckedThrowingContinuation { continuation in 48 | _ = loadObject(ofClass: ofClass) { data, error in 49 | if let error { 50 | continuation.resume(throwing: error) 51 | return 52 | } 53 | 54 | guard let object = data as? T else { 55 | continuation.resume(returning: nil) 56 | return 57 | } 58 | 59 | continuation.resume(returning: object) 60 | } 61 | } 62 | } 63 | 64 | func loadObject(ofClass: T.Type) async throws -> T? 65 | where T: _ObjectiveCBridgeable, T._ObjectiveCType: NSItemProviderReading { 66 | try await withCheckedThrowingContinuation { continuation in 67 | _ = loadObject(ofClass: ofClass) { data, error in 68 | if let error { 69 | continuation.resume(throwing: error) 70 | return 71 | } 72 | 73 | guard let data else { 74 | continuation.resume(returning: nil) 75 | return 76 | } 77 | 78 | continuation.resume(returning: data) 79 | } 80 | } 81 | } 82 | 83 | /// Get a URL from the item provider, if any. 84 | func getURL() async -> URL? { 85 | try? await loadObject(ofClass: URL.self) 86 | } 87 | } 88 | 89 | extension NSSize { 90 | var aspect: CGFloat { 91 | assert(width != 0 && height != 0) 92 | return width / height 93 | } 94 | 95 | /// Given another size S, returns a size that: 96 | 97 | /// - maintains the same aspect ratio; 98 | /// - has same height or/and width as S; 99 | /// - always smaller than S. 100 | 101 | /// - parameter toSize: The given size S. 102 | 103 | /// ``` 104 | /// +--+------+--+ 105 | /// | |The | | 106 | /// | |result| |<-- S 107 | /// | |size | | 108 | /// +--+------+--+ 109 | /// ``` 110 | func shrink(toSize size: NSSize) -> NSSize { 111 | if width == 0 || height == 0 { 112 | return size 113 | } 114 | let sizeAspect = size.aspect 115 | if aspect < sizeAspect { // self is taller, shrink to meet height 116 | return NSSize(width: size.height * aspect, height: size.height) 117 | } else { 118 | return NSSize(width: size.width, height: size.width / aspect) 119 | } 120 | } 121 | } 122 | 123 | extension AVMediaSelectionOption: Identifiable { 124 | public var id: String { 125 | let dict = propertyList() as? NSDictionary 126 | guard let dict, let id = dict.value(forKey: "MediaSelectionOptionsPersistentID") as? Int 127 | else { 128 | return displayName 129 | } 130 | guard 131 | let nonForcedSubtitles = dict.value( 132 | forKey: "MediaSelectionOptionsDisplaysNonForcedSubtitles") as? Int 133 | else { 134 | return "\(id)" 135 | } 136 | return "\(id)\(nonForcedSubtitles)" 137 | } 138 | } 139 | 140 | extension Float { 141 | static func isApproxEqual(lhs: Float, rhs: Float) -> Bool { 142 | abs(lhs - rhs) < Float.ulpOfOne 143 | } 144 | } 145 | 146 | extension TimeInterval { 147 | /// Returns value as timecode string. 148 | /// - Parameter longestTime: Used to determine if hour should be displayed 149 | /// - Returns: 0:00 or 0:00:00 150 | /// 151 | func asTimecode(using longestTime: TimeInterval) -> String { 152 | let hasHour = (longestTime / 3600.0) > 1.0 153 | if hasHour { 154 | return Duration.seconds(self).formatted( 155 | .time(pattern: .hourMinuteSecond(padHourToLength: 0))) 156 | } else { 157 | return Duration.seconds(self).formatted( 158 | .time(pattern: .minuteSecond(padMinuteToLength: 2))) 159 | } 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Front Row/Main Menu/PlaybackCommands.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlaybackCommands.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import AVKit 9 | import SwiftUI 10 | 11 | struct PlaybackCommands: Commands { 12 | @Binding var playEngine: PlayEngine 13 | @Binding var presentedViewManager: PresentedViewManager 14 | 15 | var body: some Commands { 16 | CommandMenu("Playback") { 17 | Button { 18 | playEngine.playPause() 19 | } label: { 20 | Text( 21 | playEngine.timeControlStatus == .playing ? "Pause" : "Play", 22 | comment: "Toggle playback status" 23 | ) 24 | } 25 | .keyboardShortcut(.space, modifiers: []) 26 | .disabled(!playEngine.isLoaded) 27 | 28 | Button { 29 | Task { await playEngine.goToTime(0.0) } 30 | } label: { 31 | Text( 32 | "Restart", 33 | comment: "Restart playback from the beginning" 34 | ) 35 | } 36 | .keyboardShortcut(.leftArrow, modifiers: [.command]) 37 | .disabled(!playEngine.isLoaded || presentedViewManager.isPresenting) 38 | 39 | Menu { 40 | Button { 41 | playEngine.playbackSpeed += 0.05 42 | } label: { 43 | Text( 44 | "Increase by 5%", 45 | comment: "Increase playback speed by 5%" 46 | ) 47 | } 48 | .keyboardShortcut("]", modifiers: [.command]) 49 | .disabled(!playEngine.isLoaded) 50 | 51 | Button { 52 | playEngine.playbackSpeed -= 0.05 53 | } label: { 54 | Text( 55 | "Decrease by 5%", 56 | comment: "Decrease playback speed by 5%" 57 | ) 58 | } 59 | .keyboardShortcut("[", modifiers: [.command]) 60 | .disabled(!playEngine.isLoaded) 61 | 62 | Divider() 63 | 64 | Button { 65 | playEngine.playbackSpeed = 1.0 66 | } label: { 67 | Text( 68 | "Reset", 69 | comment: "Reset playback speed to 100%" 70 | ) 71 | } 72 | .keyboardShortcut("/", modifiers: [.command]) 73 | .disabled(!playEngine.isLoaded) 74 | } label: { 75 | Text( 76 | "Speed", 77 | comment: "Playback speed" 78 | ) 79 | } 80 | 81 | Divider() 82 | 83 | Picker(selection: $playEngine.skipInterval) { 84 | ForEach(PlayEngine.skipIntervals, id: \.self) { interval in 85 | Text( 86 | "\(interval)s", 87 | comment: "Label displaying seconds" 88 | ).tag(interval) 89 | } 90 | } label: { 91 | Text( 92 | "Skip Interval", 93 | comment: "How many seconds to go forward or backward" 94 | ) 95 | } 96 | 97 | Button { 98 | Task { await playEngine.goForwards() } 99 | } label: { 100 | Text("Go Forward \(playEngine.skipInterval)s") 101 | } 102 | .keyboardShortcut(.rightArrow, modifiers: []) 103 | .disabled(!playEngine.isLoaded || presentedViewManager.isPresenting) 104 | 105 | Button { 106 | Task { await playEngine.goBackwards() } 107 | } label: { 108 | Text("Go Backward \(playEngine.skipInterval)s") 109 | } 110 | .keyboardShortcut(.leftArrow, modifiers: []) 111 | .disabled(!playEngine.isLoaded || presentedViewManager.isPresenting) 112 | 113 | Button { 114 | PresentedViewManager.shared.isPresentingGoToTimeView.toggle() 115 | } label: { 116 | Text("Go to Time...") 117 | } 118 | .keyboardShortcut("G", modifiers: [.command]) 119 | .disabled(!playEngine.isLoaded) 120 | 121 | Divider() 122 | 123 | Button { 124 | playEngine.frameStep(1) 125 | } label: { 126 | Text("Next Frame") 127 | } 128 | .keyboardShortcut(".", modifiers: []) 129 | .disabled(!playEngine.isLoaded || presentedViewManager.isPresenting) 130 | 131 | Button { 132 | playEngine.frameStep(-1) 133 | } label: { 134 | Text("Previous Frame") 135 | } 136 | .keyboardShortcut(",", modifiers: []) 137 | .disabled(!playEngine.isLoaded || presentedViewManager.isPresenting) 138 | 139 | Divider() 140 | 141 | audioTrackPicker 142 | 143 | Toggle(isOn: $playEngine.isMuted) { 144 | Text("Mute") 145 | } 146 | .keyboardShortcut("M", modifiers: []) 147 | } 148 | } 149 | 150 | @ViewBuilder private var audioTrackPicker: some View { 151 | if let group = playEngine.audioGroup { 152 | Picker("Audio Track", selection: $playEngine.audioTrack) { 153 | Text("Off").tag(nil as AVMediaSelectionOption?) 154 | ForEach(group.options) { option in 155 | Text(verbatim: option.displayName).tag(Optional(option)) 156 | } 157 | } 158 | } else { 159 | Picker("Audio Track", selection: .constant(0)) { 160 | Text("None").tag(0) 161 | } 162 | .disabled(true) 163 | } 164 | } 165 | } 166 | -------------------------------------------------------------------------------- /Front Row/Views/SeekSliderView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SeekSliderView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/26/24. 6 | // 7 | 8 | import SwiftUI 9 | 10 | struct SeekSliderView: NSViewRepresentable { 11 | typealias NSViewType = SeekSlider 12 | 13 | @Binding var value: Double 14 | var maxValue: Double 15 | 16 | class SeekSlider: NSSlider { 17 | override class var cellClass: AnyClass? { 18 | get { 19 | return SeekSliderView.SeekSliderCell.self 20 | } 21 | set { 22 | super.cellClass = SeekSliderView.SeekSliderCell.self 23 | } 24 | } 25 | } 26 | 27 | class SeekSliderCell: NSSliderCell { 28 | override var knobThickness: CGFloat { 29 | return knobWidth 30 | } 31 | 32 | let knobWidth: CGFloat = 3 33 | let knobHeight: CGFloat = 15 34 | let knobRadius: CGFloat = 1 35 | let barRadius: CGFloat = 1.5 36 | 37 | var wasPausedBeforeSeeking = false 38 | 39 | override func drawBar(inside rect: NSRect, flipped: Bool) { 40 | /// The position of the knob, rounded for cleaner drawing 41 | let knobPos: CGFloat = round(knobRect(flipped: flipped).origin.x) 42 | 43 | /// How far progressed the current video is, used for drawing the bar background 44 | let progress = knobPos 45 | 46 | NSGraphicsContext.saveGraphicsState() 47 | let barRect = rect 48 | let path = NSBezierPath(roundedRect: barRect, xRadius: barRadius, yRadius: barRadius) 49 | 50 | /// draw left 51 | let pathLeftRect: NSRect = NSMakeRect( 52 | barRect.origin.x, barRect.origin.y, progress, barRect.height) 53 | NSBezierPath(rect: pathLeftRect).addClip() 54 | 55 | path.append( 56 | NSBezierPath( 57 | rect: NSRect( 58 | x: knobPos - 1, y: barRect.origin.y, width: knobWidth + 2, 59 | height: barRect.height) 60 | ).reversed) 61 | 62 | NSColor.white.withAlphaComponent(0.3).setFill() 63 | path.fill() 64 | NSGraphicsContext.restoreGraphicsState() 65 | 66 | /// draw right 67 | NSGraphicsContext.saveGraphicsState() 68 | let pathRight = NSMakeRect( 69 | barRect.origin.x + progress, barRect.origin.y, barRect.width - progress, 70 | barRect.height) 71 | NSBezierPath(rect: pathRight).setClip() 72 | NSColor.white.withAlphaComponent(0.1).setFill() 73 | path.fill() 74 | 75 | NSGraphicsContext.restoreGraphicsState() 76 | } 77 | 78 | override func drawKnob(_ knobRect: NSRect) { 79 | let rect = NSMakeRect( 80 | round(knobRect.origin.x), 81 | knobRect.origin.y + 0.5 * (knobRect.height - knobHeight), 82 | knobRect.width, 83 | knobHeight) 84 | let path = NSBezierPath(roundedRect: rect, xRadius: knobRadius, yRadius: knobRadius) 85 | NSColor.white.withAlphaComponent(0.7).setFill() 86 | path.fill() 87 | } 88 | 89 | override func knobRect(flipped: Bool) -> NSRect { 90 | let slider = self.controlView as! NSSlider 91 | let barRect = barRect(flipped: flipped) 92 | var percentage = slider.doubleValue / (slider.maxValue - slider.minValue) 93 | if percentage.isNaN { 94 | percentage = 0.0 95 | } 96 | /// The usable width of the bar is reduced by the width of the knob. 97 | let effectiveBarWidth = barRect.width - knobWidth 98 | let pos = barRect.origin.x + CGFloat(percentage) * effectiveBarWidth 99 | let rect = super.knobRect(flipped: flipped) 100 | 101 | let height = (barRect.origin.y - rect.origin.y) * 2 + barRect.height 102 | return NSMakeRect(pos, rect.origin.y, knobWidth, height) 103 | } 104 | 105 | override func startTracking(at startPoint: NSPoint, in controlView: NSView) -> Bool { 106 | wasPausedBeforeSeeking = PlayEngine.shared.timeControlStatus == .paused 107 | let result = super.startTracking(at: startPoint, in: controlView) 108 | if result { 109 | PlayEngine.shared.pause() 110 | } 111 | return result 112 | } 113 | 114 | override func stopTracking( 115 | last lastPoint: NSPoint, 116 | current stopPoint: NSPoint, 117 | in controlView: NSView, 118 | mouseIsUp flag: Bool 119 | ) { 120 | if !wasPausedBeforeSeeking { 121 | PlayEngine.shared.play() 122 | } 123 | super.stopTracking( 124 | last: lastPoint, 125 | current: stopPoint, 126 | in: controlView, 127 | mouseIsUp: flag) 128 | } 129 | } 130 | 131 | class Coordinator: NSObject { 132 | var seekSlider: SeekSliderView 133 | 134 | init(_ slider: SeekSliderView) { 135 | self.seekSlider = slider 136 | } 137 | 138 | @objc func valueChanged(_ sender: SeekSlider) { 139 | seekSlider.value = sender.doubleValue 140 | } 141 | } 142 | 143 | func makeNSView(context: Context) -> SeekSlider { 144 | let slider = SeekSlider( 145 | value: value, 146 | minValue: 0, 147 | maxValue: maxValue, 148 | target: context.coordinator, 149 | action: #selector(Coordinator.valueChanged)) 150 | return slider 151 | } 152 | 153 | func updateNSView(_ nsView: SeekSlider, context: Context) { 154 | nsView.maxValue = maxValue 155 | nsView.doubleValue = value 156 | } 157 | 158 | func makeCoordinator() -> Coordinator { 159 | Coordinator(self) 160 | } 161 | } 162 | -------------------------------------------------------------------------------- /Front Row/Views/PlayerControlsView.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayerControlsView.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/25/24. 6 | // 7 | 8 | import AVKit 9 | import SwiftUI 10 | 11 | struct PlayerControlsView: View { 12 | @Environment(PlayEngine.self) private var playEngine: PlayEngine 13 | @AppStorage("ShowTimeRemaining") var showTimeRemaining = true 14 | private let foregroundColor = Color.white.opacity(0.7) 15 | private let disabledControlTextColor = Color(nsColor: NSColor.disabledControlTextColor) 16 | 17 | var body: some View { 18 | HStack(spacing: 8) { 19 | HStack(spacing: 16) { 20 | backwards 21 | playPause 22 | forwards 23 | } 24 | currentTime 25 | seekSlider 26 | duration 27 | speedIndicator 28 | subtitlePicker 29 | } 30 | .padding([.horizontal], 16) 31 | .padding([.vertical], 8) 32 | .background(.ultraThickMaterial) 33 | } 34 | 35 | @ViewBuilder private var backwards: some View { 36 | @Bindable var playEngine = playEngine 37 | 38 | Button { 39 | Task { await PlayEngine.shared.goBackwards() } 40 | } label: { 41 | switch playEngine.skipInterval { 42 | case 5: 43 | Image(systemName: "gobackward.5") 44 | .resizable() 45 | .scaledToFit() 46 | .foregroundStyle(foregroundColor) 47 | .frame(height: 20) 48 | case 10: 49 | Image(systemName: "gobackward.10") 50 | .resizable() 51 | .scaledToFit() 52 | .foregroundStyle(foregroundColor) 53 | .frame(height: 20) 54 | case 15: 55 | Image(systemName: "gobackward.15") 56 | .resizable() 57 | .scaledToFit() 58 | .foregroundStyle(foregroundColor) 59 | .frame(height: 20) 60 | case 30: 61 | Image(systemName: "gobackward.30") 62 | .resizable() 63 | .scaledToFit() 64 | .foregroundStyle(foregroundColor) 65 | .frame(height: 20) 66 | default: 67 | Image(systemName: "gobackward") 68 | .resizable() 69 | .scaledToFit() 70 | .foregroundStyle(foregroundColor) 71 | .frame(height: 20) 72 | } 73 | } 74 | .buttonStyle(PlainButtonStyle()) 75 | .keyboardShortcut("J", modifiers: []) 76 | .focusable(false) 77 | .disabled(!playEngine.isLoaded) 78 | } 79 | 80 | @ViewBuilder private var playPause: some View { 81 | @Bindable var playEngine = playEngine 82 | 83 | Button { 84 | PlayEngine.shared.playPause() 85 | } label: { 86 | Image( 87 | systemName: playEngine.timeControlStatus == .playing 88 | ? "pause.fill" 89 | : "play.fill" 90 | ) 91 | .resizable() 92 | .scaledToFit() 93 | .foregroundStyle(foregroundColor) 94 | .frame(width: 24, height: 24) 95 | } 96 | .buttonStyle(PlainButtonStyle()) 97 | .keyboardShortcut("K", modifiers: []) 98 | .focusable(false) 99 | .disabled(!playEngine.isLoaded) 100 | } 101 | 102 | @ViewBuilder private var forwards: some View { 103 | @Bindable var playEngine = playEngine 104 | 105 | Button { 106 | Task { await PlayEngine.shared.goForwards() } 107 | } label: { 108 | switch playEngine.skipInterval { 109 | case 5: 110 | Image(systemName: "goforward.5") 111 | .resizable() 112 | .scaledToFit() 113 | .foregroundStyle(foregroundColor) 114 | .frame(height: 20) 115 | case 10: 116 | Image(systemName: "goforward.10") 117 | .resizable() 118 | .scaledToFit() 119 | .foregroundStyle(foregroundColor) 120 | .frame(height: 20) 121 | case 15: 122 | Image(systemName: "goforward.15") 123 | .resizable() 124 | .scaledToFit() 125 | .foregroundStyle(foregroundColor) 126 | .frame(height: 20) 127 | case 30: 128 | Image(systemName: "goforward.30") 129 | .resizable() 130 | .scaledToFit() 131 | .foregroundStyle(foregroundColor) 132 | .frame(height: 20) 133 | default: 134 | Image(systemName: "goforward") 135 | .resizable() 136 | .scaledToFit() 137 | .foregroundStyle(foregroundColor) 138 | .frame(height: 20) 139 | } 140 | } 141 | .buttonStyle(PlainButtonStyle()) 142 | .keyboardShortcut("L", modifiers: []) 143 | .focusable(false) 144 | .disabled(!playEngine.isLoaded) 145 | } 146 | 147 | @ViewBuilder private var currentTime: some View { 148 | @Bindable var playEngine = playEngine 149 | 150 | Text(verbatim: playEngine.currentTime.asTimecode(using: playEngine.duration)) 151 | .font(.system(size: 11)) 152 | .foregroundStyle(playEngine.isLoaded ? foregroundColor : disabledControlTextColor) 153 | .frame(minWidth: 50, alignment: .center) 154 | } 155 | 156 | @ViewBuilder private var seekSlider: some View { 157 | @Bindable var playEngine = playEngine 158 | 159 | SeekSliderView(value: $playEngine.currentTime, maxValue: playEngine.duration) 160 | .focusable(false) 161 | .disabled(!playEngine.isLoaded) 162 | } 163 | 164 | @ViewBuilder private var duration: some View { 165 | @Bindable var playEngine = playEngine 166 | 167 | Text( 168 | verbatim: showTimeRemaining 169 | ? "-\(playEngine.timeRemaining.asTimecode(using: playEngine.duration))" 170 | : playEngine.duration.asTimecode(using: playEngine.duration) 171 | ) 172 | .font(.system(size: 11)) 173 | .foregroundStyle(playEngine.isLoaded ? foregroundColor : disabledControlTextColor) 174 | .frame(minWidth: 50, alignment: .center) 175 | .onHover { inside in 176 | if inside { 177 | NSCursor.pointingHand.push() 178 | } else { 179 | NSCursor.pop() 180 | } 181 | } 182 | .onTapGesture { 183 | showTimeRemaining.toggle() 184 | } 185 | } 186 | 187 | @ViewBuilder private var speedIndicator: some View { 188 | @Bindable var playEngine = playEngine 189 | 190 | if !Float.isApproxEqual(lhs: playEngine.playbackSpeed, rhs: 1.0) { 191 | Menu { 192 | Text("Speed") 193 | .font(.system(size: 11).weight(.semibold)) 194 | 195 | Button { 196 | playEngine.playbackSpeed += 0.05 197 | } label: { 198 | Text( 199 | "Increase by 5%", 200 | comment: "Increase playback speed by 5%" 201 | ) 202 | } 203 | 204 | Button { 205 | playEngine.playbackSpeed -= 0.05 206 | } label: { 207 | Text( 208 | "Decrease by 5%", 209 | comment: "Decrease playback speed by 5%" 210 | ) 211 | } 212 | 213 | Button { 214 | playEngine.playbackSpeed = 1.0 215 | } label: { 216 | Text( 217 | "Reset", 218 | comment: "Reset playback speed to 100%" 219 | ) 220 | } 221 | } label: { 222 | Text(verbatim: String(format: "%.2f×", playEngine.playbackSpeed)) 223 | .font(.system(size: 11)) 224 | } 225 | .menuStyle(.borderlessButton) 226 | .frame(width: 50) 227 | } 228 | } 229 | 230 | @ViewBuilder private var subtitlePicker: some View { 231 | @Bindable var playEngine = playEngine 232 | 233 | if let group = playEngine.subtitleGroup { 234 | Menu { 235 | Picker("Subtitle", selection: $playEngine.subtitle) { 236 | Text("Off").tag(nil as AVMediaSelectionOption?) 237 | 238 | let optionsWithoutForcedSubs = group.options.filter { 239 | !$0.displayName.contains("Forced") 240 | } 241 | ForEach(optionsWithoutForcedSubs) { 242 | option in 243 | Text(verbatim: option.displayName).tag(Optional(option)) 244 | } 245 | } 246 | .pickerStyle(.inline) 247 | } label: { 248 | Image(systemName: "captions.bubble") 249 | } 250 | .menuStyle(.borderlessButton) 251 | .frame(width: 40) 252 | } 253 | } 254 | } 255 | 256 | #Preview { 257 | PlayerControlsView() 258 | } 259 | -------------------------------------------------------------------------------- /Front Row/Support/PlayEngine.swift: -------------------------------------------------------------------------------- 1 | // 2 | // PlayEngine.swift 3 | // Front Row 4 | // 5 | // Created by Joshua Park on 3/4/24. 6 | // 7 | 8 | import AVKit 9 | import Combine 10 | import SwiftUI 11 | 12 | @Observable public final class PlayEngine { 13 | 14 | static let shared = PlayEngine() 15 | 16 | static let supportedFileTypes: [UTType] = [ 17 | .mp3, 18 | .mpeg2TransportStream, 19 | .mpeg4Audio, 20 | .mpeg4Movie, 21 | .quickTimeMovie, 22 | .wav, 23 | ] 24 | 25 | static let skipIntervals: [Int] = [ 26 | 5, 27 | 10, 28 | 15, 29 | 30, 30 | ] 31 | 32 | private var asset: AVAsset? 33 | 34 | private(set) var player = AVPlayer() 35 | 36 | private(set) var isLoaded = false 37 | 38 | private(set) var timeControlStatus: AVPlayer.TimeControlStatus = .paused 39 | 40 | private(set) var isLocalFile = false 41 | 42 | private var _currentTime: TimeInterval = 0.0 43 | 44 | var currentTime: Double { 45 | get { 46 | access(keyPath: \.currentTime) 47 | return _currentTime 48 | } 49 | set { 50 | withMutation(keyPath: \.currentTime) { 51 | let time = CMTimeMakeWithSeconds(newValue, preferredTimescale: 1) 52 | player.seek(to: time) 53 | updateNowPlayingInfo() 54 | } 55 | } 56 | } 57 | 58 | private(set) var duration: TimeInterval = 0.0 59 | 60 | private(set) var timeRemaining: TimeInterval = 0.0 61 | 62 | private var wasPausedBeforeSeeking = false 63 | 64 | var playbackSpeed: Float { 65 | get { 66 | access(keyPath: \.playbackSpeed) 67 | return player.defaultRate 68 | } 69 | set { 70 | withMutation(keyPath: \.playbackSpeed) { 71 | if Float.isApproxEqual(lhs: newValue, rhs: 1.0) { 72 | player.rate = 1.0 73 | player.defaultRate = 1.0 74 | return 75 | } 76 | 77 | if newValue > player.defaultRate { 78 | let newSpeed = min(newValue, 2.0) 79 | player.rate = newSpeed 80 | player.defaultRate = newSpeed 81 | } else if newValue < player.defaultRate { 82 | let newSpeed = max(newValue, 0.05) 83 | player.rate = newSpeed 84 | player.defaultRate = newSpeed 85 | } else { 86 | player.rate = newValue 87 | player.defaultRate = newValue 88 | } 89 | } 90 | } 91 | } 92 | 93 | @ObservationIgnored @AppStorage("SkipInterval") private var _skipInterval: Int = 5 94 | 95 | var skipInterval: Int { 96 | get { 97 | access(keyPath: \.skipInterval) 98 | return _skipInterval 99 | } 100 | set { 101 | withMutation(keyPath: \.skipInterval) { 102 | _skipInterval = newValue 103 | } 104 | } 105 | } 106 | 107 | private var _isMuted = false 108 | 109 | var isMuted: Bool { 110 | get { 111 | access(keyPath: \.isMuted) 112 | return _isMuted 113 | } 114 | set { 115 | withMutation(keyPath: \.isMuted) { 116 | _isMuted = newValue 117 | player.isMuted = newValue 118 | } 119 | } 120 | } 121 | 122 | private(set) var subtitleGroup: AVMediaSelectionGroup? 123 | 124 | var subtitle: AVMediaSelectionOption? { 125 | didSet { 126 | guard let subtitleGroup else { return } 127 | selectTrack(subtitle, in: subtitleGroup) 128 | } 129 | } 130 | 131 | private(set) var audioGroup: AVMediaSelectionGroup? 132 | 133 | var audioTrack: AVMediaSelectionOption? { 134 | didSet { 135 | guard let audioGroup else { return } 136 | selectTrack(audioTrack, in: audioGroup) 137 | } 138 | } 139 | 140 | private var videoSize = CGSize.zero 141 | 142 | private var subs = Set() 143 | 144 | private var currentItemSubs = Set() 145 | 146 | private var timeObserver: Any? 147 | 148 | init() { 149 | NowPlayable.shared.sessionStart() 150 | NowPlayable.shared.setupRemoteCommandHandlers(playEngine: self) 151 | 152 | player.preventsDisplaySleepDuringVideoPlayback = true 153 | player.appliesMediaSelectionCriteriaAutomatically = false 154 | 155 | player.publisher(for: \.timeControlStatus) 156 | .receive(on: DispatchQueue.main) 157 | .sink { status in 158 | self.timeControlStatus = status 159 | self.updateNowPlayingInfo() 160 | } 161 | .store(in: &subs) 162 | 163 | player.publisher(for: \.rate) 164 | .receive(on: DispatchQueue.main) 165 | .sink { rate in 166 | self.updateNowPlayingInfo() 167 | } 168 | .store(in: &subs) 169 | 170 | player.publisher(for: \.isMuted) 171 | .removeDuplicates() 172 | .receive(on: DispatchQueue.main) 173 | .sink { isMuted in 174 | self._isMuted = isMuted 175 | } 176 | .store(in: &subs) 177 | 178 | addPeriodicTimeObserver() 179 | } 180 | 181 | deinit { 182 | NowPlayable.shared.sessionEnd() 183 | NowPlayable.shared.removeRemoteCommandHandlers() 184 | for sub in currentItemSubs { sub.cancel() } 185 | currentItemSubs.removeAll() 186 | removePeriodicTimeObserver() 187 | } 188 | 189 | /// Attempts to open file at url. If its not playable, returns false. 190 | /// - Parameter url: A URL to a local, remote, or HTTP Live Streaming media resource. 191 | /// - Returns: A Boolean value that indicates whether an asset contains playable content. 192 | @MainActor 193 | @discardableResult func openFile(url: URL) async -> Bool { 194 | if asset != nil { 195 | asset!.cancelLoading() 196 | } 197 | asset = AVURLAsset(url: url) 198 | do { 199 | let isPlayable = try await asset!.load(.isPlayable) 200 | guard isPlayable else { return false } 201 | 202 | if let subtitleGroup = try await asset!.loadMediaSelectionGroup(for: .legible) { 203 | self.subtitleGroup = subtitleGroup 204 | } else { 205 | self.subtitleGroup = nil 206 | } 207 | 208 | if let audioGroup = try await asset!.loadMediaSelectionGroup(for: .audible) { 209 | self.audioGroup = audioGroup 210 | } else { 211 | self.audioGroup = nil 212 | } 213 | } catch { 214 | return false 215 | } 216 | 217 | for sub in currentItemSubs { sub.cancel() } 218 | currentItemSubs.removeAll() 219 | 220 | let playerItem = AVPlayerItem(asset: asset!) 221 | 222 | playerItem.publisher(for: \.status) 223 | .removeDuplicates() 224 | .receive(on: DispatchQueue.main) 225 | .sink { [weak self] status in 226 | guard let self else { return } 227 | switch status { 228 | case .readyToPlay: 229 | isLoaded = true 230 | isLocalFile = FileManager.default.fileExists( 231 | atPath: url.path(percentEncoded: false)) 232 | NowPlayable.shared.setNowPlayingMetadata( 233 | NowPlayableStaticMetadata( 234 | assetURL: url, mediaType: videoSize == CGSize.zero ? .audio : .video, 235 | title: url.lastPathComponent)) 236 | updateNowPlayingInfo() 237 | case .failed: 238 | isLoaded = false 239 | isLocalFile = false 240 | NowPlayable.shared.sessionEnd() 241 | default: 242 | break 243 | } 244 | } 245 | .store(in: ¤tItemSubs) 246 | 247 | playerItem.publisher(for: \.presentationSize) 248 | .removeDuplicates() 249 | .receive(on: DispatchQueue.main) 250 | .sink { [weak self] size in 251 | guard let self else { return } 252 | videoSize = size 253 | fitToVideoSize(skipResize: WindowController.shared.isFullscreen) 254 | } 255 | .store(in: ¤tItemSubs) 256 | 257 | player.replaceCurrentItem(with: playerItem) 258 | player.play() 259 | 260 | if let subtitleGroup { 261 | subtitle = subtitleGroup.options.first 262 | } else { 263 | subtitle = nil 264 | } 265 | 266 | if let audioGroup { 267 | audioTrack = audioGroup.options.first 268 | } else { 269 | audioTrack = nil 270 | } 271 | 272 | return true 273 | } 274 | 275 | func cancelLoading() { 276 | guard let asset else { return } 277 | 278 | asset.cancelLoading() 279 | } 280 | 281 | func play() { 282 | guard isLoaded else { return } 283 | 284 | player.play() 285 | } 286 | 287 | func pause() { 288 | guard isLoaded else { return } 289 | 290 | player.pause() 291 | } 292 | 293 | func playPause() { 294 | guard isLoaded else { return } 295 | 296 | if timeControlStatus == .playing { 297 | pause() 298 | } else { 299 | play() 300 | } 301 | } 302 | 303 | func goForwards() async { 304 | guard isLoaded else { return } 305 | 306 | /// If needed pause playback to improve seek performance 307 | pausePlaybackIfNeeded() 308 | 309 | let time = CMTimeAdd( 310 | player.currentTime(), 311 | CMTimeMakeWithSeconds(Double(skipInterval), preferredTimescale: 1) 312 | ) 313 | await player.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) 314 | 315 | resumePlaybackIfNeeded() 316 | } 317 | 318 | func goBackwards() async { 319 | guard isLoaded else { return } 320 | 321 | /// If needed pause playback to improve seek performance 322 | pausePlaybackIfNeeded() 323 | 324 | let time = CMTimeSubtract( 325 | player.currentTime(), 326 | CMTimeMakeWithSeconds(Double(skipInterval), preferredTimescale: 1) 327 | ) 328 | await player.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) 329 | 330 | resumePlaybackIfNeeded() 331 | } 332 | 333 | func goToTime(_ timecode: Double) async { 334 | guard isLoaded else { return } 335 | 336 | let time = CMTimeMakeWithSeconds(timecode, preferredTimescale: 1) 337 | await player.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) 338 | updateNowPlayingInfo() 339 | } 340 | 341 | func goToTime(_ timecode: String) async { 342 | guard isLoaded, let item = player.currentItem else { return } 343 | 344 | let split = Array(timecode.split(separator: ":").reversed()) 345 | 346 | let _hour: Int? = split.count > 2 ? Int(split[2]) : nil 347 | let _minute: Int? = split.count > 1 ? Int(split[1]) : nil 348 | let _second: Double? = !split.isEmpty ? Double(split[0]) : nil 349 | 350 | if _hour == nil && _minute == nil && _second == nil { 351 | return 352 | } 353 | 354 | let hour = _hour ?? 0 355 | let minute = _minute ?? 0 356 | let second = _second ?? 0.0 357 | let time = CMTimeMakeWithSeconds( 358 | Double(hour * 3600 + minute * 60) + second, preferredTimescale: 1) 359 | 360 | let validRange = CMTimeRange(start: .zero, end: item.duration) 361 | guard validRange.containsTime(time) else { return } 362 | await player.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) 363 | updateNowPlayingInfo() 364 | } 365 | 366 | @MainActor 367 | func frameStep(_ byCount: Int) { 368 | guard isLoaded, let item = player.currentItem else { return } 369 | 370 | item.step(byCount: byCount) 371 | } 372 | 373 | func fitToVideoSize(skipResize: Bool = false) { 374 | guard let window = NSApp.windows.first else { return } 375 | guard videoSize != CGSize.zero else { 376 | /// reset aspect ratio setting 377 | window.resizeIncrements = NSMakeSize(1.0, 1.0) 378 | return 379 | } 380 | 381 | let screenFrame = (window.screen ?? NSScreen.main!).visibleFrame 382 | let newFrame: NSRect 383 | 384 | if videoSize.width < screenFrame.width && videoSize.height < screenFrame.height { 385 | let newOrigin = CGPoint( 386 | x: screenFrame.origin.x + (screenFrame.width - videoSize.width) / 2, 387 | y: screenFrame.origin.y + (screenFrame.height - videoSize.height) / 2 388 | ) 389 | newFrame = NSRect(origin: newOrigin, size: videoSize) 390 | } else { 391 | let newSize = videoSize.shrink(toSize: screenFrame.size) 392 | let newOrigin = CGPoint( 393 | x: screenFrame.origin.x + (screenFrame.width - newSize.width) / 2, 394 | y: screenFrame.origin.y + (screenFrame.height - newSize.height) / 2 395 | ) 396 | newFrame = NSRect(origin: newOrigin, size: newSize) 397 | } 398 | if !skipResize { 399 | window.setFrame(newFrame, display: true, animate: true) 400 | } 401 | window.aspectRatio = videoSize 402 | } 403 | 404 | private func pausePlaybackIfNeeded() { 405 | guard player.rate != 0 else { return } 406 | wasPausedBeforeSeeking = true 407 | player.rate = 0 408 | } 409 | 410 | private func resumePlaybackIfNeeded() { 411 | guard wasPausedBeforeSeeking else { return } 412 | player.rate = player.defaultRate 413 | wasPausedBeforeSeeking = false 414 | } 415 | 416 | private func selectTrack(_ option: AVMediaSelectionOption?, in group: AVMediaSelectionGroup) { 417 | guard let item = player.currentItem else { return } 418 | item.select(option, in: group) 419 | } 420 | 421 | private func addPeriodicTimeObserver() { 422 | let interval = CMTime(seconds: 0.5, preferredTimescale: CMTimeScale(NSEC_PER_SEC)) 423 | timeObserver = player.addPeriodicTimeObserver( 424 | forInterval: interval, 425 | queue: .main 426 | ) { [weak self] time in 427 | guard let self else { return } 428 | _currentTime = time.seconds 429 | 430 | guard let duration = player.currentItem?.duration.seconds else { return } 431 | guard !duration.isNaN && !duration.isInfinite else { return } 432 | self.duration = duration 433 | timeRemaining = duration - _currentTime 434 | } 435 | } 436 | 437 | private func removePeriodicTimeObserver() { 438 | guard let timeObserver else { return } 439 | player.removeTimeObserver(timeObserver) 440 | self.timeObserver = nil 441 | } 442 | 443 | private func updateNowPlayingInfo() { 444 | NowPlayable.shared.setNowPlayingPlaybackInfo( 445 | playing: timeControlStatus == .playing, 446 | NowPlayableDynamicMetadata( 447 | rate: player.rate, 448 | position: Float(currentTime), 449 | duration: Float(duration) 450 | ) 451 | ) 452 | } 453 | } 454 | -------------------------------------------------------------------------------- /Front Row.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 56; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 032BBB1E2B9FF671003D2FA8 /* WindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 032BBB1D2B9FF671003D2FA8 /* WindowController.swift */; }; 11 | 032EAF5D2DE9132600D31519 /* NowPlayable+RemoteCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 032EAF5C2DE9132600D31519 /* NowPlayable+RemoteCommands.swift */; }; 12 | 033D450A2BB37FCA001AEBAA /* SeekSliderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 033D45092BB37FCA001AEBAA /* SeekSliderView.swift */; }; 13 | 03407ADD2BA90F1100FB4323 /* WindowCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03407ADC2BA90F1100FB4323 /* WindowCommands.swift */; }; 14 | 0355CA552BA790E5001AF5EA /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 0355CA542BA790E5001AF5EA /* Localizable.xcstrings */; }; 15 | 03B2590E2BB242620071FF7C /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03B2590D2BB242620071FF7C /* PlayerView.swift */; }; 16 | 03B259102BB249310071FF7C /* PlayerControlsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03B2590F2BB249310071FF7C /* PlayerControlsView.swift */; }; 17 | 03B712272B96C40C00C1F753 /* AVKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03B712262B96C40C00C1F753 /* AVKit.framework */; }; 18 | 03C112BF2DB56BFF00AE6799 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 03C112BE2DB56BFF00AE6799 /* Sparkle */; }; 19 | 03D77E952B9AA13700276A45 /* HelpCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D77E942B9AA13700276A45 /* HelpCommands.swift */; }; 20 | 03DEE9E32DE54F93002E05B9 /* NowPlayable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03DEE9E22DE54F90002E05B9 /* NowPlayable.swift */; }; 21 | 03DEE9E62DE5600F002E05B9 /* KeyDownListener.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03DEE9E52DE5600B002E05B9 /* KeyDownListener.swift */; }; 22 | 03E78C582BA7D2D40063BF06 /* OpenURLView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E78C572BA7D2D40063BF06 /* OpenURLView.swift */; }; 23 | 03E8F3DD2B9F7B350008CE49 /* AppCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8F3DC2B9F7B350008CE49 /* AppCommands.swift */; }; 24 | 03EA68512B9630CF003348BE /* FrontRowApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA68502B9630CF003348BE /* FrontRowApp.swift */; }; 25 | 03EA68532B9630CF003348BE /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA68522B9630CF003348BE /* ContentView.swift */; }; 26 | 03EA68552B9630D0003348BE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03EA68542B9630D0003348BE /* Assets.xcassets */; }; 27 | 03EA68582B9630D0003348BE /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 03EA68572B9630D0003348BE /* Preview Assets.xcassets */; }; 28 | 03EA68612B96523B003348BE /* FileCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA68602B96523B003348BE /* FileCommands.swift */; }; 29 | 03EA68642B965322003348BE /* PlaybackCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA68632B965322003348BE /* PlaybackCommands.swift */; }; 30 | 03EA68672B9654A0003348BE /* PlayEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA68662B9654A0003348BE /* PlayEngine.swift */; }; 31 | 03EA686E2B968D92003348BE /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA686D2B968D92003348BE /* Extensions.swift */; }; 32 | 03EA68702B96BAD1003348BE /* ViewCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EA686F2B96BAD1003348BE /* ViewCommands.swift */; }; 33 | 03EE7B0C2BA9F396009F68C5 /* GoToTimeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EE7B0B2BA9F396009F68C5 /* GoToTimeView.swift */; }; 34 | 03EE7B0E2BAA5176009F68C5 /* PresentedViewManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03EE7B0D2BAA5176009F68C5 /* PresentedViewManager.swift */; }; 35 | /* End PBXBuildFile section */ 36 | 37 | /* Begin PBXFileReference section */ 38 | 032BBB1D2B9FF671003D2FA8 /* WindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowController.swift; sourceTree = ""; }; 39 | 032EAF5C2DE9132600D31519 /* NowPlayable+RemoteCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NowPlayable+RemoteCommands.swift"; sourceTree = ""; }; 40 | 033D45092BB37FCA001AEBAA /* SeekSliderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeekSliderView.swift; sourceTree = ""; }; 41 | 03407ADC2BA90F1100FB4323 /* WindowCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowCommands.swift; sourceTree = ""; }; 42 | 0355CA542BA790E5001AF5EA /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = ""; }; 43 | 03B2590D2BB242620071FF7C /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; 44 | 03B2590F2BB249310071FF7C /* PlayerControlsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerControlsView.swift; sourceTree = ""; }; 45 | 03B712262B96C40C00C1F753 /* AVKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVKit.framework; path = System/Library/Frameworks/AVKit.framework; sourceTree = SDKROOT; }; 46 | 03BACB2D2B96C8A800D24F07 /* FrontRowInfo.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = FrontRowInfo.plist; sourceTree = SOURCE_ROOT; }; 47 | 03D77E942B9AA13700276A45 /* HelpCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpCommands.swift; sourceTree = ""; }; 48 | 03DEE9E22DE54F90002E05B9 /* NowPlayable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NowPlayable.swift; sourceTree = ""; }; 49 | 03DEE9E52DE5600B002E05B9 /* KeyDownListener.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyDownListener.swift; sourceTree = ""; }; 50 | 03E78C572BA7D2D40063BF06 /* OpenURLView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OpenURLView.swift; sourceTree = ""; }; 51 | 03E8F3DC2B9F7B350008CE49 /* AppCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppCommands.swift; sourceTree = ""; }; 52 | 03EA684D2B9630CF003348BE /* Front Row.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Front Row.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | 03EA68502B9630CF003348BE /* FrontRowApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontRowApp.swift; sourceTree = ""; }; 54 | 03EA68522B9630CF003348BE /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = ""; }; 55 | 03EA68542B9630D0003348BE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | 03EA68572B9630D0003348BE /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = ""; }; 57 | 03EA68592B9630D0003348BE /* FrontRow.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = FrontRow.entitlements; sourceTree = ""; }; 58 | 03EA68602B96523B003348BE /* FileCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileCommands.swift; sourceTree = ""; }; 59 | 03EA68632B965322003348BE /* PlaybackCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackCommands.swift; sourceTree = ""; }; 60 | 03EA68662B9654A0003348BE /* PlayEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayEngine.swift; sourceTree = ""; }; 61 | 03EA686D2B968D92003348BE /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = ""; }; 62 | 03EA686F2B96BAD1003348BE /* ViewCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewCommands.swift; sourceTree = ""; }; 63 | 03EE7B0B2BA9F396009F68C5 /* GoToTimeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoToTimeView.swift; sourceTree = ""; }; 64 | 03EE7B0D2BAA5176009F68C5 /* PresentedViewManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PresentedViewManager.swift; sourceTree = ""; }; 65 | /* End PBXFileReference section */ 66 | 67 | /* Begin PBXFrameworksBuildPhase section */ 68 | 03EA684A2B9630CF003348BE /* Frameworks */ = { 69 | isa = PBXFrameworksBuildPhase; 70 | buildActionMask = 2147483647; 71 | files = ( 72 | 03B712272B96C40C00C1F753 /* AVKit.framework in Frameworks */, 73 | 03C112BF2DB56BFF00AE6799 /* Sparkle in Frameworks */, 74 | ); 75 | runOnlyForDeploymentPostprocessing = 0; 76 | }; 77 | /* End PBXFrameworksBuildPhase section */ 78 | 79 | /* Begin PBXGroup section */ 80 | 03B712252B96C40C00C1F753 /* Frameworks */ = { 81 | isa = PBXGroup; 82 | children = ( 83 | 03B712262B96C40C00C1F753 /* AVKit.framework */, 84 | ); 85 | name = Frameworks; 86 | sourceTree = ""; 87 | }; 88 | 03EA68442B9630CF003348BE = { 89 | isa = PBXGroup; 90 | children = ( 91 | 03B712252B96C40C00C1F753 /* Frameworks */, 92 | 03EA684F2B9630CF003348BE /* Front Row */, 93 | 03EA684E2B9630CF003348BE /* Products */, 94 | ); 95 | sourceTree = ""; 96 | }; 97 | 03EA684E2B9630CF003348BE /* Products */ = { 98 | isa = PBXGroup; 99 | children = ( 100 | 03EA684D2B9630CF003348BE /* Front Row.app */, 101 | ); 102 | name = Products; 103 | sourceTree = ""; 104 | }; 105 | 03EA684F2B9630CF003348BE /* Front Row */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 03EA68592B9630D0003348BE /* FrontRow.entitlements */, 109 | 03BACB2D2B96C8A800D24F07 /* FrontRowInfo.plist */, 110 | 03EA68502B9630CF003348BE /* FrontRowApp.swift */, 111 | 03EA68542B9630D0003348BE /* Assets.xcassets */, 112 | 0355CA542BA790E5001AF5EA /* Localizable.xcstrings */, 113 | 03EA685F2B965224003348BE /* Main Menu */, 114 | 03EA68562B9630D0003348BE /* Preview Content */, 115 | 03EA686C2B968D86003348BE /* Support */, 116 | 03EA68652B965424003348BE /* Views */, 117 | ); 118 | path = "Front Row"; 119 | sourceTree = ""; 120 | }; 121 | 03EA68562B9630D0003348BE /* Preview Content */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 03EA68572B9630D0003348BE /* Preview Assets.xcassets */, 125 | ); 126 | path = "Preview Content"; 127 | sourceTree = ""; 128 | }; 129 | 03EA685F2B965224003348BE /* Main Menu */ = { 130 | isa = PBXGroup; 131 | children = ( 132 | 03E8F3DC2B9F7B350008CE49 /* AppCommands.swift */, 133 | 03EA68602B96523B003348BE /* FileCommands.swift */, 134 | 03EA686F2B96BAD1003348BE /* ViewCommands.swift */, 135 | 03EA68632B965322003348BE /* PlaybackCommands.swift */, 136 | 03407ADC2BA90F1100FB4323 /* WindowCommands.swift */, 137 | 03D77E942B9AA13700276A45 /* HelpCommands.swift */, 138 | ); 139 | path = "Main Menu"; 140 | sourceTree = ""; 141 | }; 142 | 03EA68652B965424003348BE /* Views */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 03EA68522B9630CF003348BE /* ContentView.swift */, 146 | 03EE7B0B2BA9F396009F68C5 /* GoToTimeView.swift */, 147 | 03E78C572BA7D2D40063BF06 /* OpenURLView.swift */, 148 | 03B2590F2BB249310071FF7C /* PlayerControlsView.swift */, 149 | 03B2590D2BB242620071FF7C /* PlayerView.swift */, 150 | 033D45092BB37FCA001AEBAA /* SeekSliderView.swift */, 151 | ); 152 | path = Views; 153 | sourceTree = ""; 154 | }; 155 | 03EA686C2B968D86003348BE /* Support */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 03EA686D2B968D92003348BE /* Extensions.swift */, 159 | 03DEE9E52DE5600B002E05B9 /* KeyDownListener.swift */, 160 | 03DEE9E22DE54F90002E05B9 /* NowPlayable.swift */, 161 | 032EAF5C2DE9132600D31519 /* NowPlayable+RemoteCommands.swift */, 162 | 03EA68662B9654A0003348BE /* PlayEngine.swift */, 163 | 03EE7B0D2BAA5176009F68C5 /* PresentedViewManager.swift */, 164 | 032BBB1D2B9FF671003D2FA8 /* WindowController.swift */, 165 | ); 166 | path = Support; 167 | sourceTree = ""; 168 | }; 169 | /* End PBXGroup section */ 170 | 171 | /* Begin PBXNativeTarget section */ 172 | 03EA684C2B9630CF003348BE /* Front Row */ = { 173 | isa = PBXNativeTarget; 174 | buildConfigurationList = 03EA685C2B9630D0003348BE /* Build configuration list for PBXNativeTarget "Front Row" */; 175 | buildPhases = ( 176 | 0328BCEA2BA12090004B5AE0 /* ShellScript */, 177 | 03EA68492B9630CF003348BE /* Sources */, 178 | 03EA684A2B9630CF003348BE /* Frameworks */, 179 | 03EA684B2B9630CF003348BE /* Resources */, 180 | ); 181 | buildRules = ( 182 | ); 183 | dependencies = ( 184 | ); 185 | name = "Front Row"; 186 | packageProductDependencies = ( 187 | 03C112BE2DB56BFF00AE6799 /* Sparkle */, 188 | ); 189 | productName = "Front Row"; 190 | productReference = 03EA684D2B9630CF003348BE /* Front Row.app */; 191 | productType = "com.apple.product-type.application"; 192 | }; 193 | /* End PBXNativeTarget section */ 194 | 195 | /* Begin PBXProject section */ 196 | 03EA68452B9630CF003348BE /* Project object */ = { 197 | isa = PBXProject; 198 | attributes = { 199 | BuildIndependentTargetsInParallel = 1; 200 | LastSwiftUpdateCheck = 1520; 201 | LastUpgradeCheck = 1620; 202 | TargetAttributes = { 203 | 03EA684C2B9630CF003348BE = { 204 | CreatedOnToolsVersion = 15.2; 205 | }; 206 | }; 207 | }; 208 | buildConfigurationList = 03EA68482B9630CF003348BE /* Build configuration list for PBXProject "Front Row" */; 209 | compatibilityVersion = "Xcode 14.0"; 210 | developmentRegion = en; 211 | hasScannedForEncodings = 0; 212 | knownRegions = ( 213 | en, 214 | Base, 215 | ar, 216 | "zh-Hans", 217 | "zh-Hant", 218 | cs, 219 | da, 220 | nl, 221 | fi, 222 | fr, 223 | de, 224 | el, 225 | he, 226 | hu, 227 | it, 228 | ja, 229 | ko, 230 | pl, 231 | ro, 232 | ru, 233 | es, 234 | sv, 235 | tr, 236 | uk, 237 | vi, 238 | ); 239 | mainGroup = 03EA68442B9630CF003348BE; 240 | packageReferences = ( 241 | 03C112BD2DB56BFF00AE6799 /* XCRemoteSwiftPackageReference "Sparkle" */, 242 | ); 243 | productRefGroup = 03EA684E2B9630CF003348BE /* Products */; 244 | projectDirPath = ""; 245 | projectRoot = ""; 246 | targets = ( 247 | 03EA684C2B9630CF003348BE /* Front Row */, 248 | ); 249 | }; 250 | /* End PBXProject section */ 251 | 252 | /* Begin PBXResourcesBuildPhase section */ 253 | 03EA684B2B9630CF003348BE /* Resources */ = { 254 | isa = PBXResourcesBuildPhase; 255 | buildActionMask = 2147483647; 256 | files = ( 257 | 03EA68582B9630D0003348BE /* Preview Assets.xcassets in Resources */, 258 | 03EA68552B9630D0003348BE /* Assets.xcassets in Resources */, 259 | 0355CA552BA790E5001AF5EA /* Localizable.xcstrings in Resources */, 260 | ); 261 | runOnlyForDeploymentPostprocessing = 0; 262 | }; 263 | /* End PBXResourcesBuildPhase section */ 264 | 265 | /* Begin PBXShellScriptBuildPhase section */ 266 | 0328BCEA2BA12090004B5AE0 /* ShellScript */ = { 267 | isa = PBXShellScriptBuildPhase; 268 | alwaysOutOfDate = 1; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputFileListPaths = ( 273 | ); 274 | inputPaths = ( 275 | ); 276 | outputFileListPaths = ( 277 | ); 278 | outputPaths = ( 279 | ); 280 | runOnlyForDeploymentPostprocessing = 0; 281 | shellPath = /bin/sh; 282 | shellScript = "export PATH=\"$PATH:/opt/homebrew/bin\"\nif which swift-format > /dev/null; then\n swift-format lint -s -p -r ./\nelse\n echo \"warning: swift-format not installed, download from https://github.com/apple/swift-format\"\nfi\n"; 283 | }; 284 | /* End PBXShellScriptBuildPhase section */ 285 | 286 | /* Begin PBXSourcesBuildPhase section */ 287 | 03EA68492B9630CF003348BE /* Sources */ = { 288 | isa = PBXSourcesBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | 03E78C582BA7D2D40063BF06 /* OpenURLView.swift in Sources */, 292 | 03DEE9E62DE5600F002E05B9 /* KeyDownListener.swift in Sources */, 293 | 033D450A2BB37FCA001AEBAA /* SeekSliderView.swift in Sources */, 294 | 03B259102BB249310071FF7C /* PlayerControlsView.swift in Sources */, 295 | 032EAF5D2DE9132600D31519 /* NowPlayable+RemoteCommands.swift in Sources */, 296 | 03407ADD2BA90F1100FB4323 /* WindowCommands.swift in Sources */, 297 | 03EA68532B9630CF003348BE /* ContentView.swift in Sources */, 298 | 03B2590E2BB242620071FF7C /* PlayerView.swift in Sources */, 299 | 03EA68612B96523B003348BE /* FileCommands.swift in Sources */, 300 | 03E8F3DD2B9F7B350008CE49 /* AppCommands.swift in Sources */, 301 | 03EA68702B96BAD1003348BE /* ViewCommands.swift in Sources */, 302 | 03EE7B0E2BAA5176009F68C5 /* PresentedViewManager.swift in Sources */, 303 | 03EE7B0C2BA9F396009F68C5 /* GoToTimeView.swift in Sources */, 304 | 03D77E952B9AA13700276A45 /* HelpCommands.swift in Sources */, 305 | 03DEE9E32DE54F93002E05B9 /* NowPlayable.swift in Sources */, 306 | 03EA68672B9654A0003348BE /* PlayEngine.swift in Sources */, 307 | 03EA68642B965322003348BE /* PlaybackCommands.swift in Sources */, 308 | 03EA68512B9630CF003348BE /* FrontRowApp.swift in Sources */, 309 | 03EA686E2B968D92003348BE /* Extensions.swift in Sources */, 310 | 032BBB1E2B9FF671003D2FA8 /* WindowController.swift in Sources */, 311 | ); 312 | runOnlyForDeploymentPostprocessing = 0; 313 | }; 314 | /* End PBXSourcesBuildPhase section */ 315 | 316 | /* Begin XCBuildConfiguration section */ 317 | 03EA685A2B9630D0003348BE /* Debug */ = { 318 | isa = XCBuildConfiguration; 319 | buildSettings = { 320 | ALWAYS_SEARCH_USER_PATHS = NO; 321 | ARCHS = arm64; 322 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 323 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 324 | CLANG_ANALYZER_NONNULL = YES; 325 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 326 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 327 | CLANG_ENABLE_MODULES = YES; 328 | CLANG_ENABLE_OBJC_ARC = YES; 329 | CLANG_ENABLE_OBJC_WEAK = YES; 330 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 331 | CLANG_WARN_BOOL_CONVERSION = YES; 332 | CLANG_WARN_COMMA = YES; 333 | CLANG_WARN_CONSTANT_CONVERSION = YES; 334 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 335 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 336 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 337 | CLANG_WARN_EMPTY_BODY = YES; 338 | CLANG_WARN_ENUM_CONVERSION = YES; 339 | CLANG_WARN_INFINITE_RECURSION = YES; 340 | CLANG_WARN_INT_CONVERSION = YES; 341 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 342 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 343 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 344 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 345 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 346 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 347 | CLANG_WARN_STRICT_PROTOTYPES = YES; 348 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 349 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | COPY_PHASE_STRIP = NO; 353 | DEAD_CODE_STRIPPING = YES; 354 | DEBUG_INFORMATION_FORMAT = dwarf; 355 | ENABLE_STRICT_OBJC_MSGSEND = YES; 356 | ENABLE_TESTABILITY = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu17; 358 | GCC_DYNAMIC_NO_PIC = NO; 359 | GCC_NO_COMMON_BLOCKS = YES; 360 | GCC_OPTIMIZATION_LEVEL = 0; 361 | GCC_PREPROCESSOR_DEFINITIONS = ( 362 | "DEBUG=1", 363 | "$(inherited)", 364 | ); 365 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 366 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 367 | GCC_WARN_UNDECLARED_SELECTOR = YES; 368 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 369 | GCC_WARN_UNUSED_FUNCTION = YES; 370 | GCC_WARN_UNUSED_VARIABLE = YES; 371 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 372 | MACOSX_DEPLOYMENT_TARGET = 14.2; 373 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; 374 | MTL_FAST_MATH = YES; 375 | ONLY_ACTIVE_ARCH = YES; 376 | SDKROOT = macosx; 377 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; 378 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 379 | SWIFT_VERSION = 6.0; 380 | }; 381 | name = Debug; 382 | }; 383 | 03EA685B2B9630D0003348BE /* Release */ = { 384 | isa = XCBuildConfiguration; 385 | buildSettings = { 386 | ALWAYS_SEARCH_USER_PATHS = NO; 387 | ARCHS = arm64; 388 | ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; 389 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 390 | CLANG_ANALYZER_NONNULL = YES; 391 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 392 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; 393 | CLANG_ENABLE_MODULES = YES; 394 | CLANG_ENABLE_OBJC_ARC = YES; 395 | CLANG_ENABLE_OBJC_WEAK = YES; 396 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 397 | CLANG_WARN_BOOL_CONVERSION = YES; 398 | CLANG_WARN_COMMA = YES; 399 | CLANG_WARN_CONSTANT_CONVERSION = YES; 400 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 402 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 403 | CLANG_WARN_EMPTY_BODY = YES; 404 | CLANG_WARN_ENUM_CONVERSION = YES; 405 | CLANG_WARN_INFINITE_RECURSION = YES; 406 | CLANG_WARN_INT_CONVERSION = YES; 407 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 408 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 409 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 410 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 411 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 412 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 413 | CLANG_WARN_STRICT_PROTOTYPES = YES; 414 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 415 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 416 | CLANG_WARN_UNREACHABLE_CODE = YES; 417 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 418 | COPY_PHASE_STRIP = NO; 419 | DEAD_CODE_STRIPPING = YES; 420 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 421 | ENABLE_NS_ASSERTIONS = NO; 422 | ENABLE_STRICT_OBJC_MSGSEND = YES; 423 | GCC_C_LANGUAGE_STANDARD = gnu17; 424 | GCC_NO_COMMON_BLOCKS = YES; 425 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 426 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 427 | GCC_WARN_UNDECLARED_SELECTOR = YES; 428 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 429 | GCC_WARN_UNUSED_FUNCTION = YES; 430 | GCC_WARN_UNUSED_VARIABLE = YES; 431 | LOCALIZATION_PREFERS_STRING_CATALOGS = YES; 432 | MACOSX_DEPLOYMENT_TARGET = 14.2; 433 | MTL_ENABLE_DEBUG_INFO = NO; 434 | MTL_FAST_MATH = YES; 435 | SDKROOT = macosx; 436 | SWIFT_COMPILATION_MODE = wholemodule; 437 | SWIFT_VERSION = 6.0; 438 | }; 439 | name = Release; 440 | }; 441 | 03EA685D2B9630D0003348BE /* Debug */ = { 442 | isa = XCBuildConfiguration; 443 | buildSettings = { 444 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 445 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 446 | CODE_SIGN_ENTITLEMENTS = "Front Row/FrontRow.entitlements"; 447 | CODE_SIGN_STYLE = Automatic; 448 | COMBINE_HIDPI_IMAGES = YES; 449 | CURRENT_PROJECT_VERSION = 18; 450 | DEVELOPMENT_ASSET_PATHS = "\"Front Row/Preview Content\""; 451 | DEVELOPMENT_TEAM = TCQ6328PP6; 452 | ENABLE_HARDENED_RUNTIME = YES; 453 | ENABLE_PREVIEWS = YES; 454 | GENERATE_INFOPLIST_FILE = YES; 455 | INFOPLIST_FILE = FrontRowInfo.plist; 456 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video"; 457 | INFOPLIST_KEY_NSHumanReadableCopyright = "By Joshua Park"; 458 | LD_RUNPATH_SEARCH_PATHS = ( 459 | "$(inherited)", 460 | "@executable_path/../Frameworks", 461 | ); 462 | MACOSX_DEPLOYMENT_TARGET = 15.0; 463 | MARKETING_VERSION = 2.6; 464 | PRODUCT_BUNDLE_IDENTIFIER = dev.joshuapark.FrontRow; 465 | PRODUCT_NAME = "$(TARGET_NAME)"; 466 | SWIFT_EMIT_LOC_STRINGS = YES; 467 | SWIFT_VERSION = 5.0; 468 | }; 469 | name = Debug; 470 | }; 471 | 03EA685E2B9630D0003348BE /* Release */ = { 472 | isa = XCBuildConfiguration; 473 | buildSettings = { 474 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 475 | ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; 476 | CODE_SIGN_ENTITLEMENTS = "Front Row/FrontRow.entitlements"; 477 | CODE_SIGN_STYLE = Automatic; 478 | COMBINE_HIDPI_IMAGES = YES; 479 | CURRENT_PROJECT_VERSION = 18; 480 | DEVELOPMENT_ASSET_PATHS = "\"Front Row/Preview Content\""; 481 | DEVELOPMENT_TEAM = TCQ6328PP6; 482 | ENABLE_HARDENED_RUNTIME = YES; 483 | ENABLE_PREVIEWS = YES; 484 | GENERATE_INFOPLIST_FILE = YES; 485 | INFOPLIST_FILE = FrontRowInfo.plist; 486 | INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.video"; 487 | INFOPLIST_KEY_NSHumanReadableCopyright = "By Joshua Park"; 488 | LD_RUNPATH_SEARCH_PATHS = ( 489 | "$(inherited)", 490 | "@executable_path/../Frameworks", 491 | ); 492 | MACOSX_DEPLOYMENT_TARGET = 15.0; 493 | MARKETING_VERSION = 2.6; 494 | PRODUCT_BUNDLE_IDENTIFIER = dev.joshuapark.FrontRow; 495 | PRODUCT_NAME = "$(TARGET_NAME)"; 496 | SWIFT_EMIT_LOC_STRINGS = YES; 497 | SWIFT_VERSION = 5.0; 498 | }; 499 | name = Release; 500 | }; 501 | /* End XCBuildConfiguration section */ 502 | 503 | /* Begin XCConfigurationList section */ 504 | 03EA68482B9630CF003348BE /* Build configuration list for PBXProject "Front Row" */ = { 505 | isa = XCConfigurationList; 506 | buildConfigurations = ( 507 | 03EA685A2B9630D0003348BE /* Debug */, 508 | 03EA685B2B9630D0003348BE /* Release */, 509 | ); 510 | defaultConfigurationIsVisible = 0; 511 | defaultConfigurationName = Release; 512 | }; 513 | 03EA685C2B9630D0003348BE /* Build configuration list for PBXNativeTarget "Front Row" */ = { 514 | isa = XCConfigurationList; 515 | buildConfigurations = ( 516 | 03EA685D2B9630D0003348BE /* Debug */, 517 | 03EA685E2B9630D0003348BE /* Release */, 518 | ); 519 | defaultConfigurationIsVisible = 0; 520 | defaultConfigurationName = Release; 521 | }; 522 | /* End XCConfigurationList section */ 523 | 524 | /* Begin XCRemoteSwiftPackageReference section */ 525 | 03C112BD2DB56BFF00AE6799 /* XCRemoteSwiftPackageReference "Sparkle" */ = { 526 | isa = XCRemoteSwiftPackageReference; 527 | repositoryURL = "https://github.com/sparkle-project/Sparkle"; 528 | requirement = { 529 | kind = upToNextMajorVersion; 530 | minimumVersion = 2.7.0; 531 | }; 532 | }; 533 | /* End XCRemoteSwiftPackageReference section */ 534 | 535 | /* Begin XCSwiftPackageProductDependency section */ 536 | 03C112BE2DB56BFF00AE6799 /* Sparkle */ = { 537 | isa = XCSwiftPackageProductDependency; 538 | package = 03C112BD2DB56BFF00AE6799 /* XCRemoteSwiftPackageReference "Sparkle" */; 539 | productName = Sparkle; 540 | }; 541 | /* End XCSwiftPackageProductDependency section */ 542 | }; 543 | rootObject = 03EA68452B9630CF003348BE /* Project object */; 544 | } 545 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | --------------------------------------------------------------------------------