Skip to content

Commit

Permalink
Add a mouse visibility setting
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnpn committed Oct 7, 2023
1 parent a36836d commit 712cf31
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Azayaka.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 35BSP6SUG9;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -315,7 +315,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 31;
CURRENT_PROJECT_VERSION = 33;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = 35BSP6SUG9;
ENABLE_HARDENED_RUNTIME = YES;
Expand Down
3 changes: 2 additions & 1 deletion Azayaka/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, SCStreamDelegate, SCStreamOu
"videoFormat": VideoFormat.mp4.rawValue,
"encoder": Encoder.h264.rawValue,
"saveDirectory": saveDirectory,
"hideSelf": false
"hideSelf": false,
"showMouse": true
]
)
// create a menu bar item
Expand Down
4 changes: 4 additions & 0 deletions Azayaka/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct Preferences: View {
@AppStorage("encoder") private var encoder: Encoder = .h264
@AppStorage("saveDirectory") private var saveDirectory: String?
@AppStorage("hideSelf") private var hideSelf: Bool = false
@AppStorage("showMouse") private var showMouse: Bool = true

var body: some View {
VStack(alignment: .leading) {
Expand All @@ -38,6 +39,9 @@ struct Preferences: View {
}.frame(maxWidth: .infinity).padding(.top, 10)
Toggle(isOn: $hideSelf) {
Text("Exclude Azayaka itself")
}.toggleStyle(CheckboxToggleStyle())
Toggle(isOn: $showMouse) {
Text("Show mouse cursor")
}.toggleStyle(CheckboxToggleStyle()).padding(.bottom, 10)
}
GroupBox(label: Text("Audio Output".uppercased()).fontWeight(.bold)) {
Expand Down
2 changes: 1 addition & 1 deletion Azayaka/Recording.swift
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ extension AppDelegate {
}

conf.minimumFrameInterval = CMTime(value: 1, timescale: audioOnly ? 1 : CMTimeScale(ud.integer(forKey: "frameRate")))
conf.showsCursor = true
conf.showsCursor = ud.bool(forKey: "showMouse")
conf.capturesAudio = true
conf.sampleRate = audioSettings["AVSampleRateKey"] as! Int
conf.channelCount = audioSettings["AVNumberOfChannelsKey"] as! Int
Expand Down

0 comments on commit 712cf31

Please sign in to comment.