From da0d53e9df6bad82eb89c2fa031c0ba701353b09 Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Sun, 18 Feb 2024 00:03:54 -0600 Subject: [PATCH] Remove YTSpeed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It’s not gone. It’s turning into a submodule to fix errors. --- Sources/uYouPlus.xm | 52 --------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 5f67f1e..e4c6d61 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -504,55 +504,6 @@ static NSString *accessGroupID() { } %end -// YTSpeed - https://github.com/Lyvendia/YTSpeed -%group gYTSpeed -%hook YTVarispeedSwitchController -- (id)init { - id result = %orig; - - const int size = 17; - float speeds[] = {0.25, 0.5, 0.75, 1.0, 1.25, 1.5, 1.75, 2.0, 2.25, 2.5, 2.75, 3.0, 3.25, 3.5, 3.75, 4.0, 5.0}; - id varispeedSwitchControllerOptions[size]; - - for (int i = 0; i < size; ++i) { - id title = [NSString stringWithFormat:@"%.2fx", speeds[i]]; - varispeedSwitchControllerOptions[i] = [[%c(YTVarispeedSwitchControllerOption) alloc] initWithTitle:title rate:speeds[i]]; - } - - NSUInteger count = sizeof(varispeedSwitchControllerOptions) / sizeof(id); - NSArray *varispeedArray = [NSArray arrayWithObjects:varispeedSwitchControllerOptions count:count]; - MSHookIvar(self, "_options") = varispeedArray; - - return result; -} -%end - -%hook MLHAMQueuePlayer -- (void)setRate:(float)rate { - MSHookIvar(self, "_rate") = rate; - MSHookIvar(self, "_preferredRate") = rate; - - id player = MSHookIvar(self, "_player"); - [player setRate: rate]; - - id stickySettings = MSHookIvar(self, "_stickySettings"); - [stickySettings setRate: rate]; - - [self.playerEventCenter broadcastRateChange: rate]; - - YTSingleVideoController *singleVideoController = self.delegate; - [singleVideoController playerRateDidChange: rate]; -} -%end - -%hook YTPlayerViewController -%property (nonatomic, assign) float playbackRate; -- (void)singleVideo:(id)video playbackRateDidChange:(float)rate { - %orig; -} -%end -%end - # pragma mark - uYouPlus // Video Player Options // Skips content warning before playing *some videos - @PoomSmart @@ -1200,9 +1151,6 @@ static NSString *accessGroupID() { if (IS_ENABLED(@"hideChipBar_enabled")) { %init(gHideChipBar); } - if (IS_ENABLED(@"ytSpeed_enabled")) { - %init(gYTSpeed); - } if (IS_ENABLED(@"portraitFullscreen_enabled")) { %init(gPortraitFullscreen); }