diff options
author | der richter <der.richter@gmx.de> | 2020-07-31 10:37:02 +0200 |
---|---|---|
committer | der richter <der.richter@gmx.de> | 2020-08-22 14:22:49 +0200 |
commit | 5fb0f36937cc38b9db88dc9b8631cba75536c5be (patch) | |
tree | 00c7792bf3f0ef93ff142ec419bc20a64e177424 /video/out/cocoa_cb_common.swift | |
parent | 9035a51b133dbf288818a871f040413d80c2d3b0 (diff) | |
download | mpv-5fb0f36937cc38b9db88dc9b8631cba75536c5be.tar.bz2 mpv-5fb0f36937cc38b9db88dc9b8631cba75536c5be.tar.xz |
mac: use config cache und wakeup for mac option runtime changes
remove the libmpv observer for the macOS specific options and use a
config cache + change callback for runtime changes. this is also a
preparation for new backends and generalises even more, since libmpv
functions can't and shouldn't be used in usual vo backends. for feature
parity the config cache is used.
Diffstat (limited to 'video/out/cocoa_cb_common.swift')
-rw-r--r-- | video/out/cocoa_cb_common.swift | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/video/out/cocoa_cb_common.swift b/video/out/cocoa_cb_common.swift index 10e3c30cc1..fb868e5c1f 100644 --- a/video/out/cocoa_cb_common.swift +++ b/video/out/cocoa_cb_common.swift @@ -36,11 +36,6 @@ class CocoaCB: Common { libmpv = LibmpvHelper(mpvHandle, newlog) super.init(newlog) layer = GLLayer(cocoaCB: self) - - libmpv.observeString("macos-title-bar-style") - libmpv.observeString("macos-title-bar-appearance") - libmpv.observeString("macos-title-bar-material") - libmpv.observeString("macos-title-bar-color") } func preinit(_ vo: UnsafeMutablePointer<vo>) { @@ -238,34 +233,6 @@ class CocoaCB: Common { switch event.pointee.event_id { case MPV_EVENT_SHUTDOWN: shutdown() - case MPV_EVENT_PROPERTY_CHANGE: - if backendState == .initialized { - handlePropertyChange(event) - } - default: - break - } - } - - func handlePropertyChange(_ event: UnsafePointer<mpv_event>) { - let pData = OpaquePointer(event.pointee.data) - guard let property = UnsafePointer<mpv_event_property>(pData)?.pointee else { - return - } - - switch String(cString: property.name) { - case "macos-title-bar-appearance": - if let data = LibmpvHelper.mpvStringArrayToString(property.data) { - titleBar?.set(appearance: data) - } - case "macos-title-bar-material": - if let data = LibmpvHelper.mpvStringArrayToString(property.data) { - titleBar?.set(material: data) - } - case "macos-title-bar-color": - if let data = LibmpvHelper.mpvStringArrayToString(property.data) { - titleBar?.set(color: data) - } default: break } |