Add MP3Gain normalization tool
This commit is contained in:
@@ -301,6 +301,13 @@ private struct SDCardToolView: View {
|
||||
}
|
||||
.disabled(!canRun)
|
||||
|
||||
Button {
|
||||
normalizeMP3Gain()
|
||||
} label: {
|
||||
Label("MP3Gain", systemImage: "waveform")
|
||||
}
|
||||
.disabled(!canRun)
|
||||
|
||||
Button {
|
||||
cleanSDCard()
|
||||
} label: {
|
||||
@@ -386,6 +393,23 @@ private struct SDCardToolView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private func normalizeMP3Gain() {
|
||||
guard let sdCardURL else { return }
|
||||
|
||||
isWorking = true
|
||||
messages = [.info("MP3Gain gestartet: -r -k -d 4")]
|
||||
|
||||
DispatchQueue.global(qos: .userInitiated).async {
|
||||
var result = MP3GainNormalizer(fileManager: .default).normalize(rootURL: sdCardURL)
|
||||
result.append(contentsOf: SDCardValidator(fileManager: .default).validate(rootURL: sdCardURL))
|
||||
|
||||
DispatchQueue.main.async {
|
||||
messages = result
|
||||
isWorking = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ID3TagToolView: View {
|
||||
|
||||
Reference in New Issue
Block a user