From 37b2e59787522424884813b865158f4d0ab5cb4f Mon Sep 17 00:00:00 2001 From: der richter Date: Sun, 24 Mar 2024 01:48:22 +0100 Subject: [PATCH] mac/remote: use AppHub directly instead of the singleton --- osdep/mac/remote_command_center.swift | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/osdep/mac/remote_command_center.swift b/osdep/mac/remote_command_center.swift index 08bc6e01a2..b000fcdb3e 100644 --- a/osdep/mac/remote_command_center.swift +++ b/osdep/mac/remote_command_center.swift @@ -42,6 +42,7 @@ extension RemoteCommandCenter { class RemoteCommandCenter: EventSubscriber { unowned let appHub: AppHub var event: EventHelper? { get { return appHub.event } } + var input: InputHelper { get { return appHub.input } } var configs: [MPRemoteCommand:Config] = [:] var disabledCommands: [MPRemoteCommand] = [] var isPaused: Bool = false { didSet { updateInfoCenter() } } @@ -168,7 +169,7 @@ class RemoteCommandCenter: EventSubscriber { self.configs[event.command]?.state = state } - AppHub.shared.input.put(key: config.key | Int32(state)) + self.input.put(key: config.key | Int32(state)) return .success } @@ -179,7 +180,7 @@ class RemoteCommandCenter: EventSubscriber { } let cmd = String(format: "seek %.02f absolute", posEvent.positionTime) - return AppHub.shared.input.command(cmd) ? .success : .commandFailed + return self.input.command(cmd) ? .success : .commandFailed } func handle(event: EventHelper.Event) {