mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Merge branch 'pr-159' into feature/media
MERGE TRIAL FOR THE LYRICS THINGY
This commit is contained in:
commit
9910f2fb65
3 changed files with 7 additions and 9 deletions
|
|
@ -715,7 +715,7 @@ private struct MinimalisticReminderDetailsView: View {
|
||||||
|
|
||||||
private var playPauseButton: some View {
|
private var playPauseButton: some View {
|
||||||
MinimalisticSquircircleButton(
|
MinimalisticSquircircleButton(
|
||||||
icon: musicManager.isPlaying ? "pause.fill" : "play.fill",
|
icon: musicManager.isPlaying ? (musicManager.isLiveStream ? "stop.fill" : "pause.fill") : "play.fill",
|
||||||
fontSize: 28,
|
fontSize: 28,
|
||||||
fontWeight: .semibold,
|
fontWeight: .semibold,
|
||||||
frameSize: CGSize(width: 60, height: 60),
|
frameSize: CGSize(width: 60, height: 60),
|
||||||
|
|
@ -733,6 +733,7 @@ private struct MinimalisticReminderDetailsView: View {
|
||||||
icon: String,
|
icon: String,
|
||||||
size: CGFloat = 18,
|
size: CGFloat = 18,
|
||||||
isActive: Bool = false,
|
isActive: Bool = false,
|
||||||
|
activeColor: Color = .red,
|
||||||
pressEffect: MinimalisticSquircircleButton.PressEffect = .none,
|
pressEffect: MinimalisticSquircircleButton.PressEffect = .none,
|
||||||
symbolEffect: MinimalisticSquircircleButton.SymbolEffectStyle = .none,
|
symbolEffect: MinimalisticSquircircleButton.SymbolEffectStyle = .none,
|
||||||
action: @escaping () -> Void
|
action: @escaping () -> Void
|
||||||
|
|
@ -743,7 +744,7 @@ private struct MinimalisticReminderDetailsView: View {
|
||||||
fontWeight: .medium,
|
fontWeight: .medium,
|
||||||
frameSize: CGSize(width: 40, height: 40),
|
frameSize: CGSize(width: 40, height: 40),
|
||||||
cornerRadius: 16,
|
cornerRadius: 16,
|
||||||
foregroundColor: isActive ? .red : .white.opacity(0.85),
|
foregroundColor: isActive ? activeColor : .white.opacity(0.85),
|
||||||
pressEffect: pressEffect,
|
pressEffect: pressEffect,
|
||||||
symbolEffectStyle: symbolEffect,
|
symbolEffectStyle: symbolEffect,
|
||||||
action: action
|
action: action
|
||||||
|
|
@ -767,6 +768,7 @@ private struct MinimalisticReminderDetailsView: View {
|
||||||
controlButton(
|
controlButton(
|
||||||
icon: enableLyrics ? "quote.bubble.fill" : "quote.bubble",
|
icon: enableLyrics ? "quote.bubble.fill" : "quote.bubble",
|
||||||
isActive: enableLyrics,
|
isActive: enableLyrics,
|
||||||
|
activeColor: Color(nsColor: musicManager.avgColor),
|
||||||
symbolEffect: .replace
|
symbolEffect: .replace
|
||||||
) {
|
) {
|
||||||
enableLyrics.toggle()
|
enableLyrics.toggle()
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ struct MusicControlsView: View {
|
||||||
backwardConfig.action()
|
backwardConfig.action()
|
||||||
}
|
}
|
||||||
|
|
||||||
HoverButton(icon: musicManager.isPlaying ? "pause.fill" : "play.fill", scale: .large) {
|
HoverButton(icon: musicManager.isPlaying ? (musicManager.isLiveStream ? "stop.fill" : "pause.fill") : "play.fill", scale: .large) {
|
||||||
MusicManager.shared.togglePlay()
|
MusicManager.shared.togglePlay()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -329,7 +329,7 @@ struct MusicControlsView: View {
|
||||||
case .lyrics:
|
case .lyrics:
|
||||||
HoverButton(
|
HoverButton(
|
||||||
icon: enableLyrics ? "quote.bubble.fill" : "quote.bubble",
|
icon: enableLyrics ? "quote.bubble.fill" : "quote.bubble",
|
||||||
iconColor: enableLyrics ? .accentColor : .white,
|
iconColor: enableLyrics ? Color(nsColor: MusicManager.shared.avgColor) : .white,
|
||||||
scale: .medium
|
scale: .medium
|
||||||
) {
|
) {
|
||||||
enableLyrics.toggle()
|
enableLyrics.toggle()
|
||||||
|
|
|
||||||
|
|
@ -370,8 +370,7 @@ class MusicManager: ObservableObject {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
let shouldClearForKnownDuration =
|
let shouldClearForKnownDuration =
|
||||||
!isPlaying
|
(duration > 10 && remaining > 5)
|
||||||
|| (duration > 10 && remaining > 5)
|
|
||||||
|| (liveStreamCompletionObservationCount == 0
|
|| (liveStreamCompletionObservationCount == 0
|
||||||
&& liveStreamEdgeObservationCount == 0
|
&& liveStreamEdgeObservationCount == 0
|
||||||
&& liveStreamCompletionReleaseCount >= 4)
|
&& liveStreamCompletionReleaseCount >= 4)
|
||||||
|
|
@ -394,9 +393,6 @@ class MusicManager: ObservableObject {
|
||||||
liveStreamEdgeObservationCount = 0
|
liveStreamEdgeObservationCount = 0
|
||||||
liveStreamCompletionObservationCount = 0
|
liveStreamCompletionObservationCount = 0
|
||||||
liveStreamCompletionReleaseCount = 0
|
liveStreamCompletionReleaseCount = 0
|
||||||
if !hasKnownDuration && isLiveStream {
|
|
||||||
isLiveStream = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue