Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@
}
},
"Album Name" : {
"extractionState" : "stale",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
Expand Down Expand Up @@ -372,6 +373,7 @@
}
},
"Artist Name" : {
"extractionState" : "stale",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
Expand Down Expand Up @@ -1327,6 +1329,7 @@
}
},
"Lyric Provider" : {
"extractionState" : "stale",
"localizations" : {
"zh-Hans" : {
"stringUnit" : {
Expand Down Expand Up @@ -1528,6 +1531,9 @@
}
}
}
},
"No background at all" : {

},
"No Translation ☹️" : {
"localizations" : {
Expand Down Expand Up @@ -2358,6 +2364,9 @@
}
}
}
},
"Show Karaoke window over exclusive fullscreen apps (e.g. certain games)" : {

},
"Show lyrics (⌘ + H)" : {
"localizations" : {
Expand Down
4 changes: 2 additions & 2 deletions Lyric Fever.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
CURRENT_PROJECT_VERSION = 3.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 38TP6LZLJ5;
DEVELOPMENT_TEAM = 9ASBJ87RVR;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
Expand Down Expand Up @@ -467,7 +467,7 @@
CURRENT_PROJECT_VERSION = 3.3;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "";
DEVELOPMENT_TEAM = 38TP6LZLJ5;
DEVELOPMENT_TEAM = 9ASBJ87RVR;
ENABLE_APP_SANDBOX = YES;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
Expand Down
24 changes: 20 additions & 4 deletions LyricFever/KaraokeSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ struct KaraokeSettingsView: View {
@AppStorage("karaokeModeHoveringSetting") var karaokeModeHoveringSetting: Bool = false
@AppStorage("karaokeShowMultilingual") var karaokeShowMultilingual: Bool = true
@AppStorage("karaokeTransparency") var karaokeTransparency: Double = 50
@AppStorage("karaokeShowOverFullscreen") var karaokeShowOverFullscreen: Bool = false
@AppStorage("karaokeNoBackground") var karaokeNoBackground: Bool = false

var colorBinding: Binding<Color> {
Binding<Color> {
Expand All @@ -39,18 +41,30 @@ struct KaraokeSettingsView: View {
Text("Show multilingual lyrics when translating in Karaoke window")
}
.toggleStyle(.checkbox)
Toggle(isOn: $karaokeShowOverFullscreen) {
Text("Show Karaoke window over exclusive fullscreen apps (e.g. certain games)")
}
.toggleStyle(.checkbox)
.padding(.bottom, 20)

Text("Karaoke Background Appearance")
.font(.system(size: 15, weight: .bold))

Toggle(isOn: $karaokeUseAlbumColor) {
Text("Use album color for Karaoke window")
Toggle(isOn: $karaokeNoBackground) {
Text("No background at all")
}
.toggleStyle(.checkbox)
if !karaokeUseAlbumColor {
ColorPicker("Set a background color", selection: colorBinding, supportsOpacity: false)

Group {
Toggle(isOn: $karaokeUseAlbumColor) {
Text("Use album color for Karaoke window")
}
.toggleStyle(.checkbox)
if !karaokeUseAlbumColor {
ColorPicker("Set a background color", selection: colorBinding, supportsOpacity: false)
}
}
.disabled(karaokeNoBackground)
Text("Opacity Level: \(Int(karaokeTransparency))%")
CompactSlider(value: $karaokeTransparency, in: 1...100, step: 5) {
Text("Opacity Level:")
Expand All @@ -75,6 +89,8 @@ struct KaraokeSettingsView: View {
karaokeUseAlbumColor = true
viewmodel.userDefaultStorage.karaokeShowMultilingual = true
viewmodel.userDefaultStorage.karaokeTransparency = 50
viewmodel.userDefaultStorage.karaokeNoBackground = false
viewmodel.userDefaultStorage.karaokeShowOverFullscreen = false
viewmodel.karaokeFont = NSFont.boldSystemFont(ofSize: 30)
// viewmodel.karaokeFontSize = 30
colorBinding.wrappedValue = Color(.sRGB, red: 0.98, green: 0.0, blue: 0.98)
Expand Down
6 changes: 6 additions & 0 deletions LyricFever/Support Files/UserDefaultStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class UserDefaultStorage {
// User setting: hide karaoke on hover
@ObservableUserDefault(.init(key: "karaokeModeHoveringSetting", defaultValue: false, store: .standard))
@ObservationIgnored var karaokeModeHoveringSetting: Bool

@ObservableUserDefault(.init(key: "karaokeShowOverFullscreen", defaultValue: false, store: .standard))
@ObservationIgnored var karaokeShowOverFullscreen: Bool

@ObservableUserDefault(.init(key: "karaokeNoBackground", defaultValue: false, store: .standard))
@ObservationIgnored var karaokeNoBackground: Bool
#endif

// @DefaultsKey(userDefaultsKey: "spDcCookie")
Expand Down
3 changes: 2 additions & 1 deletion LyricFever/ViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ import MediaRemoteAdapter
static let shared = ViewModel()

// Apple Music Tahoe broken AppleScript workaround
let musicController = MediaController(bundleIdentifier: "com.apple.Music")
// let musicController = MediaController(bundleIdentifier: "com.apple.Music")
let musicController = MediaController()
// var appleMusicUniqueIdentifier: String?

var currentlyPlaying: String?
Expand Down
14 changes: 13 additions & 1 deletion LyricFever/Views/KaraokeView/FloatingPanel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ struct FloatingPanelModifier<PanelContent: View>: ViewModifier {
panel?.fadeOut()
}
}
.onChange(of: ViewModel.shared.userDefaultStorage.karaokeShowOverFullscreen) {
if ViewModel.shared.userDefaultStorage.karaokeShowOverFullscreen {
panel?.level = .screenSaver
panel?.collectionBehavior.insert(.fullScreenAuxiliary)
} else {
panel?.level = .mainMenu
panel?.collectionBehavior.remove(.fullScreenAuxiliary)
}
}
.onChange(of: ViewModel.shared.userDefaultStorage.karaoke) {
if !ViewModel.shared.userDefaultStorage.karaoke {
panel?.close()
Expand Down Expand Up @@ -86,9 +95,12 @@ class FloatingPanel<Content: View>: NSPanel {
defer: true)

isFloatingPanel = true
level = .mainMenu
level = ViewModel.shared.userDefaultStorage.karaokeShowOverFullscreen ? .screenSaver : .mainMenu

collectionBehavior.insert(.canJoinAllSpaces)
if ViewModel.shared.userDefaultStorage.karaokeShowOverFullscreen {
collectionBehavior.insert(.fullScreenAuxiliary)
}
titleVisibility = .hidden
titlebarAppearsTransparent = true
isMovableByWindowBackground = false
Expand Down
15 changes: 11 additions & 4 deletions LyricFever/Views/KaraokeView/KaraokeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ struct KaraokeView: View {
@AppStorage("karaokeShowMultilingual") var karaokeShowMultilingual: Bool = true
@AppStorage("karaokeUseAlbumColor") var karaokeUseAlbumColor: Bool = true
@AppStorage("fixedKaraokeColorHex") var fixedKaraokeColorHex: String = "#2D3CCC"
@AppStorage("karaokeNoBackground") var karaokeNoBackground: Bool = false

func currentWords(for currentlyPlayingLyricsIndex: Int) -> String {
if !viewmodel.romanizedLyrics.isEmpty {
Expand Down Expand Up @@ -94,13 +95,19 @@ struct KaraokeView: View {
.padding(10)
.padding(.horizontal, 10)
.background {
currentAlbumArt
.transition(.opacity)
.opacity(karaokeTransparency/100)
if !karaokeNoBackground {
currentAlbumArt
.transition(.opacity)
.opacity(karaokeTransparency/100)
}
}
// .drawingGroup()
.background(
VisualEffectView().ignoresSafeArea()
Group {
if !karaokeNoBackground {
VisualEffectView().ignoresSafeArea()
}
}
)
.cornerRadius(16)
.onHover { hover in
Expand Down