Add FFplay help feature and keyboard shortcut guide

Introduced a new "Help FFplay" section in the help menu to provide information about FFplay player keyboard shortcuts and actions.
This commit is contained in:
Leonid Nikitin 2025-05-21 00:22:42 +05:00
parent 306383449a
commit 883bf376b0
Signed by: kor-elf
GPG Key ID: DAB5355A11C22541
5 changed files with 372 additions and 6 deletions

View File

@ -88,14 +88,21 @@ func (h MenuHandler) getMenuHelp() *fyne.Menu {
gratitude := fyne.NewMenuItem(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{ gratitude := fyne.NewMenuItem(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "gratitude", MessageID: "gratitude",
}), h.openGratitude) }), h.menuView.Gratitude)
h.app.GetLocalizerService().AddChangeCallback("gratitude", func(text string) { h.app.GetLocalizerService().AddChangeCallback("gratitude", func(text string) {
gratitude.Label = text gratitude.Label = text
}) })
helpFFplay := fyne.NewMenuItem(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplay",
}), h.menuView.HelpFFplay)
h.app.GetLocalizerService().AddChangeCallback("helpFFplay", func(text string) {
helpFFplay.Label = text
})
help := fyne.NewMenu(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{ help := fyne.NewMenu(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "help", MessageID: "help",
}), about, gratitude) }), helpFFplay, about, gratitude)
h.app.GetLocalizerService().AddChangeCallback("help", func(text string) { h.app.GetLocalizerService().AddChangeCallback("help", func(text string) {
help.Label = text help.Label = text
help.Refresh() help.Refresh()
@ -127,10 +134,6 @@ func (h MenuHandler) openAbout() {
h.menuView.About(ffmpeg, ffprobe, ffplay) h.menuView.About(ffmpeg, ffprobe, ffplay)
} }
func (h MenuHandler) openGratitude() {
h.menuView.Gratitude()
}
func (h MenuHandler) LanguageSelection() { func (h MenuHandler) LanguageSelection() {
h.localizerView.LanguageSelection(func(lang kernel.Lang) { h.localizerView.LanguageSelection(func(lang kernel.Lang) {
_, _ = h.localizerRepository.Save(lang.Code) _, _ = h.localizerRepository.Save(lang.Code)

View File

@ -306,6 +306,102 @@ other = "I sincerely thank you for your invaluable\n\r and timely assistance:"
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f" hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
other = "Help" other = "Help"
[helpFFplay]
hash = "sha1-ecc294b8b3d217ee1c2d63dc2f0253c3d1b3712c"
other = "FFplay Player Keys"
[helpFFplayActivateFrameStepMode]
hash = "sha1-f47ede90932d69465f6197cb2a7cc4d1e3ab150e"
other = "Activate frame-by-frame mode."
[helpFFplayCycleVideoFiltersOrShowModes]
hash = "sha1-83bb702c777e4768cdc326a668d541c23ab759b7"
other = "A cycle of video filters or display modes."
[helpFFplayDecreaseVolume]
hash = "sha1-de28db96a9c22be885ec5067a13f8f17fd3954bc"
other = "Decrease the volume."
[helpFFplayDescription]
hash = "sha1-f5441f6aee76222c4120066575e80c2d177ac3c0"
other = "Description"
[helpFFplayDoubleClickLeftMouseButton]
hash = "sha1-2657aa576055769952dfcde570fc9b4765d594ad"
other = "double click\nleft mouse button"
[helpFFplayIncreaseVolume]
hash = "sha1-8ba7bde2d9a80f4a7cd122cf4973975698d3bd34"
other = "Increase the volume."
[helpFFplayKeyDown]
hash = "sha1-c5aefd2f8c6908a69b08fe4a2d235b1ae0113470"
other = "down"
[helpFFplayKeyHoldS]
hash = "sha1-89c5dd8287c15b3f40db66e06b038c34a715f02f"
other = "hold S"
[helpFFplayKeyLeft]
hash = "sha1-feb671890703fb0300a436744d34018bbc7ba13a"
other = "left"
[helpFFplayKeyRight]
hash = "sha1-a4f025d4bf7f90ee5bec6c48b2710bc9c5bbb267"
other = "right"
[helpFFplayKeySpace]
hash = "sha1-a367ad00358ec44edc1d54a96df6f9114b0f8697"
other = "SPACE"
[helpFFplayKeyUp]
hash = "sha1-e4845aa8c0e100a80eaf65446c59085236fd2098"
other = "up"
[helpFFplayKeys]
hash = "sha1-0ad272ade8c568f394499f1492ecfab56e701e5d"
other = "Keys"
[helpFFplayPause]
hash = "sha1-e83e107900fde0c39295f599c2cf8fba8d8cb604"
other = "Pause or continue playing."
[helpFFplayQuit]
hash = "sha1-70785a2fd5d5a6519b7439f0d8cfcd7d54c5771d"
other = "Close the player."
[helpFFplaySeekBForward10Minutes]
hash = "sha1-58ed63343376240f2596e447b5245c1805f35234"
other = "Fast forward 10 minutes."
[helpFFplaySeekBForward1Minute]
hash = "sha1-3fe46b8d5413b7fdc53ae9ed9427bcb1769ec74c"
other = "Fast forward 1 minute."
[helpFFplaySeekBackward10Minutes]
hash = "sha1-927dffe9af72ffd40f46873b452a4c90627bccf8"
other = "Rewind 10 minutes."
[helpFFplaySeekBackward10Seconds]
hash = "sha1-e97615ecec0f8cf5647e8802bdda38dc2b0d809f"
other = "Rewind 10 seconds."
[helpFFplaySeekBackward1Minute]
hash = "sha1-5b19e280a0850122c8ebc80c622491bb09520e1a"
other = "Rewind 1 minute."
[helpFFplaySeekForward10Seconds]
hash = "sha1-8d840251d4a1668edaea3515df197a8a79031ec3"
other = "Fast forward 10 seconds."
[helpFFplayToggleFullScreen]
hash = "sha1-d32df02849258c5b02f15e5711f54ee6a8a75fd4"
other = "Switch to full screen or exit full screen."
[helpFFplayToggleMute]
hash = "sha1-4bdbb124fe8de3a8037c1e74719e9600b21b25ab"
other = "Mute or unmute."
[inProgressQueue] [inProgressQueue]
hash = "sha1-eff79c40e2100ae5fadf3a7d99336025edcca8b5" hash = "sha1-eff79c40e2100ae5fadf3a7d99336025edcca8b5"
other = "In Progress" other = "In Progress"

View File

@ -306,6 +306,102 @@ other = "Сізге баға жетпес және уақтылы көмекте
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f" hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
other = "Анықтама" other = "Анықтама"
[helpFFplay]
hash = "sha1-ecc294b8b3d217ee1c2d63dc2f0253c3d1b3712c"
other = "FFplay ойнатқышының пернелері"
[helpFFplayActivateFrameStepMode]
hash = "sha1-f47ede90932d69465f6197cb2a7cc4d1e3ab150e"
other = "Уақыт аралығын іске қосыңыз."
[helpFFplayCycleVideoFiltersOrShowModes]
hash = "sha1-83bb702c777e4768cdc326a668d541c23ab759b7"
other = "Бейне сүзгілерінің немесе дисплей режимдерінің циклі."
[helpFFplayDecreaseVolume]
hash = "sha1-de28db96a9c22be885ec5067a13f8f17fd3954bc"
other = "Дыбыс деңгейін төмендетіңіз."
[helpFFplayDescription]
hash = "sha1-f5441f6aee76222c4120066575e80c2d177ac3c0"
other = "Сипаттама"
[helpFFplayDoubleClickLeftMouseButton]
hash = "sha1-2657aa576055769952dfcde570fc9b4765d594ad"
other = "тінтуірдің сол жақ\nбатырмасын екі рет басу"
[helpFFplayIncreaseVolume]
hash = "sha1-8ba7bde2d9a80f4a7cd122cf4973975698d3bd34"
other = "Дыбыс деңгейін арттыру."
[helpFFplayKeyDown]
hash = "sha1-c5aefd2f8c6908a69b08fe4a2d235b1ae0113470"
other = "төмен"
[helpFFplayKeyHoldS]
hash = "sha1-89c5dd8287c15b3f40db66e06b038c34a715f02f"
other = "ұстау S"
[helpFFplayKeyLeft]
hash = "sha1-feb671890703fb0300a436744d34018bbc7ba13a"
other = "сол"
[helpFFplayKeyRight]
hash = "sha1-a4f025d4bf7f90ee5bec6c48b2710bc9c5bbb267"
other = "құқық"
[helpFFplayKeySpace]
hash = "sha1-a367ad00358ec44edc1d54a96df6f9114b0f8697"
other = "SPACE (пробел)"
[helpFFplayKeyUp]
hash = "sha1-e4845aa8c0e100a80eaf65446c59085236fd2098"
other = "жоғары"
[helpFFplayKeys]
hash = "sha1-0ad272ade8c568f394499f1492ecfab56e701e5d"
other = "Кілттер"
[helpFFplayPause]
hash = "sha1-e83e107900fde0c39295f599c2cf8fba8d8cb604"
other = "Кідіртіңіз немесе жоғалтуды жалғастырыңыз."
[helpFFplayQuit]
hash = "sha1-70785a2fd5d5a6519b7439f0d8cfcd7d54c5771d"
other = "Ойнатқышты жабыңыз."
[helpFFplaySeekBForward10Minutes]
hash = "sha1-58ed63343376240f2596e447b5245c1805f35234"
other = "10 минутқа алға айналдырыңыз."
[helpFFplaySeekBForward1Minute]
hash = "sha1-3fe46b8d5413b7fdc53ae9ed9427bcb1769ec74c"
other = "1 минутқа алға айналдырыңыз."
[helpFFplaySeekBackward10Minutes]
hash = "sha1-927dffe9af72ffd40f46873b452a4c90627bccf8"
other = "10 минутқа артқа айналдырыңыз."
[helpFFplaySeekBackward10Seconds]
hash = "sha1-e97615ecec0f8cf5647e8802bdda38dc2b0d809f"
other = "10 секундқа артқа айналдырыңыз."
[helpFFplaySeekBackward1Minute]
hash = "sha1-5b19e280a0850122c8ebc80c622491bb09520e1a"
other = "1 минутқа артқа айналдырыңыз."
[helpFFplaySeekForward10Seconds]
hash = "sha1-8d840251d4a1668edaea3515df197a8a79031ec3"
other = "10 секунд алға айналдырыңыз."
[helpFFplayToggleFullScreen]
hash = "sha1-d32df02849258c5b02f15e5711f54ee6a8a75fd4"
other = "Толық экранға ауысу немесе толық экраннан шығу."
[helpFFplayToggleMute]
hash = "sha1-4bdbb124fe8de3a8037c1e74719e9600b21b25ab"
other = "Дыбысты өшіріңіз немесе дыбысты қосыңыз."
[inProgressQueue] [inProgressQueue]
hash = "sha1-eff79c40e2100ae5fadf3a7d99336025edcca8b5" hash = "sha1-eff79c40e2100ae5fadf3a7d99336025edcca8b5"
other = "Орындалуда" other = "Орындалуда"

View File

@ -75,6 +75,30 @@ formPreset = "Предустановка"
gratitude = "Благодарность" gratitude = "Благодарность"
gratitudeText = "Я искренне благодарю вас за неоценимую\n\rи своевременную помощь:" gratitudeText = "Я искренне благодарю вас за неоценимую\n\rи своевременную помощь:"
help = "Справка" help = "Справка"
helpFFplay = "Клавиши проигрывателя FFplay"
helpFFplayActivateFrameStepMode = "Активировать покадровый режим."
helpFFplayCycleVideoFiltersOrShowModes = "Цикл видеофильтров или режимов показа."
helpFFplayDecreaseVolume = "Уменьшить громкость."
helpFFplayDescription = "Описание"
helpFFplayDoubleClickLeftMouseButton = "двойной щелчок\nлевой кнопкой мыши"
helpFFplayIncreaseVolume = "Увеличить громкость."
helpFFplayKeyDown = "вниз"
helpFFplayKeyHoldS = "держать S"
helpFFplayKeyLeft = "лево"
helpFFplayKeyRight = "право"
helpFFplayKeySpace = "SPACE (пробел)"
helpFFplayKeyUp = "вверх"
helpFFplayKeys = "Клавиши"
helpFFplayPause = "Поставить на паузу или продолжить проигрывать."
helpFFplayQuit = "Закрыть проигрыватель."
helpFFplaySeekBForward10Minutes = "Перемотать вперёд на 10 минут."
helpFFplaySeekBForward1Minute = "Перемотать вперёд на 1 минуту."
helpFFplaySeekBackward10Minutes = "Перемотать назад на 10 минут."
helpFFplaySeekBackward10Seconds = "Перемотать назад на 10 секунд."
helpFFplaySeekBackward1Minute = "Перемотать назад на 1 минуту."
helpFFplaySeekForward10Seconds = "Перемотать вперёд на 10 секунд."
helpFFplayToggleFullScreen = "Переключиться на полный экран или выйти с полного экрана."
helpFFplayToggleMute = "Отключить звук или включить звук."
inProgressQueue = "Выполняется" inProgressQueue = "Выполняется"
languageSelectionFormHead = "Переключить язык" languageSelectionFormHead = "Переключить язык"
languageSelectionHead = "Выберите язык" languageSelectionHead = "Выберите язык"

View File

@ -4,6 +4,7 @@ import (
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas" "fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"github.com/nicksnyder/go-i18n/v2/i18n" "github.com/nicksnyder/go-i18n/v2/i18n"
@ -14,6 +15,7 @@ import (
type ViewContract interface { type ViewContract interface {
About(ffmpegVersion string, ffprobeVersion string, ffplayVersion string) About(ffmpegVersion string, ffprobeVersion string, ffplayVersion string)
Gratitude() Gratitude()
HelpFFplay()
} }
type View struct { type View struct {
@ -144,6 +146,151 @@ func (v View) About(ffmpegVersion string, ffprobeVersion string, ffplayVersion s
view.Show() view.Show()
} }
func (v View) HelpFFplay() {
view := v.app.GetAppFyne().NewWindow(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplay",
}))
view.Resize(fyne.Size{Width: 800, Height: 550})
view.SetFixedSize(true)
data := [][]string{
[]string{
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeys",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayDescription",
}),
},
[]string{
"Q, ESC",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayQuit",
}),
},
[]string{
"F, " + v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayDoubleClickLeftMouseButton",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayToggleFullScreen",
}),
},
[]string{
"P, " +
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeySpace",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayPause",
}),
},
[]string{
"M",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayToggleMute",
}),
},
[]string{
"9, /",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayDecreaseVolume",
}),
},
[]string{
"0, *",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayIncreaseVolume",
}),
},
[]string{
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeyLeft",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekBackward10Seconds",
}),
},
[]string{
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeyRight",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekForward10Seconds",
}),
},
[]string{
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeyDown",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekBackward1Minute",
}),
},
[]string{
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeyUp",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekBForward1Minute",
}),
},
[]string{
"Page Down",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekBackward10Minutes",
}),
},
[]string{
"Page Up",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplaySeekBForward10Minutes",
}),
},
[]string{
"S, " + v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayKeyHoldS",
}),
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayActivateFrameStepMode",
}),
},
[]string{
"W",
v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "helpFFplayCycleVideoFiltersOrShowModes",
}),
},
}
list := widget.NewTable(
func() (int, int) {
return len(data), len(data[0])
},
func() fyne.CanvasObject {
return widget.NewLabel("")
},
func(i widget.TableCellID, o fyne.CanvasObject) {
if i.Row == 0 {
o.(*widget.Label).TextStyle.Bold = true
o.(*widget.Label).SizeName = theme.SizeNameSubHeadingText
}
if i.Col == 0 {
o.(*widget.Label).TextStyle.Bold = true
}
o.(*widget.Label).SetText(data[i.Row][i.Col])
})
list.SetRowHeight(0, 40)
list.SetColumnWidth(0, 200)
list.SetColumnWidth(1, 585)
list.SetRowHeight(2, 55)
view.SetContent(
container.NewScroll(list),
)
view.CenterOnScreen()
view.Show()
}
func (v View) getCopyright() *widget.RichText { func (v View) getCopyright() *widget.RichText {
return widget.NewRichTextFromMarkdown("Copyright (c) 2024 **[Leonid Nikitin (kor-elf)](https://git.kor-elf.net/kor-elf/)**.") return widget.NewRichTextFromMarkdown("Copyright (c) 2024 **[Leonid Nikitin (kor-elf)](https://git.kor-elf.net/kor-elf/)**.")
} }