refactor: limit ColoredSelect to codec/format dropdowns only

- Reverted all non-codec dropdowns to widget.NewSelect (quality presets, bitrate controls, rotation, resolution, aspect, encoder presets, frame rate, pixel format, hardware accel, audio controls, DVD options)
- Kept ColoredSelect ONLY for format and codec selects with semantic colors for navigation
- Fixed Upscale module to work without AI upscaler (removed realesrgan-ncnn-vulkan as required dependency)
- Fixed dvdAspectSelect.Selected() call (should be .Selected field, not method)
This commit is contained in:
Stu Leak 2026-01-02 15:12:56 -05:00
parent ea1e0eeff5
commit 647ecc633a
2 changed files with 63 additions and 81 deletions

142
main.go
View File

@ -3464,19 +3464,17 @@ func (s *appState) showMergeView() {
// DVD-specific options // DVD-specific options
dvdRegionOptions := []string{"NTSC", "PAL"} dvdRegionOptions := []string{"NTSC", "PAL"}
dvdRegionColors := ui.BuildGenericColorMap(dvdRegionOptions) dvdRegionSelect := widget.NewSelect(dvdRegionOptions, func(val string) {
dvdRegionSelect := ui.NewColoredSelect(dvdRegionOptions, dvdRegionColors, func(val string) {
s.mergeDVDRegion = val s.mergeDVDRegion = val
s.persistMergeConfig() s.persistMergeConfig()
}, s.window) })
dvdRegionSelect.SetSelected(s.mergeDVDRegion) dvdRegionSelect.SetSelected(s.mergeDVDRegion)
dvdAspectOptions := []string{"16:9", "4:3"} dvdAspectOptions := []string{"16:9", "4:3"}
dvdAspectColors := ui.BuildGenericColorMap(dvdAspectOptions) dvdAspectSelect := widget.NewSelect(dvdAspectOptions, func(val string) {
dvdAspectSelect := ui.NewColoredSelect(dvdAspectOptions, dvdAspectColors, func(val string) {
s.mergeDVDAspect = val s.mergeDVDAspect = val
s.persistMergeConfig() s.persistMergeConfig()
}, s.window) })
dvdAspectSelect.SetSelected(s.mergeDVDAspect) dvdAspectSelect.SetSelected(s.mergeDVDAspect)
dvdOptionsRow := container.NewHBox( dvdOptionsRow := container.NewHBox(
@ -3542,11 +3540,10 @@ func (s *appState) showMergeView() {
// Frame Rate controls // Frame Rate controls
frameRateOptions := []string{"Source", "23.976", "24", "25", "29.97", "30", "50", "59.94", "60"} frameRateOptions := []string{"Source", "23.976", "24", "25", "29.97", "30", "50", "59.94", "60"}
frameRateColors := ui.BuildGenericColorMap(frameRateOptions) frameRateSelect := widget.NewSelect(frameRateOptions, func(val string) {
frameRateSelect := ui.NewColoredSelect(frameRateOptions, frameRateColors, func(val string) {
s.mergeFrameRate = val s.mergeFrameRate = val
s.persistMergeConfig() s.persistMergeConfig()
}, s.window) })
frameRateSelect.SetSelected(s.mergeFrameRate) frameRateSelect.SetSelected(s.mergeFrameRate)
motionInterpCheck := widget.NewCheck("Use Motion Interpolation (slower, smoother)", func(checked bool) { motionInterpCheck := widget.NewCheck("Use Motion Interpolation (slower, smoother)", func(checked bool) {
@ -6536,11 +6533,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// DVD-specific aspect ratio selector (only shown for DVD formats) // DVD-specific aspect ratio selector (only shown for DVD formats)
dvdAspectOpts := []string{"4:3", "16:9"} dvdAspectOpts := []string{"4:3", "16:9"}
dvdAspectCols := ui.BuildGenericColorMap(dvdAspectOpts) dvdAspectSelect := widget.NewSelect(dvdAspectOpts, func(value string) {
dvdAspectSelect := ui.NewColoredSelect(dvdAspectOpts, dvdAspectCols, func(value string) {
logging.Debug(logging.CatUI, "DVD aspect set to %s", value) logging.Debug(logging.CatUI, "DVD aspect set to %s", value)
state.convert.OutputAspect = value state.convert.OutputAspect = value
}, state.window) })
dvdAspectSelect.SetSelected("16:9") dvdAspectSelect.SetSelected("16:9")
dvdAspectLabel := widget.NewLabelWithStyle("DVD Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}) dvdAspectLabel := widget.NewLabelWithStyle("DVD Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
@ -6563,20 +6559,20 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// Forward declarations for encoding controls (used in reset/update callbacks) // Forward declarations for encoding controls (used in reset/update callbacks)
var ( var (
bitrateModeSelect *ui.ColoredSelect bitrateModeSelect *widget.Select
bitratePresetSelect *ui.ColoredSelect bitratePresetSelect *widget.Select
crfPresetSelect *ui.ColoredSelect crfPresetSelect *widget.Select
crfEntry *widget.Entry crfEntry *widget.Entry
manualCrfRow *fyne.Container manualCrfRow *fyne.Container
videoBitrateEntry *widget.Entry videoBitrateEntry *widget.Entry
manualBitrateRow *fyne.Container manualBitrateRow *fyne.Container
targetFileSizeSelect *ui.ColoredSelect targetFileSizeSelect *widget.Select
targetFileSizeEntry *widget.Entry targetFileSizeEntry *widget.Entry
qualitySelectSimple *ui.ColoredSelect qualitySelectSimple *widget.Select
qualitySelectAdv *ui.ColoredSelect qualitySelectAdv *widget.Select
qualitySectionSimple fyne.CanvasObject qualitySectionSimple fyne.CanvasObject
qualitySectionAdv fyne.CanvasObject qualitySectionAdv fyne.CanvasObject
simpleBitrateSelect *ui.ColoredSelect simpleBitrateSelect *widget.Select
crfContainer *fyne.Container crfContainer *fyne.Container
bitrateContainer *fyne.Container bitrateContainer *fyne.Container
targetSizeContainer *fyne.Container targetSizeContainer *fyne.Container
@ -6617,8 +6613,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
var syncingQuality bool var syncingQuality bool
qualityColors := ui.BuildQualityColorMap(qualityOptions) qualitySelectSimple = widget.NewSelect(qualityOptions, func(value string) {
qualitySelectSimple = ui.NewColoredSelect(qualityOptions, qualityColors, func(value string) {
if syncingQuality { if syncingQuality {
return return
} }
@ -6635,9 +6630,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
qualitySelectAdv = ui.NewColoredSelect(qualityOptions, qualityColors, func(value string) { qualitySelectAdv = widget.NewSelect(qualityOptions, func(value string) {
if syncingQuality { if syncingQuality {
return return
} }
@ -6654,7 +6649,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
if !slices.Contains(qualityOptions, state.convert.Quality) { if !slices.Contains(qualityOptions, state.convert.Quality) {
state.convert.Quality = "Standard (CRF 23)" state.convert.Quality = "Standard (CRF 23)"
@ -6677,11 +6672,12 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
} }
} }
newColors := ui.BuildQualityColorMap(newOptions) qualitySelectSimple.Options = newOptions
qualitySelectSimple.UpdateOptions(newOptions, newColors) qualitySelectAdv.Options = newOptions
qualitySelectAdv.UpdateOptions(newOptions, newColors)
qualitySelectSimple.SetSelected(state.convert.Quality) qualitySelectSimple.SetSelected(state.convert.Quality)
qualitySelectAdv.SetSelected(state.convert.Quality) qualitySelectAdv.SetSelected(state.convert.Quality)
qualitySelectSimple.Refresh()
qualitySelectAdv.Refresh()
} }
outputEntry := widget.NewEntry() outputEntry := widget.NewEntry()
@ -6906,8 +6902,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
flipVerticalCheck.Checked = state.convert.FlipVertical flipVerticalCheck.Checked = state.convert.FlipVertical
rotationOptions := []string{"0°", "90° CW", "180°", "270° CW"} rotationOptions := []string{"0°", "90° CW", "180°", "270° CW"}
rotationColors := ui.BuildGenericColorMap(rotationOptions) rotationSelect := widget.NewSelect(rotationOptions, func(value string) {
rotationSelect := ui.NewColoredSelect(rotationOptions, rotationColors, func(value string) {
var rotation string var rotation string
switch value { switch value {
case "0°": case "0°":
@ -6921,7 +6916,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
} }
state.convert.Rotation = rotation state.convert.Rotation = rotation
logging.Debug(logging.CatUI, "rotation set to %s", rotation) logging.Debug(logging.CatUI, "rotation set to %s", rotation)
}, state.window) })
if state.convert.Rotation == "" { if state.convert.Rotation == "" {
state.convert.Rotation = "0" state.convert.Rotation = "0"
} }
@ -6937,17 +6932,16 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
aspectTargets := []string{"Source", "16:9", "4:3", "5:4", "5:3", "1:1", "9:16", "21:9"} aspectTargets := []string{"Source", "16:9", "4:3", "5:4", "5:3", "1:1", "9:16", "21:9"}
var ( var (
targetAspectSelect *ui.ColoredSelect targetAspectSelect *widget.Select
targetAspectSelectSimple *ui.ColoredSelect targetAspectSelectSimple *widget.Select
syncAspect func(string, bool) syncAspect func(string, bool)
syncingAspect bool syncingAspect bool
) )
aspectColors := ui.BuildGenericColorMap(aspectTargets) targetAspectSelect = widget.NewSelect(aspectTargets, func(value string) {
targetAspectSelect = ui.NewColoredSelect(aspectTargets, aspectColors, func(value string) {
if syncAspect != nil { if syncAspect != nil {
syncAspect(value, true) syncAspect(value, true)
} }
}, state.window) })
if state.convert.OutputAspect == "" { if state.convert.OutputAspect == "" {
state.convert.OutputAspect = "Source" state.convert.OutputAspect = "Source"
} }
@ -7140,27 +7134,26 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
} }
encoderPresetOptions := []string{"veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast", "superfast", "ultrafast"} encoderPresetOptions := []string{"veryslow", "slower", "slow", "medium", "fast", "faster", "veryfast", "superfast", "ultrafast"}
encoderPresetColors := ui.BuildQualityColorMap(encoderPresetOptions) encoderPresetSelect := widget.NewSelect(encoderPresetOptions, func(value string) {
encoderPresetSelect := ui.NewColoredSelect(encoderPresetOptions, encoderPresetColors, func(value string) {
state.convert.EncoderPreset = value state.convert.EncoderPreset = value
logging.Debug(logging.CatUI, "encoder preset set to %s", value) logging.Debug(logging.CatUI, "encoder preset set to %s", value)
updateEncoderPresetHint(value) updateEncoderPresetHint(value)
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
encoderPresetSelect.SetSelected(state.convert.EncoderPreset) encoderPresetSelect.SetSelected(state.convert.EncoderPreset)
updateEncoderPresetHint(state.convert.EncoderPreset) updateEncoderPresetHint(state.convert.EncoderPreset)
// Simple mode preset dropdown // Simple mode preset dropdown
simplePresetSelect := ui.NewColoredSelect(encoderPresetOptions, encoderPresetColors, func(value string) { simplePresetSelect := widget.NewSelect(encoderPresetOptions, func(value string) {
state.convert.EncoderPreset = value state.convert.EncoderPreset = value
logging.Debug(logging.CatUI, "simple preset set to %s", value) logging.Debug(logging.CatUI, "simple preset set to %s", value)
updateEncoderPresetHint(value) updateEncoderPresetHint(value)
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
simplePresetSelect.SetSelected(state.convert.EncoderPreset) simplePresetSelect.SetSelected(state.convert.EncoderPreset)
// Settings management for batch operations // Settings management for batch operations
@ -7267,8 +7260,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
"VBR": "VBR (Variable Bitrate)", "VBR": "VBR (Variable Bitrate)",
"Target Size": "Target Size (Calculate from file size)", "Target Size": "Target Size (Calculate from file size)",
} }
bitrateModeColors := ui.BuildGenericColorMap(bitrateModeOptions) bitrateModeSelect = widget.NewSelect(bitrateModeOptions, func(value string) {
bitrateModeSelect = ui.NewColoredSelect(bitrateModeOptions, bitrateModeColors, func(value string) {
// Extract short code from label // Extract short code from label
if shortCode, ok := bitrateModeMap[value]; ok { if shortCode, ok := bitrateModeMap[value]; ok {
state.convert.BitrateMode = shortCode state.convert.BitrateMode = shortCode
@ -7282,7 +7274,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
// Set selected using full label // Set selected using full label
if fullLabel, ok := reverseMap[state.convert.BitrateMode]; ok { if fullLabel, ok := reverseMap[state.convert.BitrateMode]; ok {
bitrateModeSelect.SetSelected(fullLabel) bitrateModeSelect.SetSelected(fullLabel)
@ -7315,8 +7307,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
"28 (Draft)", "28 (Draft)",
"Manual", "Manual",
} }
crfPresetColors := ui.BuildQualityColorMap(crfPresetOptions) crfPresetSelect = widget.NewSelect(crfPresetOptions, func(value string) {
crfPresetSelect = ui.NewColoredSelect(crfPresetOptions, crfPresetColors, func(value string) {
switch value { switch value {
case "Auto (from Quality preset)": case "Auto (from Quality preset)":
state.convert.CRF = "" state.convert.CRF = ""
@ -7344,7 +7335,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
if buildCommandPreview != nil { if buildCommandPreview != nil {
buildCommandPreview() buildCommandPreview()
} }
}, state.window) })
switch state.convert.CRF { switch state.convert.CRF {
case "": case "":
crfPresetSelect.SetSelected("Auto (from Quality preset)") crfPresetSelect.SetSelected("Auto (from Quality preset)")
@ -7579,15 +7570,14 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
var setBitratePreset func(string) var setBitratePreset func(string)
var syncingBitratePreset bool var syncingBitratePreset bool
bitratePresetColors := ui.BuildQualityColorMap(bitratePresetLabels) bitratePresetSelect = widget.NewSelect(bitratePresetLabels, func(value string) {
bitratePresetSelect = ui.NewColoredSelect(bitratePresetLabels, bitratePresetColors, func(value string) {
if syncingBitratePreset { if syncingBitratePreset {
return return
} }
if setBitratePreset != nil { if setBitratePreset != nil {
setBitratePreset(value) setBitratePreset(value)
} }
}, state.window) })
state.convert.BitratePreset = normalizePresetLabel(state.convert.BitratePreset) state.convert.BitratePreset = normalizePresetLabel(state.convert.BitratePreset)
if state.convert.BitratePreset == "" || bitratePresetLookup[state.convert.BitratePreset].Label == "" { if state.convert.BitratePreset == "" || bitratePresetLookup[state.convert.BitratePreset].Label == "" {
state.convert.BitratePreset = "2.5 Mbps - Medium" state.convert.BitratePreset = "2.5 Mbps - Medium"
@ -7595,14 +7585,14 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
bitratePresetSelect.SetSelected(state.convert.BitratePreset) bitratePresetSelect.SetSelected(state.convert.BitratePreset)
// Simple bitrate selector (shares presets) // Simple bitrate selector (shares presets)
simpleBitrateSelect = ui.NewColoredSelect(bitratePresetLabels, bitratePresetColors, func(value string) { simpleBitrateSelect = widget.NewSelect(bitratePresetLabels, func(value string) {
if syncingBitratePreset { if syncingBitratePreset {
return return
} }
if setBitratePreset != nil { if setBitratePreset != nil {
setBitratePreset(value) setBitratePreset(value)
} }
}, state.window) })
simpleBitrateSelect.SetSelected(state.convert.BitratePreset) simpleBitrateSelect.SetSelected(state.convert.BitratePreset)
// Manual bitrate row (hidden by default) // Manual bitrate row (hidden by default)
@ -7623,19 +7613,18 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
"2X (relative)", "4X (relative)", "2X (relative)", "4X (relative)",
"NTSC (720×480)", "PAL (720×540)", "PAL (720×576)", "NTSC (720×480)", "PAL (720×540)", "PAL (720×576)",
} }
resolutionColorsSimple := ui.BuildGenericColorMap(resolutionOptionsSimple) resolutionSelectSimple := widget.NewSelect(resolutionOptionsSimple, func(value string) {
resolutionSelectSimple := ui.NewColoredSelect(resolutionOptionsSimple, resolutionColorsSimple, func(value string) {
state.convert.TargetResolution = value state.convert.TargetResolution = value
logging.Debug(logging.CatUI, "target resolution set to %s (simple)", value) logging.Debug(logging.CatUI, "target resolution set to %s (simple)", value)
}, state.window) })
resolutionSelectSimple.SetSelected(state.convert.TargetResolution) resolutionSelectSimple.SetSelected(state.convert.TargetResolution)
// Simple aspect selector (separate widget) // Simple aspect selector (separate widget)
targetAspectSelectSimple = ui.NewColoredSelect(aspectTargets, aspectColors, func(value string) { targetAspectSelectSimple = widget.NewSelect(aspectTargets, func(value string) {
if syncAspect != nil { if syncAspect != nil {
syncAspect(value, true) syncAspect(value, true)
} }
}, state.window) })
if state.convert.OutputAspect == "" { if state.convert.OutputAspect == "" {
state.convert.OutputAspect = "Source" state.convert.OutputAspect = "Source"
} }
@ -7788,13 +7777,12 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
} }
} }
targetSizeColors := ui.BuildGenericColorMap(options) targetFileSizeSelect.Options = options
targetFileSizeSelect.UpdateOptions(options, targetSizeColors) targetFileSizeSelect.Refresh()
} }
targetSizeOpts := []string{"25MB", "50MB", "100MB", "200MB", "500MB", "1GB", "Manual"} targetSizeOpts := []string{"25MB", "50MB", "100MB", "200MB", "500MB", "1GB", "Manual"}
targetSizeCols := ui.BuildGenericColorMap(targetSizeOpts) targetFileSizeSelect = widget.NewSelect(targetSizeOpts, func(value string) {
targetFileSizeSelect = ui.NewColoredSelect(targetSizeOpts, targetSizeCols, func(value string) {
if value == "Manual" { if value == "Manual" {
targetSizeManualRow.Show() targetSizeManualRow.Show()
if state.convert.TargetFileSize != "" { if state.convert.TargetFileSize != "" {
@ -7829,7 +7817,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
targetSizeManualRow.Hide() targetSizeManualRow.Hide()
} }
logging.Debug(logging.CatUI, "target file size set to %s", state.convert.TargetFileSize) logging.Debug(logging.CatUI, "target file size set to %s", state.convert.TargetFileSize)
}, state.window) })
targetFileSizeSelect.SetSelected("100MB") targetFileSizeSelect.SetSelected("100MB")
updateTargetSizeOptions() updateTargetSizeOptions()
@ -8001,11 +7989,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
"2X (relative)", "4X (relative)", "2X (relative)", "4X (relative)",
"NTSC (720×480)", "PAL (720×540)", "PAL (720×576)", "NTSC (720×480)", "PAL (720×540)", "PAL (720×576)",
} }
resolutionColors := ui.BuildGenericColorMap(resolutionOptions) resolutionSelect := widget.NewSelect(resolutionOptions, func(value string) {
resolutionSelect := ui.NewColoredSelect(resolutionOptions, resolutionColors, func(value string) {
state.convert.TargetResolution = value state.convert.TargetResolution = value
logging.Debug(logging.CatUI, "target resolution set to %s", value) logging.Debug(logging.CatUI, "target resolution set to %s", value)
}, state.window) })
if state.convert.TargetResolution == "" { if state.convert.TargetResolution == "" {
state.convert.TargetResolution = "Source" state.convert.TargetResolution = "Source"
} }
@ -8074,12 +8061,11 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
} }
frameRateOptions := []string{"Source", "23.976", "24", "25", "29.97", "30", "50", "59.94", "60"} frameRateOptions := []string{"Source", "23.976", "24", "25", "29.97", "30", "50", "59.94", "60"}
frameRateColors := ui.BuildGenericColorMap(frameRateOptions) frameRateSelect := widget.NewSelect(frameRateOptions, func(value string) {
frameRateSelect := ui.NewColoredSelect(frameRateOptions, frameRateColors, func(value string) {
state.convert.FrameRate = value state.convert.FrameRate = value
logging.Debug(logging.CatUI, "frame rate set to %s", value) logging.Debug(logging.CatUI, "frame rate set to %s", value)
updateFrameRateHint() updateFrameRateHint()
}, state.window) })
frameRateSelect.SetSelected(state.convert.FrameRate) frameRateSelect.SetSelected(state.convert.FrameRate)
updateFrameRateHint() updateFrameRateHint()
@ -8092,11 +8078,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// Pixel Format // Pixel Format
pixelFormatOptions := []string{"yuv420p", "yuv422p", "yuv444p"} pixelFormatOptions := []string{"yuv420p", "yuv422p", "yuv444p"}
pixelFormatColors := ui.BuildPixelFormatColorMap(pixelFormatOptions) pixelFormatSelect := widget.NewSelect(pixelFormatOptions, func(value string) {
pixelFormatSelect := ui.NewColoredSelect(pixelFormatOptions, pixelFormatColors, func(value string) {
state.convert.PixelFormat = value state.convert.PixelFormat = value
logging.Debug(logging.CatUI, "pixel format set to %s", value) logging.Debug(logging.CatUI, "pixel format set to %s", value)
}, state.window) })
pixelFormatSelect.SetSelected(state.convert.PixelFormat) pixelFormatSelect.SetSelected(state.convert.PixelFormat)
// Hardware Acceleration with hint // Hardware Acceleration with hint
@ -8105,11 +8090,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// Wrap hint in padded container to ensure proper text wrapping in narrow windows // Wrap hint in padded container to ensure proper text wrapping in narrow windows
hwAccelHintContainer := container.NewPadded(hwAccelHint) hwAccelHintContainer := container.NewPadded(hwAccelHint)
hwAccelOptions := []string{"auto", "none", "nvenc", "amf", "vaapi", "qsv", "videotoolbox"} hwAccelOptions := []string{"auto", "none", "nvenc", "amf", "vaapi", "qsv", "videotoolbox"}
hwAccelColors := ui.BuildGenericColorMap(hwAccelOptions) hwAccelSelect := widget.NewSelect(hwAccelOptions, func(value string) {
hwAccelSelect := ui.NewColoredSelect(hwAccelOptions, hwAccelColors, func(value string) {
state.convert.HardwareAccel = value state.convert.HardwareAccel = value
logging.Debug(logging.CatUI, "hardware accel set to %s", value) logging.Debug(logging.CatUI, "hardware accel set to %s", value)
}, state.window) })
if state.convert.HardwareAccel == "" { if state.convert.HardwareAccel == "" {
state.convert.HardwareAccel = "auto" state.convert.HardwareAccel = "auto"
} }
@ -8133,11 +8117,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
// Audio Bitrate // Audio Bitrate
audioBitrateOptions := []string{"128k", "192k", "256k", "320k"} audioBitrateOptions := []string{"128k", "192k", "256k", "320k"}
audioBitrateColors := ui.BuildGenericColorMap(audioBitrateOptions) audioBitrateSelect := widget.NewSelect(audioBitrateOptions, func(value string) {
audioBitrateSelect := ui.NewColoredSelect(audioBitrateOptions, audioBitrateColors, func(value string) {
state.convert.AudioBitrate = value state.convert.AudioBitrate = value
logging.Debug(logging.CatUI, "audio bitrate set to %s", value) logging.Debug(logging.CatUI, "audio bitrate set to %s", value)
}, state.window) })
audioBitrateSelect.SetSelected(state.convert.AudioBitrate) audioBitrateSelect.SetSelected(state.convert.AudioBitrate)
// Audio Channels // Audio Channels
@ -8151,11 +8134,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
"Mix to Stereo", "Mix to Stereo",
"Swap L/R", "Swap L/R",
} }
audioChannelsColors := ui.BuildGenericColorMap(audioChannelsOptions) audioChannelsSelect := widget.NewSelect(audioChannelsOptions, func(value string) {
audioChannelsSelect := ui.NewColoredSelect(audioChannelsOptions, audioChannelsColors, func(value string) {
state.convert.AudioChannels = value state.convert.AudioChannels = value
logging.Debug(logging.CatUI, "audio channels set to %s", value) logging.Debug(logging.CatUI, "audio channels set to %s", value)
}, state.window) })
audioChannelsSelect.SetSelected(state.convert.AudioChannels) audioChannelsSelect.SetSelected(state.convert.AudioChannels)
// Now define updateDVDOptions with access to resolution and framerate selects // Now define updateDVDOptions with access to resolution and framerate selects
@ -8195,7 +8177,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
) )
// Prefer the explicit DVD aspect select if set; otherwise derive from source // Prefer the explicit DVD aspect select if set; otherwise derive from source
targetAR = dvdAspectSelect.Selected() targetAR = dvdAspectSelect.Selected
if strings.Contains(state.convert.SelectedFormat.Label, "NTSC") { if strings.Contains(state.convert.SelectedFormat.Label, "NTSC") {
dvdNotes = "NTSC DVD: 720×480 @ 29.97fps, MPEG-2 Video, AC-3 Stereo 48kHz (bitrate 8000k, 9000k max PS2-safe)" dvdNotes = "NTSC DVD: 720×480 @ 29.97fps, MPEG-2 Video, AC-3 Stereo 48kHz (bitrate 8000k, 9000k max PS2-safe)"

View File

@ -31,7 +31,7 @@ var moduleDependencies = map[string][]string{
"merge": {"ffmpeg"}, "merge": {"ffmpeg"},
"trim": {"ffmpeg"}, "trim": {"ffmpeg"},
"filters": {"ffmpeg"}, "filters": {"ffmpeg"},
"upscale": {"ffmpeg", "realesrgan-ncnn-vulkan"}, "upscale": {"ffmpeg"}, // realesrgan-ncnn-vulkan is optional for AI upscaling
"audio": {"ffmpeg"}, "audio": {"ffmpeg"},
"author": {"ffmpeg", "dvdauthor", "xorriso"}, "author": {"ffmpeg", "dvdauthor", "xorriso"},
"rip": {"ffmpeg", "xorriso"}, "rip": {"ffmpeg", "xorriso"},