|
|
|
|
@ -40,12 +40,20 @@ final class Coordinator {
|
|
|
|
|
|
|
|
|
|
outputs.applyLaunchRoutes()
|
|
|
|
|
audio.applyLaunchRoutes()
|
|
|
|
|
applyLoginItemArgument()
|
|
|
|
|
|
|
|
|
|
statusTimer = Timer.scheduledTimer(withTimeInterval: 1, repeats: true) { [weak self] _ in
|
|
|
|
|
MainActor.assumeIsolated { self?.sendStatus() }
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// `--login-item on|off`: set up a headless node over SSH, where the settings window is hidden behind outputs.
|
|
|
|
|
private func applyLoginItemArgument(_ arguments: [String] = ProcessInfo.processInfo.arguments) {
|
|
|
|
|
guard let index = arguments.firstIndex(of: "--login-item"), index + 1 < arguments.count else { return }
|
|
|
|
|
settings.launchAtLogin = arguments[index + 1] == "on"
|
|
|
|
|
Log.ndi.info("Launch at login: \(self.settings.launchAtLogin ? "on" : "off", privacy: .public)")
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// (Re)starts the Bonjour side that fits the role; call after role or interface changes.
|
|
|
|
|
func startRemote() async {
|
|
|
|
|
nodeServer?.stop()
|
|
|
|
|
|