Skip to content

Commit

Permalink
test: test
Browse files Browse the repository at this point in the history
  • Loading branch information
Akemi committed Apr 1, 2024
1 parent bd112f5 commit f3f7f2a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
7 changes: 7 additions & 0 deletions osdep/mac/app_hub.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,26 @@ class AppHub: NSObject {
}

@objc func initMpv(_ mpv: OpaquePointer) {
print("-------- initMpv1")
log.log = mp_log_new(UnsafeMutablePointer(mpv), mp_client_get_log(mpv), "app")
option = OptionHelper(UnsafeMutablePointer(mpv), mp_client_get_global(mpv))
input.option = option
print("-------- initMpv2")
event = EventHelper(self, mpv)
print("-------- initMpv3")
self.mpv = event?.mpv

#if HAVE_MACOS_MEDIA_PLAYER
print("-------- initMpv3.1")
remote?.registerEvents()
#endif
#if HAVE_MACOS_TOUCHBAR
print("-------- initMpv3.2")
touchBar = TouchBar(self)
#endif
print("-------- initMpv4")
log.verbose("AppHub functionality initialised")
print("-------- initMpv5")
}

@objc func initInput(_ input: OpaquePointer?) {
Expand Down
2 changes: 2 additions & 0 deletions osdep/mac/event_helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class EventHelper {

init?(_ appHub: AppHub, _ mpv: OpaquePointer) {
if !appHub.isApplication {
print("------- mpv_destroy(mpv)")
mpv_destroy(mpv)
print("------- mpv_destroy(mpv)2")
return nil
}

Expand Down
8 changes: 6 additions & 2 deletions osdep/mac/log_helper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,16 @@ class LogHelper {
}

func send(message: String, type: Int) {
guard let log = log, UnsafeRawPointer(log).load(as: UInt8.self) != 0 else {
print("------- send(message:)0 \(message)")
guard let log = log/*, UnsafeRawPointer(log).load(as: UInt8.self) != 0*/ else {
print("------- send(message:)1")
logger.log(level: loggerMapping[type] ?? .default, "\(message, privacy: .public)")
print("------- send(message:)2")
return
}

print("------- send(message:)1.1")
let args: [CVarArg] = [(message as NSString).utf8String ?? "NO MESSAGE"]
mp_msg_va(log, Int32(type), "%s\n", getVaList(args))
print("------- send(message:)1.2")
}
}

0 comments on commit f3f7f2a

Please sign in to comment.