Hide encode controls for remux
This commit is contained in:
parent
2490cb4970
commit
be4ef2303b
124
main.go
124
main.go
|
|
@ -5904,10 +5904,15 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
targetSizeContainer *fyne.Container
|
targetSizeContainer *fyne.Container
|
||||||
resetConvertDefaults func()
|
resetConvertDefaults func()
|
||||||
tabs *container.AppTabs
|
tabs *container.AppTabs
|
||||||
|
simpleEncodingSection *fyne.Container
|
||||||
|
advancedVideoEncodingBlock *fyne.Container
|
||||||
|
audioEncodingSection *fyne.Container
|
||||||
|
audioCodecSelect *widget.Select
|
||||||
)
|
)
|
||||||
var (
|
var (
|
||||||
updateEncodingControls func()
|
updateEncodingControls func()
|
||||||
updateQualityVisibility func()
|
updateQualityVisibility func()
|
||||||
|
updateRemuxVisibility func()
|
||||||
buildCommandPreview func()
|
buildCommandPreview func()
|
||||||
updateQualityOptions func() // Update quality dropdown based on codec
|
updateQualityOptions func() // Update quality dropdown based on codec
|
||||||
)
|
)
|
||||||
|
|
@ -6294,6 +6299,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
if updateQualityVisibility != nil {
|
if updateQualityVisibility != nil {
|
||||||
updateQualityVisibility()
|
updateQualityVisibility()
|
||||||
}
|
}
|
||||||
|
if updateRemuxVisibility != nil {
|
||||||
|
updateRemuxVisibility()
|
||||||
|
}
|
||||||
if buildCommandPreview != nil {
|
if buildCommandPreview != nil {
|
||||||
buildCommandPreview()
|
buildCommandPreview()
|
||||||
}
|
}
|
||||||
|
|
@ -6335,7 +6343,6 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var audioCodecSelect *widget.Select
|
|
||||||
formatSelect := widget.NewSelect(formatLabels, func(value string) {
|
formatSelect := widget.NewSelect(formatLabels, func(value string) {
|
||||||
for _, opt := range formatOptions {
|
for _, opt := range formatOptions {
|
||||||
if opt.Label == value {
|
if opt.Label == value {
|
||||||
|
|
@ -6364,6 +6371,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
if updateQualityVisibility != nil {
|
if updateQualityVisibility != nil {
|
||||||
updateQualityVisibility()
|
updateQualityVisibility()
|
||||||
}
|
}
|
||||||
|
if updateRemuxVisibility != nil {
|
||||||
|
updateRemuxVisibility()
|
||||||
|
}
|
||||||
if buildCommandPreview != nil {
|
if buildCommandPreview != nil {
|
||||||
buildCommandPreview()
|
buildCommandPreview()
|
||||||
}
|
}
|
||||||
|
|
@ -7510,6 +7520,58 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updateRemuxVisibility = func() {
|
||||||
|
remux := strings.EqualFold(state.convert.SelectedFormat.VideoCodec, "copy") ||
|
||||||
|
strings.EqualFold(state.convert.VideoCodec, "Copy")
|
||||||
|
|
||||||
|
if simpleEncodingSection != nil {
|
||||||
|
if remux {
|
||||||
|
simpleEncodingSection.Hide()
|
||||||
|
} else {
|
||||||
|
simpleEncodingSection.Show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if advancedVideoEncodingBlock != nil {
|
||||||
|
if remux {
|
||||||
|
advancedVideoEncodingBlock.Hide()
|
||||||
|
} else {
|
||||||
|
advancedVideoEncodingBlock.Show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if audioEncodingSection != nil {
|
||||||
|
if remux {
|
||||||
|
audioEncodingSection.Hide()
|
||||||
|
} else {
|
||||||
|
audioEncodingSection.Show()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if videoCodecSelect != nil {
|
||||||
|
if remux {
|
||||||
|
videoCodecSelect.Disable()
|
||||||
|
} else {
|
||||||
|
videoCodecSelect.Enable()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if audioCodecSelect != nil {
|
||||||
|
if remux {
|
||||||
|
audioCodecSelect.Disable()
|
||||||
|
} else {
|
||||||
|
audioCodecSelect.Enable()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
simpleEncodingSection = container.NewVBox(
|
||||||
|
qualitySectionSimple,
|
||||||
|
widget.NewLabelWithStyle("Encoder Speed/Quality", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
widget.NewLabel("Choose slower for better compression, faster for speed"),
|
||||||
|
widget.NewLabelWithStyle("Encoder Preset", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
simplePresetSelect,
|
||||||
|
widget.NewSeparator(),
|
||||||
|
widget.NewLabelWithStyle("Bitrate (simple presets)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
simpleBitrateSelect,
|
||||||
|
)
|
||||||
|
|
||||||
// Simple mode options - minimal controls, aspect locked to Source
|
// Simple mode options - minimal controls, aspect locked to Source
|
||||||
simpleOptions := container.NewVBox(
|
simpleOptions := container.NewVBox(
|
||||||
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
|
@ -7521,14 +7583,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
outputEntry,
|
outputEntry,
|
||||||
outputHint,
|
outputHint,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
qualitySectionSimple,
|
simpleEncodingSection,
|
||||||
widget.NewLabelWithStyle("Encoder Speed/Quality", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
widget.NewLabel("Choose slower for better compression, faster for speed"),
|
|
||||||
widget.NewLabelWithStyle("Encoder Preset", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
simplePresetSelect,
|
|
||||||
widget.NewSeparator(),
|
|
||||||
widget.NewLabelWithStyle("Bitrate (simple presets)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
simpleBitrateSelect,
|
|
||||||
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
resolutionSelectSimple,
|
resolutionSelectSimple,
|
||||||
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
|
@ -7541,18 +7596,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
)
|
)
|
||||||
|
|
||||||
// Advanced mode options - full controls with organized sections
|
// Advanced mode options - full controls with organized sections
|
||||||
advancedOptions := container.NewVBox(
|
advancedVideoEncodingBlock = container.NewVBox(
|
||||||
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
formatSelect,
|
|
||||||
chapterWarningLabel, // Warning when converting chapters to DVD
|
|
||||||
dvdAspectBox, // DVD options appear here when DVD format selected
|
|
||||||
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
outputEntry,
|
|
||||||
outputHint,
|
|
||||||
coverDisplay,
|
|
||||||
widget.NewSeparator(),
|
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ VIDEO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("═══ VIDEO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
widget.NewLabelWithStyle("Video Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Video Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
videoCodecSelect,
|
videoCodecSelect,
|
||||||
|
|
@ -7578,6 +7622,30 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
hwAccelSelect,
|
hwAccelSelect,
|
||||||
hwAccelHint,
|
hwAccelHint,
|
||||||
twoPassCheck,
|
twoPassCheck,
|
||||||
|
)
|
||||||
|
|
||||||
|
audioEncodingSection = container.NewVBox(
|
||||||
|
widget.NewLabelWithStyle("═══ AUDIO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
widget.NewLabelWithStyle("Audio Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
audioCodecSelect,
|
||||||
|
widget.NewLabelWithStyle("Audio Bitrate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
audioBitrateSelect,
|
||||||
|
widget.NewLabelWithStyle("Audio Channels", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
audioChannelsSelect,
|
||||||
|
)
|
||||||
|
|
||||||
|
advancedOptions := container.NewVBox(
|
||||||
|
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
formatSelect,
|
||||||
|
chapterWarningLabel, // Warning when converting chapters to DVD
|
||||||
|
dvdAspectBox, // DVD options appear here when DVD format selected
|
||||||
|
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
outputEntry,
|
||||||
|
outputHint,
|
||||||
|
coverDisplay,
|
||||||
|
widget.NewSeparator(),
|
||||||
|
advancedVideoEncodingBlock,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ ASPECT RATIO ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("═══ ASPECT RATIO ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
|
@ -7587,13 +7655,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
aspectBox,
|
aspectBox,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ AUDIO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
audioEncodingSection,
|
||||||
widget.NewLabelWithStyle("Audio Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
audioCodecSelect,
|
|
||||||
widget.NewLabelWithStyle("Audio Bitrate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
audioBitrateSelect,
|
|
||||||
widget.NewLabelWithStyle("Audio Channels", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
|
||||||
audioChannelsSelect,
|
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ AUTO-CROP ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("═══ AUTO-CROP ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
|
|
@ -7686,6 +7748,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
if updateQualityVisibility != nil {
|
if updateQualityVisibility != nil {
|
||||||
updateQualityVisibility()
|
updateQualityVisibility()
|
||||||
}
|
}
|
||||||
|
if updateRemuxVisibility != nil {
|
||||||
|
updateRemuxVisibility()
|
||||||
|
}
|
||||||
state.persistConvertConfig()
|
state.persistConvertConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -7701,6 +7766,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
if updateQualityVisibility != nil {
|
if updateQualityVisibility != nil {
|
||||||
updateQualityVisibility()
|
updateQualityVisibility()
|
||||||
}
|
}
|
||||||
|
if updateRemuxVisibility != nil {
|
||||||
|
updateRemuxVisibility()
|
||||||
|
}
|
||||||
|
|
||||||
tabs = container.NewAppTabs(
|
tabs = container.NewAppTabs(
|
||||||
container.NewTabItem("Simple", simpleScrollBox),
|
container.NewTabItem("Simple", simpleScrollBox),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user