Files
Scream/Scream/AppDelegate.swift
neon443 d412bc8824 add udpserver
switch to hevc in videotoolbox
move capturevideopreview to its own file
reorg
2026-02-26 19:50:38 +00:00

43 lines
943 B
Swift

//
// AppDelegate.swift
// Scream
//
// Created by neon443 on 31/12/2025.
//
import Cocoa
@main
class AppDelegate: NSObject, NSApplicationDelegate {
let sr = ScreenRecorder()
let udpserver = UDPServerImplementation(port: 03067)
@IBOutlet var window: NSWindow!
@IBAction func Button(_ sender: Any) {
Task {
await sr.start()
}
}
@IBAction func Button2(_ sender: Any) {
udpserver.start()
}
func applicationDidFinishLaunching(_ aNotification: Notification) {
// Insert code here to initialize your application
let preview = CaptureVideoPreview(layer: sr.contentLayer)
preview.frame.size = window.contentView!.frame.size
window.contentView?.addSubview(preview)
Button(self)
Button2(self)
}
func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}