Liquid Glass and Apple Music touches for the Spotify iOS app. A GPL-3.0 fork of spoti.pw 0.21.1.
C
feat: the lyrics' Karaoke mic is off by default below iOS 18, where Karaoke cannot run (#179)
Andrew04ee3fc1e5d2
diff --git a/tweak/Sources/Redesigned/Lyrics/SGRKaraokeView.m b/tweak/Sources/Redesigned/Lyrics/SGRKaraokeView.mindex b3212620..9ad55f96 100644--- a/tweak/Sources/Redesigned/Lyrics/SGRKaraokeView.m+++ b/tweak/Sources/Redesigned/Lyrics/SGRKaraokeView.m@@ -1419,7 +1419,7 @@ typedef struct {for (NSNotificationName name in @[UIContentSizeCategoryDidChangeNotification, UIAccessibilityDarkerSystemColorsStatusDidChangeNotification])[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(creditStyleChanged) name:name object:nil];_sing = [SGRSingButton new];- _sing.hidden = !SGEnabled(SGKeySingButton);+ _sing.hidden = !SGSingButtonShown();[self addSubview:_sing];[NSNotificationCenter.defaultCenter addObserver:self selector:@selector(singButtonChanged) name:SGSingButtonDidChangeNotification object:nil];[self addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapped:)]];@@ -1440,7 +1440,7 @@ typedef struct {// Karaoke's settings switched the mic off or on: hidden at once, Karaoke itself as it was.- (void)singButtonChanged {- _sing.hidden = !SGEnabled(SGKeySingButton);+ _sing.hidden = !SGSingButtonShown();}- (void)refreshCreditStyle {diff --git a/tweak/Sources/Shared/Sing/Sing.h b/tweak/Sources/Shared/Sing/Sing.hindex 8d8b1351..ff30e6e0 100644--- a/tweak/Sources/Shared/Sing/Sing.h+++ b/tweak/Sources/Shared/Sing/Sing.h@@ -32,10 +32,12 @@// The mic: on and off at once, from the button or the Sing page; off until switched on.#define SGKeySing @"spotifyglass.sing"-// Whether the redesign's lyrics show the mic in their corner; on until switched off (issue #12). Karaoke itself-// stays on its own switch, which this does not touch.+// Whether the redesign's lyrics show the mic in their corner (issue #12); until switched, on where Karaoke can run+// and off below iOS 18, where the mic could only say it cannot (SGSingButtonShown). Karaoke itself stays on its own+// switch, which this does not touch.#define SGKeySingButton @"spotifyglass.sing.button"extern NSNotificationName const SGSingButtonDidChangeNotification;+BOOL SGSingButtonShown(void);// The vocals' level, 0 (gone) through 1 (as the song has them) to 2 (the vocals alone) at the slider's top.#define SGKeySingLevel @"spotifyglass.sing.level"// Keeps the model running on a hot iPhone, which otherwise lets it go from the thermal state Serious up.diff --git a/tweak/Sources/Shared/Sing/SingSettings.m b/tweak/Sources/Shared/Sing/SingSettings.mindex 99d82810..844083c2 100644--- a/tweak/Sources/Shared/Sing/SingSettings.m+++ b/tweak/Sources/Shared/Sing/SingSettings.m@@ -202,11 +202,16 @@ UIViewController *SGSpatialVoiceSettingsPage(void) {NSNotificationName const SGSingButtonDidChangeNotification = @"SGSingButtonDidChangeNotification";+BOOL SGSingButtonShown(void) {+ return SGFlag(SGKeySingButton, SGSingOSSupported());+}+UIViewController *SGSingSettingsPage(void) {SGModRow *sing = SGOptionRow(@"Karaoke", nil, SGKeySing);sing.changed = ^(BOOL on) { SGSetSingOn(on); };// Only the redesign's lyrics have the mic.SGModRow *button = SGSwitchRow(@"Toggle from lyrics", @"The mic in the corner of the lyrics", SGKeySingButton);+ button.defaultOn = SGSingOSSupported();button.changed = ^(BOOL on) { [NSNotificationCenter.defaultCenter postNotificationName:SGSingButtonDidChangeNotification object:nil]; };button.visible = ^BOOL { return SGRedesignedUIStored(); };SGModRow *heat = SGOptionRow(@"Ignore heat warnings", @"Keeps Karaoke going on a hot iPhone, which then gets hotter", SGKeySingIgnoreHeat);