Skip to content

Commit

Permalink
Customisable file names
Browse files Browse the repository at this point in the history
  • Loading branch information
Mnpn committed Apr 21, 2024
1 parent 3e0ca9e commit 207eae2
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Azayaka.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 48;
CURRENT_PROJECT_VERSION = 49;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
ENABLE_HARDENED_RUNTIME = YES;
Expand Down Expand Up @@ -352,7 +352,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 48;
CURRENT_PROJECT_VERSION = 49;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = "";
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 @@ -74,7 +74,8 @@ class AppDelegate: NSObject, NSApplicationDelegate, SCStreamDelegate, SCStreamOu
"showMouse": true,
"recordMic": false,
"highRes": true,
Preferences.updateCheck: true
Preferences.updateCheck: true,
Preferences.fileName: "Recording at %t".local
]
)
// create a menu bar item
Expand Down
4 changes: 2 additions & 2 deletions Azayaka/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,10 @@ struct Preferences: View {
GroupBox() {
Form() {
ForEach(thing, id: \.1) { shortcut in
KeyboardShortcuts.Recorder(shortcut.0, name: shortcut.1).padding([.leading, .trailing], 10).padding([.top, .bottom], 2)
KeyboardShortcuts.Recorder(shortcut.0, name: shortcut.1).padding([.leading, .trailing], 10).padding(.bottom, 4)
}
}.frame(alignment: .center).padding([.leading, .trailing], 2).padding(.top, 10)
Text("Recordings can be stopped with the same shortcut.").font(.subheadline).foregroundColor(Color.gray).padding(.bottom, 10).padding(.top, 5)
Text("Recordings can be stopped with the same shortcut.").font(.subheadline).foregroundColor(Color.gray).padding(.bottom, 10)
}.padding(10)
}
}
Expand Down
6 changes: 5 additions & 1 deletion Azayaka/Recording.swift
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,11 @@ extension AppDelegate {
func getFilePath() -> String {
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "y-MM-dd HH.mm.ss"
return ud.string(forKey: "saveDirectory")! + "/Recording at ".local + dateFormatter.string(from: Date())
var fileName = ud.string(forKey: Preferences.fileName)
if fileName == nil || fileName!.isEmpty {
fileName = "Recording at %t".local
}
return ud.string(forKey: "saveDirectory")! + "/" + fileName!.replacingOccurrences(of: "%t", with: dateFormatter.string(from: Date()))
}

func getRecordingLength() -> String {
Expand Down
3 changes: 2 additions & 1 deletion Azayaka/sv.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,12 @@
"Select output directory" = "Välj destinationsmapp";
"Azayaka needs permission to record your microphone to do this." = "Azayaka behöver tillstånd för att spela in din mikrofon för att göra detta.";
"Currently set to \"%@\"" = "Satt till \"%@\"";
"Recording at " = "Inspelning vid ";
"Recording at %t" = "Inspelning vid %t";
"Recording Completed" = "Inspelning slutförd";
"File saved to: %@" = "Fil sparad till: %@";
"File saved to folder: %@" = "Fil sparad till mapp: %@";
"Destination" = "Destination";
"File name" = "Filnamn";
"\"%t\" will be replaced with the recording's start time." = "\"%t\" kommer att bytas ut mot inspelningens starttid.";
"Shortcuts" = "Genvägar";
"Record system audio" = "Spela in systemljud";
Expand Down
3 changes: 2 additions & 1 deletion Azayaka/zh-Hans.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,12 @@
"Azayaka needs permission to record your microphone to do this." = "Azayaka 需要使用麦克风权限来录制麦克风声音.";
"Currently set to \"%@\"" = "当前保存位置为\"%@\"";
"File saved to: %@" = "文件已保存至: %@";
"Recording at " = "录制于 ";
"Recording at %t" = "录制于 %t";
"Recording Completed" = "录制结束";
"File saved to: %@" = "文件已保存至: %@";
"File saved to folder: %@" = "文件已保存到: %@ 目录中";
"Destination" = "Destination";
"File name" = "File name";
"\"%t\" will be replaced with the recording's start time." = "\"%t\" will be replaced with the recording's start time.";
"Shortcuts" = "Shortcuts";
"Record system audio" = "Record system audio";
Expand Down

0 comments on commit 207eae2

Please sign in to comment.