diff --git a/internal/logic/sync.go b/internal/logic/sync.go index 606dfb3..b700489 100644 --- a/internal/logic/sync.go +++ b/internal/logic/sync.go @@ -39,7 +39,7 @@ func getAudioFiles(folder string) ([]string, error) { return audioFiles, nil } -func CombineFiles(folder1 string, folder2 string, outputFolder string, progress *widget.ProgressBar, soundscapeVolume float64, statusCallback func(string)) error { +func CombineFiles(folder1 string, folder2 string, outputFolder string, progress *widget.ProgressBar, soundscapeVolume float64, debug bool, statusCallback func(string)) error { soundscapeVolume = 0.5 + (soundscapeVolume / 100.0 * 0.5) files1, err := getAudioFiles(folder1) @@ -89,6 +89,12 @@ func CombineFiles(folder1 string, folder2 string, outputFolder string, progress if ext == ".mp3" || ext == ".flac" { arguments = append(arguments, getCoverArtArguments(file, files2[index])...) } + + // If debug mode is enabled, add verbose logging arguments + if debug { + arguments = append(arguments, "-loglevel", "verbose") + } + arguments = append(arguments, newFileName) cmd := exec.CommandContext(ctx, ffmpeg, arguments...) diff --git a/internal/ui/windows.go b/internal/ui/windows.go index b2ca5d2..2cd2d69 100644 --- a/internal/ui/windows.go +++ b/internal/ui/windows.go @@ -180,10 +180,13 @@ func CreateMainContent(app fyne.App, window fyne.Window) fyne.CanvasObject { statusLabel := widget.NewLabel("Idle") + // Add a checkbox for debug mode + debugCheck := widget.NewCheck("Debug Mode", func(checked bool) {}) + startButton.OnTapped = func() { startButton.Disable() progressBar.Show() - err := logic.CombineFiles(folder1, folder2, folderOutput, progressBar, volumeSlider.Value, func(msg string) { + err := logic.CombineFiles(folder1, folder2, folderOutput, progressBar, volumeSlider.Value, debugCheck.Checked, func(msg string) { statusLabel.SetText(msg) }) progressBar.Hide() @@ -202,6 +205,7 @@ func CreateMainContent(app fyne.App, window fyne.Window) fyne.CanvasObject { "", container.NewVBox( statusLabel, + debugCheck, startButton, progressBar, ),