Skip to content

Commit 0eac1b4

Browse files
committed
Merge branch 'release/1.2.4'
2 parents 648b145 + d91e958 commit 0eac1b4

File tree

9 files changed

+53
-48
lines changed

9 files changed

+53
-48
lines changed

Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ target 'Song Rating' do
55

66
# Pods for Song Rating
77
pod 'MASShortcut'
8-
pod 'DominantColor', :git => 'https://github.com/indragiek/DominantColor.git'
98

109
target 'Song RatingTests' do
1110
inherit! :search_paths

Podfile.lock

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
PODS:
2-
- DominantColor (0.1.0)
32
- MASShortcut (2.4.0)
43

54
DEPENDENCIES:
6-
- DominantColor (from `https://github.com/indragiek/DominantColor.git`)
75
- MASShortcut
86

97
SPEC REPOS:
10-
https://github.com/CocoaPods/Specs.git:
8+
trunk:
119
- MASShortcut
1210

13-
EXTERNAL SOURCES:
14-
DominantColor:
15-
:git: https://github.com/indragiek/DominantColor.git
16-
17-
CHECKOUT OPTIONS:
18-
DominantColor:
19-
:commit: 4a46b75f6c9230b374bce6d92b78e54a3107b167
20-
:git: https://github.com/indragiek/DominantColor.git
21-
2211
SPEC CHECKSUMS:
23-
DominantColor: 78c1f1ca1143b3bdf599187c7875df92d76b934d
2412
MASShortcut: d9e4909e878661cc42877cc9d6efbe638273ab57
2513

26-
PODFILE CHECKSUM: 22990987400160704799d9a65bb9be8983c907a2
14+
PODFILE CHECKSUM: 10e6f5005867dbb3964c6d40690aff5abd64540b
2715

