-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathYTHFSPrefsManager.h
90 lines (75 loc) · 3.13 KB
/
YTHFSPrefsManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//
// YTHFSPrefsManager.h
//
// Created by Joshua Seltzer on 12/5/22.
//
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
// enum to define the options for the hold duration
typedef enum YTHFSHoldDurationOption : NSInteger {
kYTHFSHoldDurationOption025,
kYTHFSHoldDurationOption050,
kYTHFSHoldDurationOption075,
kYTHFSHoldDurationOption100,
kYTHFSHoldDurationOption125,
kYTHFSHoldDurationOption150,
kYTHFSHoldDurationOption175,
kYTHFSHoldDurationOption200
} YTHFSHoldDurationOption;
// enum to define the options for the playback rate
typedef enum YTHFSPlaybackRateOption : NSInteger {
kYTHFSPlaybackRateOption025,
kYTHFSPlaybackRateOption050,
kYTHFSPlaybackRateOption075,
kYTHFSPlaybackRateOption125,
kYTHFSPlaybackRateOption150,
kYTHFSPlaybackRateOption175,
kYTHFSPlaybackRateOption200,
kYTHFSPlaybackRateOption225,
kYTHFSPlaybackRateOption250,
kYTHFSPlaybackRateOption275,
kYTHFSPlaybackRateOption300,
kYTHFSPlaybackRateOption325,
kYTHFSPlaybackRateOption350,
kYTHFSPlaybackRateOption375,
kYTHFSPlaybackRateOption400,
kYTHFSPlaybackRateOption425,
kYTHFSPlaybackRateOption450,
kYTHFSPlaybackRateOption475,
kYTHFSPlaybackRateOption500
} YTHFSPlaybackRateOption;
// manager that manages the preferences for the tweak
@interface YTHFSPrefsManager : NSObject
// return a localized string with a given default value from the localization files in the tweak bundle
+ (NSString *)localizedStringForKey:(NSString *)key withDefaultValue:(NSString *)defaultValue;
// intended to be invoked when the tweak is initialized to ensure all of the default values are available
+ (void)registerDefaults;
// returns whether or not the device supports haptic feedback
+ (BOOL)supportsHapticFeedback;
// return the value that corresponds to the given hold duration option
+ (CGFloat)holdDurationValueForOption:(YTHFSHoldDurationOption)holdDurationOption;
// return the value that corresponds to the given playback rate option
+ (CGFloat)playbackRateValueForOption:(YTHFSPlaybackRateOption)playbackRateOption;
// return the hold playback option for the given value
+ (YTHFSHoldDurationOption)holdDurationOptionForValue:(CGFloat)value;
// return the playback rate option for the given value
+ (YTHFSPlaybackRateOption)playbackRateOptionForValue:(CGFloat)value;
// return the appropriate string representation of the hold duration for the given value
+ (NSString *)holdDurationStringForValue:(CGFloat)value;
// return the appropriate string representation of the playback rate for the given value
+ (NSString *)playbackRateStringForValue:(CGFloat)value;
// setters and getters for the tweak preferences
+ (BOOL)holdGestureEnabled;
+ (void)setHoldGestureEnabled:(BOOL)enabled;
+ (BOOL)disableStockGesturesEnabled;
+ (void)setDisableStockGesturesEnabled:(BOOL)enabled;
+ (BOOL)autoApplyRateEnabled;
+ (void)setAutoApplyRateEnabled:(BOOL)enabled;
+ (CGFloat)togglePlaybackRate;
+ (void)setTogglePlaybackRate:(CGFloat)playbackRate;
+ (CGFloat)holdDuration;
+ (void)setHoldDuration:(CGFloat)holdDuration;
+ (BOOL)hapticFeedbackEnabled;
+ (void)setHapticFeedbackEnabled:(BOOL)enabled;
@end