diff --git a/Aerial.xcodeproj/project.pbxproj b/Aerial.xcodeproj/project.pbxproj index 3c75c3cf..76834896 100644 --- a/Aerial.xcodeproj/project.pbxproj +++ b/Aerial.xcodeproj/project.pbxproj @@ -995,7 +995,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1018,7 +1018,7 @@ INFOPLIST_FILE = Aerial/App/Resources/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.0; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = "com.johncoates.Aerial-Test"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1185,7 +1185,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.2; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1193,7 +1193,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.4; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1214,7 +1214,7 @@ CODE_SIGN_IDENTITY = "Developer ID Application: Guillaume Louel (3L54M5L5KK)"; CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 1.6.2; + CURRENT_PROJECT_VERSION = 1.6.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = 3L54M5L5KK; ENABLE_HARDENED_RUNTIME = YES; @@ -1222,7 +1222,7 @@ INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; MACOSX_DEPLOYMENT_TARGET = 10.9; - MARKETING_VERSION = 1.6.2; + MARKETING_VERSION = 1.6.4; OTHER_CODE_SIGN_FLAGS = "--timestamp"; PRODUCT_BUNDLE_IDENTIFIER = com.johncoates.Aerial; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift b/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift index 33790bcc..28e7a88f 100644 --- a/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift +++ b/Aerial/Source/Controllers/PWC Tabs/PWC+Cache.swift @@ -30,8 +30,8 @@ extension PreferencesWindowController { } func updateCacheSize() { - // get your directory url - let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.cacheDirectory!) + // get your directory url, we now use App support + let documentsDirectoryURL = URL(fileURLWithPath: VideoCache.appSupportDirectory!) // FileManager.default.urls(for: VideoCache.cacheDirectory, in: .userDomainMask).first! diff --git a/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift b/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift index a8c59df8..8c02742f 100644 --- a/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift +++ b/Aerial/Source/Controllers/PWC Tabs/PWC+Videos.swift @@ -187,6 +187,10 @@ extension PreferencesWindowController { popoverPower.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY) } + @IBAction func helpHDRButtonClick(_ button: NSButton) { + popoverHDR.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY) + } + @IBAction func fadeInOutModePopupChange(_ sender: NSPopUpButton) { debugLog("UI fadeInOutMode: \(sender.indexOfSelectedItem)") preferences.fadeMode = sender.indexOfSelectedItem @@ -241,6 +245,13 @@ extension PreferencesWindowController { } } + // MARK: Wikipedia popup link + @IBAction func linkToWikipediaDolbyVisionClick(_ sender: Any) { + let workspace = NSWorkspace.shared + let url = URL(string: "https://en.wikipedia.org/wiki/Dolby_Laboratories#Video_processing")! + workspace.open(url) + } + // MARK: Video playback // Rewind preview video when reaching end diff --git a/Aerial/Source/Controllers/PreferencesWindowController.swift b/Aerial/Source/Controllers/PreferencesWindowController.swift index 9f7a2ddd..641b6ac1 100644 --- a/Aerial/Source/Controllers/PreferencesWindowController.swift +++ b/Aerial/Source/Controllers/PreferencesWindowController.swift @@ -34,6 +34,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo @IBOutlet var popoverHEVCLabel: NSTextField! @IBOutlet var secondProjectPageLink: NSButton! + @IBOutlet var popoverHDR: NSPopover! + @IBOutlet var popoverTime: NSPopover! @IBOutlet var linkTimeWikipediaButton: NSButton! @@ -252,7 +254,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo return formatter }() - // MARK: - Init required init?(coder decoder: NSCoder) { self.fontManager = NSFontManager.shared debugLog("pwc init1") @@ -500,6 +501,8 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo self.outlineView.reloadData() self.outlineView.expandItem(nil, expandChildren: true) } + + // We update the info in the advanced tab let (description, total) = ManifestLoader.instance.getOldFilesEstimation() videoVersionsLabel.stringValue = description if total > 0 { diff --git a/Aerial/Source/Models/ErrorLog.swift b/Aerial/Source/Models/ErrorLog.swift index 5f880764..77cb9e3a 100644 --- a/Aerial/Source/Models/ErrorLog.swift +++ b/Aerial/Source/Models/ErrorLog.swift @@ -55,7 +55,7 @@ func Log(level: ErrorLevel, message: String) { if #available(OSX 10.12, *) { // This is faster when available let log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "Screensaver") - os_log("AerialError: %@", log: log, type: .error, message) + os_log("AerialError: %{public}@", log: log, type: .error, message) } else { NSLog("AerialError: \(message)") } diff --git a/Aerial/Source/Models/ManifestLoader.swift b/Aerial/Source/Models/ManifestLoader.swift index 72956f9b..ea0fdf50 100644 --- a/Aerial/Source/Models/ManifestLoader.swift +++ b/Aerial/Source/Models/ManifestLoader.swift @@ -455,10 +455,10 @@ class ManifestLoader { type: "video", timeOfDay: asset.time, url1080pH264: url1080p, - url1080pHEVC: "", - url1080pHDR: "", + url1080pHEVC: url1080p, + url1080pHDR: url1080p, url4KHEVC: url4K, - url4KHDR: "", + url4KHDR: url4K, manifest: .customVideos, poi: [:], communityPoi: asset.pointsOfInterest) @@ -765,7 +765,7 @@ class ManifestLoader { } } } catch { - errorLog("Error retrieving content listing") + errorLog("Error retrieving content listing (new)") return } } @@ -850,7 +850,7 @@ class ManifestLoader { } } } catch { - errorLog("Error retrieving content listing") + errorLog("Error retrieving content listing (old)") return } } @@ -902,7 +902,7 @@ class ManifestLoader { warnLog("We have no videos in the manifest") return ("Can't estimate duplicates", 0) } - guard let cacheDirectory = VideoCache.cacheDirectory else { + guard let cacheDirectory = VideoCache.appSupportDirectory else { warnLog("No cache directory") return ("Can't estimate duplicates", 0) } @@ -915,7 +915,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -931,12 +931,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found { @@ -992,7 +1004,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -1008,12 +1020,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found { @@ -1034,7 +1058,7 @@ class ManifestLoader { // swiftlint:disable:next cyclomatic_complexity func trashOldVideos() { debugLog("trash old videos") - let cacheDirectory = VideoCache.cacheDirectory! + let cacheDirectory = VideoCache.appSupportDirectory! var cacheResourcesString = cacheDirectory let dateFormatter = DateFormatter() @@ -1067,7 +1091,7 @@ class ManifestLoader { let directoryContent = try fileManager.contentsOfDirectory(at: cacheDirectoryUrl, includingPropertiesForKeys: nil) let videoFileURLs = directoryContent.filter { $0.pathExtension == "mov" } - // We check the 3 fields + // We check the 5 fields for fileURL in videoFileURLs { var found = false for video in loadedManifest { @@ -1083,12 +1107,24 @@ class ManifestLoader { break } } + if video.url1080pHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url1080pHDR)?.lastPathComponent { + found = true + break + } + } if video.url4KHEVC != "" { if fileURL.lastPathComponent == URL(string: video.url4KHEVC)?.lastPathComponent { found = true break } } + if video.url4KHDR != "" { + if fileURL.lastPathComponent == URL(string: video.url4KHDR)?.lastPathComponent { + found = true + break + } + } } if !found { diff --git a/Resources/PreferencesWindow.xib b/Resources/PreferencesWindow.xib index eb5e35d4..bbbd87a4 100644 --- a/Resources/PreferencesWindow.xib +++ b/Resources/PreferencesWindow.xib @@ -1,9 +1,9 @@ - + - - + + @@ -111,6 +111,7 @@ + @@ -175,7 +176,7 @@ - + @@ -514,15 +515,15 @@ is disabled - + - + @@ -1773,7 +1785,7 @@ Shift, but macOS 10.12.4 or above and a compatible Mac are required) - + @@ -2289,7 +2301,7 @@ Gw - + @@ -2804,7 +2816,7 @@ Unless you want to manually manage your updates, we highly recommand you leave t - + @@ -2982,6 +2994,50 @@ After changing the folder, please close System Preferences for this to be taken + + + + + + + + + + + + + + + + + + + + + If you enable HDR, Aerial will download new versions of the videos. This option is only available starting with macOS Catalina. + +These videos are using Dolby Vision to represent a Higher Dynamic Range of colors and lighting. + +In practice, this means you will see wilder colors which may or may not look pleasing or realistic to you. + +Please note that all 4K videos are encoded in 10 bit per color component, whether you are using HDR or not. Those files will be played appropriately whether your screen is 10 bit (iMac) or 8 bit (Macbook Pro). + + + + + + +