-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTweak.xm
38 lines (30 loc) · 1.3 KB
/
Tweak.xm
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
#import "Tweak.h"
id getOutputDevice(){
id routingController = [[%c(SBMediaController) sharedInstance] valueForKey:@"_routingController"];
id outputDevice = [[[routingController pickedRoute] logicalLeaderOutputDevice] valueForKey:@"_avOutputDevice"];
return outputDevice;
}
@implementation NCListener
-(void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event {
[getOutputDevice() setCurrentBluetoothListeningMode:@"AVOutputDeviceBluetoothListeningModeActiveNoiseCancellation"];
}
+(void)load {
[[LAActivator sharedInstance] registerListener:[self new] forName:@"com.semvis123.listeningmodeactivator.nc"];
}
@end
@implementation ASMListener
-(void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event {
[getOutputDevice() setCurrentBluetoothListeningMode:@"AVOutputDeviceBluetoothListeningModeAudioTransparency"];
}
+(void)load {
[[LAActivator sharedInstance] registerListener:[self new] forName:@"com.semvis123.listeningmodeactivator.asm"];
}
@end
@implementation OFFListener
-(void)activator:(LAActivator *)activator receiveEvent:(LAEvent *)event {
[getOutputDevice() setCurrentBluetoothListeningMode:@"AVOutputDeviceBluetoothListeningModeNormal"];
}
+(void)load {
[[LAActivator sharedInstance] registerListener:[self new] forName:@"com.semvis123.listeningmodeactivator.off"];
}
@end