diff --git a/QuickRecorder.xcodeproj/project.pbxproj b/QuickRecorder.xcodeproj/project.pbxproj index a605447..b48f5f1 100644 --- a/QuickRecorder.xcodeproj/project.pbxproj +++ b/QuickRecorder.xcodeproj/project.pbxproj @@ -487,7 +487,7 @@ CODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 164; + CURRENT_PROJECT_VERSION = 165; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"QuickRecorder/Preview Content\""; DEVELOPMENT_TEAM = L4T783637F; @@ -505,7 +505,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.3; - MARKETING_VERSION = 1.6.4; + MARKETING_VERSION = 1.6.5; PRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; @@ -521,7 +521,7 @@ CODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 164; + CURRENT_PROJECT_VERSION = 165; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"QuickRecorder/Preview Content\""; DEVELOPMENT_TEAM = L4T783637F; @@ -539,7 +539,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 12.3; - MARKETING_VERSION = 1.6.4; + MARKETING_VERSION = 1.6.5; PRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/QuickRecorder/QuickRecorderApp.swift b/QuickRecorder/QuickRecorderApp.swift index 2aaff69..aa3457c 100644 --- a/QuickRecorder/QuickRecorderApp.swift +++ b/QuickRecorder/QuickRecorderApp.swift @@ -355,8 +355,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, SCStreamDelegate, SCStreamOu let w1 = NSApp.windows.filter({ !$0.title.contains("Item-0") && !$0.title.isEmpty && $0.isVisible }) let w2 = w1.filter({ !$0.title.contains(".qma") }) if (!w1.isEmpty && w2.isEmpty) || w1.isEmpty { - let offset = (!showOnDock && !showMenubar) ? 128 : 0 - let width = isMacOS12 ? 800 : 927 + let offset = (!showOnDock && !showMenubar) ? 127 : 0 + let width = isMacOS12 ? 800 : 928 let mainPanel = EscPanel(contentRect: NSRect(x: 0, y: 0, width: width + offset, height: 100), styleMask: [.fullSizeContentView, .nonactivatingPanel], backing: .buffered, defer: false) mainPanel.contentView = NSHostingView(rootView: ContentView()) mainPanel.title = "QuickRecorder".local diff --git a/QuickRecorder/RecordEngine.swift b/QuickRecorder/RecordEngine.swift index 50c4c70..6a2c555 100644 --- a/QuickRecorder/RecordEngine.swift +++ b/QuickRecorder/RecordEngine.swift @@ -178,8 +178,9 @@ extension AppDelegate { conf.showsCursor = showMouse || fastStart if background.rawValue != BackgroundType.wallpaper.rawValue { conf.backgroundColor = SCContext.getBackgroundColor() } if !recordHDR { + conf.pixelFormat = kCVPixelFormatType_32BGRA conf.colorSpaceName = CGColorSpace.sRGB - if withAlpha { conf.pixelFormat = kCVPixelFormatType_32BGRA } + //if withAlpha { conf.pixelFormat = kCVPixelFormatType_32BGRA } } } @@ -311,7 +312,7 @@ extension AppDelegate { default: qualityMultiplier = 1.0 } let h264Level = AVVideoProfileLevelH264HighAutoLevel - let h265Level = kVTProfileLevel_HEVC_Main_AutoLevel as String + let h265Level = (recordHDR ? kVTProfileLevel_HEVC_Main10_AutoLevel : kVTProfileLevel_HEVC_Main_AutoLevel) as String let targetBitrate = resolution * fpsMultiplier * encoderMultiplier * qualityMultiplier var videoSettings: [String: Any] = [ AVVideoCodecKey: encoderIsH265 ? ((withAlpha && !recordHDR) ? AVVideoCodecType.hevcWithAlpha : AVVideoCodecType.hevc) : AVVideoCodecType.h264, @@ -329,7 +330,7 @@ extension AppDelegate { videoSettings[AVVideoColorPropertiesKey] = [ AVVideoTransferFunctionKey: AVVideoTransferFunction_ITU_R_709_2, AVVideoColorPrimariesKey: AVVideoColorPrimaries_ITU_R_709_2, - AVVideoYCbCrMatrixKey: AVVideoYCbCrMatrix_ITU_R_709_2 ] as [String : Any] + AVVideoYCbCrMatrixKey: AVVideoYCbCrMatrix_ITU_R_709_2] as [String : Any] } SCContext.vwInput = AVAssetWriterInput(mediaType: AVMediaType.video, outputSettings: videoSettings) diff --git a/QuickRecorder/ViewModel/ContentView.swift b/QuickRecorder/ViewModel/ContentView.swift index 7fd690f..eb1d2b4 100644 --- a/QuickRecorder/ViewModel/ContentView.swift +++ b/QuickRecorder/ViewModel/ContentView.swift @@ -16,6 +16,7 @@ struct ContentView: View { @State private var infoGlowing = false @State private var micGlowing = false @State private var isPopoverShowing = false + @State private var isPopoverShowing2 = false @State private var micList = SCContext.getMicrophone() @AppStorage("enableAEC") private var enableAEC: Bool = false @AppStorage("recordMic") private var recordMic: Bool = false @@ -195,15 +196,26 @@ struct ContentView: View { }, label: { SelectorView(title: "Window".local, symbol: "macwindow").cornerRadius(8) }).buttonStyle(.plain) + /*Divider().frame(height: 70) + Button(action: { + isPopoverShowing2 = true + }, label: { + SelectorView(title: "Camera".local, symbol: "camera").cornerRadius(8) + }) + .buttonStyle(.plain) + .popover(isPresented: $isPopoverShowing2, arrowEdge: .bottom) { + CameraPopoverView(closePopover: { isPopoverShowing2 = false }) + }*/ Divider().frame(height: 70) Button(action: { isPopoverShowing = true }, label: { SelectorView(title: "Mobile Device".local, symbol: "apps.ipad").cornerRadius(8) - }).buttonStyle(.plain) - .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom) { - iDevicePopoverView(closePopover: { isPopoverShowing = false }) - } + }) + .buttonStyle(.plain) + .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom) { + iDevicePopoverView(closePopover: { isPopoverShowing = false }) + } Divider().frame(height: 70) Button(action: { closeMainWindow() @@ -239,31 +251,6 @@ struct ContentView: View { } }.focusable(false) } - - struct FlakeView: View { - var emoji: String - var width: CGFloat = 1100 - @State private var opacity: CGFloat = Double.random(in: 0.1...0.9) - @State private var flakeYPosition: CGFloat = -30 - @State private var flakeXPosition: CGFloat = CGFloat.random(in: 0...1050) - private let flakeSize: CGFloat = CGFloat.random(in: 12...30) - private let animationDuration: Double = Double.random(in: 4...12) - - var body: some View { - Text(emoji) - .font(.system(size: flakeSize)) - .opacity(opacity) - .rotationEffect(Angle(degrees: Double.random(in: 0...359))) - .position(x: flakeXPosition, y: flakeYPosition) - .onAppear { - withAnimation(Animation.linear(duration: animationDuration).repeatForever(autoreverses: false)) { - opacity -= 0.5 - flakeYPosition = 130 - flakeXPosition += CGFloat.random(in: -70...70) - } - } - } - } } struct SelectorView: View { diff --git a/QuickRecorder/ViewModel/VideoEditor.swift b/QuickRecorder/ViewModel/VideoEditor.swift index c7c84af..5b9ee96 100644 --- a/QuickRecorder/ViewModel/VideoEditor.swift +++ b/QuickRecorder/ViewModel/VideoEditor.swift @@ -147,6 +147,7 @@ struct VideoTrimmerView: View { } .padding(.top, -22) .background(WindowAccessor(onWindowOpen: { window in + window?.styleMask.insert(.resizable) playerViewModel.nsWindow = window SCContext.trimingList.append(videoURL) }, onWindowClose: { diff --git a/QuickRecorder/zh-Hans.lproj/Localizable.strings b/QuickRecorder/zh-Hans.lproj/Localizable.strings index abbfafb..8c655fa 100644 --- a/QuickRecorder/zh-Hans.lproj/Localizable.strings +++ b/QuickRecorder/zh-Hans.lproj/Localizable.strings @@ -11,6 +11,7 @@ "Screen" = "录制全屏画面"; "Application" = "录制应用程序"; "Window" = "录制窗口内容"; +//"Camera" = "录制摄像头"; "Mobile Device" = "录制移动设备"; "Preferences" = "偏好设置"; "No Title" = "无标题"; diff --git a/QuickRecorder/zh-Hant.lproj/Localizable.strings b/QuickRecorder/zh-Hant.lproj/Localizable.strings index d6c1858..3fb9f8a 100644 --- a/QuickRecorder/zh-Hant.lproj/Localizable.strings +++ b/QuickRecorder/zh-Hant.lproj/Localizable.strings @@ -11,6 +11,7 @@ "Screen" = "錄製整個螢幕"; "Application" = "錄製應用程式"; "Window" = "錄製視窗內容"; +//"Camera" = "網路攝影機"; "Mobile Device" = "錄製行動裝置"; "Preferences" = "偏好設定"; "No Title" = "無標題";