summaryrefslogtreecommitdiffstats
path: root/osdep/mac/touchbar.m
diff options
context:
space:
mode:
authorder richter <der.richter@gmx.de>2024-03-10 00:53:44 +0100
committerder richter <der.richter@gmx.de>2024-03-14 23:33:15 +0100
commit18fb71498be4a569f1c2ea99d897aa6bd1035202 (patch)
tree4e7a0dd1326b223ea93ea5001ccbec84fe92b189 /osdep/mac/touchbar.m
parent055e9cd93e96b4310618a25e990221d73f4efb03 (diff)
downloadmpv-18fb71498be4a569f1c2ea99d897aa6bd1035202.tar.bz2
mpv-18fb71498be4a569f1c2ea99d897aa6bd1035202.tar.xz
mac/events: remove redundant functions and optimise input helper usage
some redundant functions that jump through hoops.
Diffstat (limited to 'osdep/mac/touchbar.m')
-rw-r--r--osdep/mac/touchbar.m12
1 files changed, 9 insertions, 3 deletions
diff --git a/osdep/mac/touchbar.m b/osdep/mac/touchbar.m
index ce92c6cfc9..18fe896428 100644
--- a/osdep/mac/touchbar.m
+++ b/osdep/mac/touchbar.m
@@ -17,10 +17,16 @@
#include "player/client.h"
#import "osdep/mac/touchbar.h"
+#import "osdep/mac/events_objc.h"
+
+#include "config.h"
+
+#if HAVE_SWIFT
+#include "osdep/mac/swift.h"
+#endif
@implementation TouchBar
-@synthesize app = _app;
@synthesize touchbarItems = _touchbar_items;
@synthesize duration = _duration;
@synthesize position = _position;
@@ -231,7 +237,7 @@
- (void)buttonAction:(NSButton *)sender
{
NSString *identifier = [self getIdentifierFromView:sender];
- [self.app queueCommand:(char *)[self.touchbarItems[identifier][@"cmd"] UTF8String]];
+ [[EventsResponder sharedInstance].inputHelper command:self.touchbarItems[identifier][@"cmd"]];
}
- (void)seekbarChanged:(NSSlider *)slider
@@ -239,7 +245,7 @@
NSString *identifier = [self getIdentifierFromView:slider];
NSString *seek = [NSString stringWithFormat:
self.touchbarItems[identifier][@"cmd"], slider.doubleValue];
- [self.app queueCommand:(char *)[seek UTF8String]];
+ [[EventsResponder sharedInstance].inputHelper command:seek];
}
- (NSString *)formatTime:(int)time