Force Source aspect unless user changes it; keep configs aligned
This commit is contained in:
parent
3a60494fca
commit
af82ce2809
19
main.go
19
main.go
|
|
@ -414,6 +414,7 @@ type convertConfig struct {
|
||||||
CoverArtPath string
|
CoverArtPath string
|
||||||
AspectHandling string
|
AspectHandling string
|
||||||
OutputAspect string
|
OutputAspect string
|
||||||
|
AspectUserSet bool // Tracks if user explicitly set OutputAspect
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c convertConfig) OutputFile() string {
|
func (c convertConfig) OutputFile() string {
|
||||||
|
|
@ -1348,6 +1349,10 @@ func (s *appState) showConvertView(file *videoSource) {
|
||||||
s.convert.CoverArtPath = ""
|
s.convert.CoverArtPath = ""
|
||||||
s.convert.AspectHandling = "Auto"
|
s.convert.AspectHandling = "Auto"
|
||||||
}
|
}
|
||||||
|
if !s.convert.AspectUserSet || s.convert.OutputAspect == "" {
|
||||||
|
s.convert.OutputAspect = "Source"
|
||||||
|
s.convert.AspectUserSet = false
|
||||||
|
}
|
||||||
s.setContent(buildConvertView(s, s.source))
|
s.setContent(buildConvertView(s, s.source))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2341,6 +2346,7 @@ func runGUI() {
|
||||||
InverseAutoNotes: "Default smoothing for interlaced footage.",
|
InverseAutoNotes: "Default smoothing for interlaced footage.",
|
||||||
OutputAspect: "Source",
|
OutputAspect: "Source",
|
||||||
AspectHandling: "Auto",
|
AspectHandling: "Auto",
|
||||||
|
AspectUserSet: false,
|
||||||
},
|
},
|
||||||
player: player.New(),
|
player: player.New(),
|
||||||
playerVolume: 100,
|
playerVolume: 100,
|
||||||
|
|
@ -2821,6 +2827,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
targetAspectSelect := widget.NewSelect(aspectTargets, func(value string) {
|
targetAspectSelect := widget.NewSelect(aspectTargets, func(value string) {
|
||||||
logging.Debug(logging.CatUI, "target aspect set to %s", value)
|
logging.Debug(logging.CatUI, "target aspect set to %s", value)
|
||||||
state.convert.OutputAspect = value
|
state.convert.OutputAspect = value
|
||||||
|
state.convert.AspectUserSet = true
|
||||||
})
|
})
|
||||||
if state.convert.OutputAspect == "" {
|
if state.convert.OutputAspect == "" {
|
||||||
state.convert.OutputAspect = "Source"
|
state.convert.OutputAspect = "Source"
|
||||||
|
|
@ -2926,6 +2933,10 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
})
|
})
|
||||||
formatSelect.SetSelected(state.convert.SelectedFormat.Label)
|
formatSelect.SetSelected(state.convert.SelectedFormat.Label)
|
||||||
|
|
||||||
|
if !state.convert.AspectUserSet {
|
||||||
|
state.convert.OutputAspect = "Source"
|
||||||
|
}
|
||||||
|
|
||||||
// Encoder Preset with hint
|
// Encoder Preset with hint
|
||||||
encoderPresetHint := widget.NewLabel("")
|
encoderPresetHint := widget.NewLabel("")
|
||||||
encoderPresetHint.Wrapping = fyne.TextWrapWord
|
encoderPresetHint.Wrapping = fyne.TextWrapWord
|
||||||
|
|
@ -2985,6 +2996,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
InverseTelecine: false,
|
InverseTelecine: false,
|
||||||
OutputAspect: "Source",
|
OutputAspect: "Source",
|
||||||
AspectHandling: "Auto",
|
AspectHandling: "Auto",
|
||||||
|
AspectUserSet: false,
|
||||||
VideoCodec: "H.264",
|
VideoCodec: "H.264",
|
||||||
EncoderPreset: "medium",
|
EncoderPreset: "medium",
|
||||||
BitrateMode: "CRF",
|
BitrateMode: "CRF",
|
||||||
|
|
@ -3138,6 +3150,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
targetAspectSelectSimple := widget.NewSelect(aspectTargets, func(value string) {
|
targetAspectSelectSimple := widget.NewSelect(aspectTargets, func(value string) {
|
||||||
logging.Debug(logging.CatUI, "target aspect set to %s (simple)", value)
|
logging.Debug(logging.CatUI, "target aspect set to %s (simple)", value)
|
||||||
state.convert.OutputAspect = value
|
state.convert.OutputAspect = value
|
||||||
|
state.convert.AspectUserSet = true
|
||||||
updateAspectBoxVisibility()
|
updateAspectBoxVisibility()
|
||||||
})
|
})
|
||||||
if state.convert.OutputAspect == "" {
|
if state.convert.OutputAspect == "" {
|
||||||
|
|
@ -3842,6 +3855,12 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
dialog.ShowError(fmt.Errorf("failed to parse config: %w", err), state.window)
|
dialog.ShowError(fmt.Errorf("failed to parse config: %w", err), state.window)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if cfg.OutputAspect == "" {
|
||||||
|
cfg.OutputAspect = "Source"
|
||||||
|
cfg.AspectUserSet = false
|
||||||
|
} else if !strings.EqualFold(cfg.OutputAspect, "Source") {
|
||||||
|
cfg.AspectUserSet = true
|
||||||
|
}
|
||||||
state.convert = cfg
|
state.convert = cfg
|
||||||
state.showConvertView(state.source)
|
state.showConvertView(state.source)
|
||||||
}, state.window)
|
}, state.window)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user