28-
COCOAPODS: 1.8.4
16+
COCOAPODS: 1.9.1

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ macOS app for rating music in iTunes/Music.app
1515
### How can I check the track rating in iTunes/Music.app?
1616
Check the checkbox for "Star Ratings" in General preferences. [More info](https://support.apple.com/guide/music/general-preferences-mus4130f48/mac)
1717

18+
### Why the popover player sometimes follows to new screen scenes but sometimes not?
19+
The popover will jump to new scren scene when it get focused. It will stand in the old screen if the current focused window not the popover.
20+
1821
### Why Song Rating not show star rating when iTunes/Music playing?
1922
Please check the Security & Privacy settings and check the checkbox of Song Rating.
2023
![Automation](./Press/Automation.png)

Song Rating.xcodeproj/project.pbxproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@
416416
isa = PBXProject;
417417
attributes = {
418418
LastSwiftUpdateCheck = 1110;
419-
LastUpgradeCheck = 1110;
419+
LastUpgradeCheck = 1150;
420420
ORGANIZATIONNAME = "Cirno MainasuK";
421421
TargetAttributes = {
422422
DB106C4122C53D4B00502D7C = {
@@ -768,15 +768,15 @@
768768
CODE_SIGN_IDENTITY = "Apple Development";
769769
CODE_SIGN_STYLE = Automatic;
770770
COMBINE_HIDPI_IMAGES = YES;
771-
CURRENT_PROJECT_VERSION = 8;
771+
CURRENT_PROJECT_VERSION = 9;
772772
DEVELOPMENT_TEAM = A8K92XFF77;
773773
ENABLE_HARDENED_RUNTIME = YES;
774774
INFOPLIST_FILE = "Song Rating/Info.plist";
775775
LD_RUNPATH_SEARCH_PATHS = (
776776
"$(inherited)",
777777
"@executable_path/../Frameworks",
778778
);
779-
MARKETING_VERSION = 1.2.3;
779+
MARKETING_VERSION = 1.2.4;
780780
PRODUCT_BUNDLE_IDENTIFIER = "com.mainasuk.Song-Rating";
781781
PRODUCT_NAME = "$(TARGET_NAME)";
782782
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -796,15 +796,15 @@
796796
CODE_SIGN_IDENTITY = "Apple Development";
797797
CODE_SIGN_STYLE = Automatic;
798798
COMBINE_HIDPI_IMAGES = YES;
799-
CURRENT_PROJECT_VERSION = 8;
799+
CURRENT_PROJECT_VERSION = 9;
800800
DEVELOPMENT_TEAM = A8K92XFF77;
801801
ENABLE_HARDENED_RUNTIME = YES;
802802
INFOPLIST_FILE = "Song Rating/Info.plist";
803803
LD_RUNPATH_SEARCH_PATHS = (
804804
"$(inherited)",
805805
"@executable_path/../Frameworks",
806806
);
807-
MARKETING_VERSION = 1.2.3;
807+
MARKETING_VERSION = 1.2.4;
808808
PRODUCT_BUNDLE_IDENTIFIER = "com.mainasuk.Song-Rating";
809809
PRODUCT_NAME = "$(TARGET_NAME)";
810810
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -862,6 +862,7 @@
862862
buildSettings = {
863863
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
864864
CODE_SIGN_ENTITLEMENTS = "Song Rating Helper/Song_Rating_Helper.entitlements";
865+
CODE_SIGN_IDENTITY = "Apple Development";
865866
CODE_SIGN_STYLE = Automatic;
866867
COMBINE_HIDPI_IMAGES = YES;
867868
DEVELOPMENT_TEAM = A8K92XFF77;
@@ -884,6 +885,7 @@
884885
buildSettings = {
885886
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
886887
CODE_SIGN_ENTITLEMENTS = "Song Rating Helper/Song_Rating_Helper.entitlements";
888+
CODE_SIGN_IDENTITY = "Apple Development";
887889
CODE_SIGN_STYLE = Automatic;
888890
COMBINE_HIDPI_IMAGES = YES;
889891
DEVELOPMENT_TEAM = A8K92XFF77;

Song Rating.xcodeproj/xcshareddata/xcschemes/Song Rating - Debug Memory.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1110"
3+
LastUpgradeVersion = "1150"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Song Rating.xcodeproj/xcshareddata/xcschemes/Song Rating.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1110"
3+
LastUpgradeVersion = "1150"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Song Rating.xcodeproj/xcuserdata/mainasuk.xcuserdatad/xcschemes/xcschememanagement.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<key>Song Rating Helper.xcscheme_^#shared#^_</key>
1313
<dict>
1414
<key>orderHint</key>
15-
<integer>7</integer>
15+
<integer>6</integer>
1616
</dict>
1717
<key>Song Rating.xcscheme_^#shared#^_</key>
1818
<dict>

Song Rating/Controllers/PlayerViewController.swift

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,25 @@
66
// Copyright © 2019 Cirno MainasuK. All rights reserved.
77
//
88

9-
import Cocoa
109
import os
11-
import DominantColor
10+
import Cocoa
11+
import CoreImage
1212

1313
final class PlayerViewController: NSViewController {
1414

1515
private let playerPanelViewController = PlayerPanelViewController()
1616
private let playerHistoryViewController = PlayerHistoryViewController()
1717

18-
// cover
18+
// back cover with blur effect
1919
private let backCoverImageView: MovableImageView = {
2020
let view = MovableImageView()
2121
view.wantsLayer = true
2222
view.layer = CALayer()
2323
view.layer?.contentsGravity = CALayerContentsGravity.resizeAspectFill
2424
return view
2525
}()
26-
private let backCoverImageVisualEffectView: NSVisualEffectView = {
27-
let visualEffectView = NSVisualEffectView()
28-
visualEffectView.blendingMode = .withinWindow
29-
visualEffectView.material = .hudWindow
30-
visualEffectView.isEmphasized = true
31-
visualEffectView.state = .active
32-
return visualEffectView
33-
}()
26+
27+
// normal cover
3428
private let coverImageView: MovableImageView = {
3529
let imageView = MovableImageView()
3630
imageView.imageScaling = .scaleProportionallyUpOrDown
@@ -129,7 +123,7 @@ extension PlayerViewController {
129123
playerPanelViewController.delegate = self
130124

131125
// V-StackView
132-
// - backCoverImageVisualEffectView & coverImageView
126+
// - backCoverImageView & coverImageView
133127
// - playerInfoView
134128
// - playerHistoryViewController
135129

@@ -151,18 +145,9 @@ extension PlayerViewController {
151145
coverImageView.widthAnchor.constraint(equalToConstant: 300),
152146
coverImageView.heightAnchor.constraint(equalTo: coverImageView.widthAnchor),
153147
])
154-
155-
backCoverImageVisualEffectView.translatesAutoresizingMaskIntoConstraints = false
156-
view.addSubview(backCoverImageVisualEffectView, positioned: .below, relativeTo: coverImageView)
157-
NSLayoutConstraint.activate([
158-
backCoverImageVisualEffectView.topAnchor.constraint(equalTo: coverImageView.topAnchor),
159-
backCoverImageVisualEffectView.leadingAnchor.constraint(equalTo: coverImageView.leadingAnchor),
160-
backCoverImageVisualEffectView.trailingAnchor.constraint(equalTo: coverImageView.trailingAnchor),
161-
backCoverImageVisualEffectView.bottomAnchor.constraint(equalTo: coverImageView.bottomAnchor),
162-
])
163-
148+
164149
backCoverImageView.translatesAutoresizingMaskIntoConstraints = false
165-
view.addSubview(backCoverImageView, positioned: .below, relativeTo: backCoverImageVisualEffectView)
150+
view.addSubview(backCoverImageView, positioned: .below, relativeTo: stackView)
166151
NSLayoutConstraint.activate([
167152
backCoverImageView.topAnchor.constraint(equalTo: coverImageView.topAnchor),
168153
backCoverImageView.leadingAnchor.constraint(equalTo: coverImageView.leadingAnchor),
@@ -278,7 +263,34 @@ extension PlayerViewController {
278263
coverImageView.layer?.add(transition, forKey: nil)
279264

280265
coverImageView.image = image
281-
backCoverImageView.layer?.contents = image
266+
backCoverImageView.layer?.contents = NSImage(size: coverImageView.frame.size, flipped: true) { rect -> Bool in
267+
let context = CIContext()
268+
guard let tiffData = image.tiffRepresentation, let ciImage = CIImage(data: tiffData),
269+
let clampFilter = CIFilter(name: "CIAffineClamp"),
270+
let gaussianBlur = CIFilter(name: "CIGaussianBlur") else {
271+
return true
272+
}
273+
let extent = ciImage.extent
274+
275+
clampFilter.setValue(ciImage, forKey: kCIInputImageKey)
276+
clampFilter.setValue(NSAffineTransform(transform: .identity), forKey: kCIInputTransformKey)
277+
guard let clampFilterOutput = clampFilter.outputImage else {
278+
return true
279+
}
280+
281+
gaussianBlur.setValue(clampFilterOutput, forKey: kCIInputImageKey)
282+
gaussianBlur.setValue(100, forKey: kCIInputRadiusKey)
283+
284+
guard let outputImage = gaussianBlur.outputImage,
285+
let cgImage = context.createCGImage(outputImage, from: extent) else {
286+
return true
287+
}
288+
289+
let nsImage = NSImage(cgImage: cgImage, size: .zero)
290+
nsImage.draw(in: rect)
291+
292+
return true
293+
}
282294

283295
} else {
284296
coverImageView.image = nil

Song Rating/Controllers/PopoverViewController.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ final class PopoverViewController: NSViewController {
3232
visualEffectView.state = .active
3333

3434
visualEffectView.alphaValue = 0
35+
visualEffectView.maskImage = NSImage(named: NSImage.stopProgressFreestandingTemplateName) // clip non-button part effect out
3536

3637
return visualEffectView
3738
}()

0 commit comments

Comments
 (0)