Compare commits

..

8 Commits

Author SHA1 Message Date
f17104595d Merge pull request 'Версия 0.6.0' (#7) from develop into main
Reviewed-on: #7
2024-03-17 20:52:37 +05:00
21d4afcedb
Made it possible for each encoder to add its own parameters.
Added preset option for libx264.
2024-03-17 20:28:35 +05:00
8347e9fbb2
Changed Readme.md.
Updated instructions for working with translations.
2024-03-17 00:46:39 +05:00
8d17a52f00
Added .gitignore for fyne-cross/*. 2024-03-17 00:39:56 +05:00
4668da3223
Added .gitignore for translate.*.toml. 2024-03-17 00:39:32 +05:00
a3b30c4543
Deleted temporary languages/translate.*.toml files. 2024-03-17 00:32:21 +05:00
3f358c8b7d
Refactoring.
I have moved the conversion form to a separate conversion file.
2024-03-17 00:30:02 +05:00
7b7c15ad27
Fixed bug related to incorrect window size.
Sometimes when starting a program the program window was small.
2024-03-16 21:45:14 +05:00
49 changed files with 992 additions and 820 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
fyne-cross/*

View File

@ -35,8 +35,11 @@
## Работа с переводами: ## Работа с переводами:
1. go install -v github.com/nicksnyder/go-i18n/v2/goi18n@latest 1. go install -v github.com/nicksnyder/go-i18n/v2/goi18n@latest
2. goi18n merge -sourceLanguage ru -outdir languages languages/active.\*.toml languages/translate.\*.toml 3. Создаём файл languages/translate.\*.toml
3. В файлах **languages/translate.\*.toml** переводим текст на нужный язык
4. goi18n merge -sourceLanguage ru -outdir languages languages/active.\*.toml languages/translate.\*.toml 4. goi18n merge -sourceLanguage ru -outdir languages languages/active.\*.toml languages/translate.\*.toml
5. В файлах **languages/translate.\*.toml** переводим текст на нужный язык
6. goi18n merge -sourceLanguage ru -outdir languages languages/active.\*.toml languages/translate.\*.toml
___где * подставляем нужный язык___
Более подробно можно почитать тут: https://github.com/nicksnyder/go-i18n Более подробно можно почитать тут: https://github.com/nicksnyder/go-i18n

View File

@ -1,24 +1,18 @@
package convertor package convertor
import ( import (
"errors"
"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/storage"
"fyne.io/fyne/v2/widget" "fyne.io/fyne/v2/widget"
encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor/view"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel/encoder"
"github.com/nicksnyder/go-i18n/v2/i18n" "github.com/nicksnyder/go-i18n/v2/i18n"
"image/color" "image/color"
"path/filepath"
) )
type ViewContract interface { type ViewContract interface {
Main( Main(
runConvert func(setting HandleConvertSetting), formConversion view.ConversionContract,
formats encoder.ConvertorFormatsContract,
) )
SelectFFPath( SelectFFPath(
ffmpegPath string, ffmpegPath string,
@ -33,275 +27,18 @@ type View struct {
app kernel.AppContract app kernel.AppContract
} }
type HandleConvertSetting struct {
VideoFileInput kernel.File
DirectoryForSave string
OverwriteOutputFiles bool
Format string
Encoder encoder2.EncoderContract
}
type enableFormConversionStruct struct {
fileVideoForConversion *widget.Button
buttonForSelectedDir *widget.Button
form *widget.Form
}
func NewView(app kernel.AppContract) *View { func NewView(app kernel.AppContract) *View {
return &View{ return &View{
app: app, app: app,
} }
} }
func (v View) Main( func (v View) Main(formConversion view.ConversionContract) {
runConvert func(setting HandleConvertSetting),
formats encoder.ConvertorFormatsContract,
) {
form := &widget.Form{}
conversionMessage := canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
conversionMessage.TextSize = 16
conversionMessage.TextStyle = fyne.TextStyle{Bold: true}
fileVideoForConversion, fileVideoForConversionMessage, fileInput := v.getButtonFileVideoForConversion(form, conversionMessage)
buttonForSelectedDir, buttonForSelectedDirMessage, pathToSaveDirectory := v.getButtonForSelectingDirectoryForSaving()
isOverwriteOutputFiles := false
checkboxOverwriteOutputFilesTitle := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "checkboxOverwriteOutputFilesTitle",
})
checkboxOverwriteOutputFiles := widget.NewCheck(checkboxOverwriteOutputFilesTitle, func(b bool) {
isOverwriteOutputFiles = b
})
selectEncoder := v.getSelectFormat(formats)
form.Items = []*widget.FormItem{
{
Text: v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "fileForConversionTitle"}),
Widget: fileVideoForConversion,
},
{
Widget: container.NewHScroll(fileVideoForConversionMessage),
},
{
Text: v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "buttonForSelectedDirTitle"}),
Widget: buttonForSelectedDir,
},
{
Widget: container.NewHScroll(buttonForSelectedDirMessage),
},
{
Widget: checkboxOverwriteOutputFiles,
},
{
Widget: selectEncoder.SelectFileType,
},
{
Text: v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "selectFormat"}),
Widget: selectEncoder.SelectFormat,
},
{
Text: v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "selectEncoder"}),
Widget: selectEncoder.SelectEncoder,
},
}
form.SubmitText = v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "converterVideoFilesSubmitTitle",
})
enableFormConversionStruct := enableFormConversionStruct{
fileVideoForConversion: fileVideoForConversion,
buttonForSelectedDir: buttonForSelectedDir,
form: form,
}
form.OnSubmit = func() {
if len(*pathToSaveDirectory) == 0 {
showConversionMessage(conversionMessage, errors.New(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedFolderSave",
})))
enableFormConversion(enableFormConversionStruct)
return
}
if len(selectEncoder.SelectFormat.Selected) == 0 {
showConversionMessage(conversionMessage, errors.New(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedFormat",
})))
return
}
if selectEncoder.Encoder == nil {
showConversionMessage(conversionMessage, errors.New(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedEncoder",
})))
return
}
conversionMessage.Text = ""
fileVideoForConversion.Disable()
buttonForSelectedDir.Disable()
form.Disable()
setting := HandleConvertSetting{
VideoFileInput: *fileInput,
DirectoryForSave: *pathToSaveDirectory,
OverwriteOutputFiles: isOverwriteOutputFiles,
Format: selectEncoder.SelectFormat.Selected,
Encoder: selectEncoder.Encoder,
}
runConvert(setting)
enableFormConversion(enableFormConversionStruct)
fileVideoForConversionMessage.Text = ""
form.Disable()
}
converterVideoFilesTitle := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{ converterVideoFilesTitle := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "converterVideoFilesTitle", MessageID: "converterVideoFilesTitle",
}) })
v.app.GetWindow().SetContent(widget.NewCard(converterVideoFilesTitle, "", container.NewVBox(form, conversionMessage))) v.app.GetWindow().SetContent(widget.NewCard(converterVideoFilesTitle, "", container.NewVScroll(formConversion.GetContent())))
form.Disable() formConversion.AfterViewContent()
}
func (v View) getButtonFileVideoForConversion(form *widget.Form, conversionMessage *canvas.Text) (*widget.Button, *canvas.Text, *kernel.File) {
fileInput := &kernel.File{}
fileVideoForConversionMessage := canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
fileVideoForConversionMessage.TextSize = 16
fileVideoForConversionMessage.TextStyle = fyne.TextStyle{Bold: true}
buttonTitle := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "choose",
})
var locationURI fyne.ListableURI
button := widget.NewButton(buttonTitle, func() {
v.app.GetWindow().NewFileOpen(func(r fyne.URIReadCloser, err error) {
if err != nil {
fileVideoForConversionMessage.Text = err.Error()
setStringErrorStyle(fileVideoForConversionMessage)
return
}
if r == nil {
return
}
fileInput.Path = r.URI().Path()
fileInput.Name = r.URI().Name()
fileInput.Ext = r.URI().Extension()
fileVideoForConversionMessage.Text = r.URI().Path()
setStringSuccessStyle(fileVideoForConversionMessage)
form.Enable()
conversionMessage.Text = ""
listableURI := storage.NewFileURI(filepath.Dir(r.URI().Path()))
locationURI, err = storage.ListerForURI(listableURI)
}, locationURI)
})
return button, fileVideoForConversionMessage, fileInput
}
func (v View) getButtonForSelectingDirectoryForSaving() (button *widget.Button, buttonMessage *canvas.Text, dirPath *string) {
buttonMessage = canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
buttonMessage.TextSize = 16
buttonMessage.TextStyle = fyne.TextStyle{Bold: true}
path := ""
dirPath = &path
buttonTitle := v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "choose",
})
var locationURI fyne.ListableURI
button = widget.NewButton(buttonTitle, func() {
v.app.GetWindow().NewFolderOpen(func(r fyne.ListableURI, err error) {
if err != nil {
buttonMessage.Text = err.Error()
setStringErrorStyle(buttonMessage)
return
}
if r == nil {
return
}
path = r.Path()
buttonMessage.Text = r.Path()
setStringSuccessStyle(buttonMessage)
locationURI, _ = storage.ListerForURI(r)
}, locationURI)
})
return
}
type selectEncoder struct {
SelectFileType *widget.RadioGroup
SelectFormat *widget.Select
SelectEncoder *widget.Select
Encoder encoder2.EncoderContract
}
func (v View) getSelectFormat(formats encoder.ConvertorFormatsContract) *selectEncoder {
selectEncoder := &selectEncoder{}
encoders := map[int]encoder2.EncoderDataContract{}
selectEncoder.SelectEncoder = widget.NewSelect([]string{}, func(s string) {
if encoders[selectEncoder.SelectEncoder.SelectedIndex()] == nil {
return
}
selectEncoder.Encoder = encoders[selectEncoder.SelectEncoder.SelectedIndex()].NewEncoder()
})
formatSelected := ""
selectEncoder.SelectFormat = widget.NewSelect([]string{}, func(s string) {
if formatSelected == s {
return
}
formatSelected = s
format, err := formats.GetFormat(s)
if err != nil {
return
}
encoderOptions := []string{}
encoders = format.GetEncoders()
for _, e := range encoders {
encoderOptions = append(encoderOptions, v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "encoder_" + e.GetTitle()}))
}
selectEncoder.SelectEncoder.SetOptions(encoderOptions)
selectEncoder.SelectEncoder.SetSelectedIndex(0)
})
fileTypeOptions := []string{}
for _, fileType := range encoder2.GetListFileType() {
fileTypeOptions = append(fileTypeOptions, fileType.Name())
}
selectEncoder.SelectFileType = widget.NewRadioGroup([]string{"video", "audio", "image"}, func(s string) {
formatOptions := []string{}
for _, f := range formats.GetFormats() {
if s != f.GetFileType().Name() {
continue
}
formatOptions = append(formatOptions, f.GetTitle())
}
selectEncoder.SelectFormat.SetOptions(formatOptions)
if s == encoder2.FileType(encoder2.Video).Name() {
selectEncoder.SelectFormat.SetSelected("mp4")
} else {
selectEncoder.SelectFormat.SetSelectedIndex(0)
}
})
selectEncoder.SelectFileType.Horizontal = true
selectEncoder.SelectFileType.SetSelected("video")
return selectEncoder
} }
func setStringErrorStyle(text *canvas.Text) { func setStringErrorStyle(text *canvas.Text) {
@ -313,14 +50,3 @@ func setStringSuccessStyle(text *canvas.Text) {
text.Color = color.RGBA{R: 49, G: 127, B: 114, A: 255} text.Color = color.RGBA{R: 49, G: 127, B: 114, A: 255}
text.Refresh() text.Refresh()
} }
func showConversionMessage(conversionMessage *canvas.Text, err error) {
conversionMessage.Text = err.Error()
setStringErrorStyle(conversionMessage)
}
func enableFormConversion(enableFormConversionStruct enableFormConversionStruct) {
enableFormConversionStruct.fileVideoForConversion.Enable()
enableFormConversionStruct.buttonForSelectedDir.Enable()
enableFormConversionStruct.form.Enable()
}

View File

@ -0,0 +1,444 @@
package view
import (
"errors"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/storage"
"fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor/view/form_items"
encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel/encoder"
"github.com/nicksnyder/go-i18n/v2/i18n"
"image/color"
"path/filepath"
)
type ConversionContract interface {
GetContent() fyne.CanvasObject
AfterViewContent()
}
type Conversion struct {
app kernel.AppContract
form *form
conversionMessage *canvas.Text
fileForConversion *fileForConversion
directoryForSaving *directoryForSaving
overwriteOutputFiles *overwriteOutputFiles
selectEncoder *selectEncoder
runConvert func(setting HandleConvertSetting)
}
type HandleConvertSetting struct {
FileInput kernel.File
DirectoryForSave string
OverwriteOutputFiles bool
Format string
Encoder encoder2.EncoderContract
}
func NewConversion(app kernel.AppContract, formats encoder.ConvertorFormatsContract, runConvert func(setting HandleConvertSetting)) *Conversion {
conversionMessage := canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
conversionMessage.TextSize = 16
conversionMessage.TextStyle = fyne.TextStyle{Bold: true}
fileForConversion := newFileForConversion(app)
directoryForSaving := newDirectoryForSaving(app)
overwriteOutputFiles := newOverwriteOutputFiles(app)
selectEncoder := newSelectEncoder(app, formats)
items := []*widget.FormItem{
{
Text: app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "fileForConversionTitle"}),
Widget: fileForConversion.button,
},
{
Widget: container.NewHScroll(fileForConversion.message),
},
{
Text: app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "buttonForSelectedDirTitle"}),
Widget: directoryForSaving.button,
},
{
Widget: container.NewHScroll(directoryForSaving.message),
},
{
Widget: overwriteOutputFiles.checkbox,
},
{
Widget: selectEncoder.SelectFileType,
},
{
Text: app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "selectFormat"}),
Widget: selectEncoder.SelectFormat,
},
{
Text: app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "selectEncoder"}),
Widget: selectEncoder.SelectEncoder,
},
}
form := newForm(app, items)
return &Conversion{
app: app,
form: form,
conversionMessage: conversionMessage,
fileForConversion: fileForConversion,
directoryForSaving: directoryForSaving,
overwriteOutputFiles: overwriteOutputFiles,
selectEncoder: selectEncoder,
runConvert: runConvert,
}
}
func (c Conversion) GetContent() fyne.CanvasObject {
c.form.form.OnSubmit = c.submit
c.fileForConversion.AddChangeCallback(c.selectFileForConversion)
c.selectEncoder.AddChangeCallback(c.changeEncoder)
if c.selectEncoder.Encoder != nil {
c.selectEncoder.SelectEncoder.SetSelectedIndex(c.selectEncoder.SelectEncoder.SelectedIndex())
}
return container.NewVBox(
c.form.form,
c.conversionMessage,
)
}
func (c Conversion) changeEncoder(encoder encoder2.EncoderContract) {
items := []*widget.FormItem{}
if form_items.Views[encoder.GetName()] != nil {
items = form_items.Views[encoder.GetName()](encoder, c.app)
}
c.form.ChangeItems(items)
}
func (c Conversion) AfterViewContent() {
c.form.form.Disable()
}
func (c Conversion) selectFileForConversion(err error) {
c.conversionMessage.Text = ""
if err != nil {
c.form.form.Disable()
return
}
c.form.form.Enable()
}
func (c Conversion) submit() {
if len(c.directoryForSaving.path) == 0 {
showConversionMessage(c.conversionMessage, errors.New(c.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedFolderSave",
})))
c.enableFormConversion()
return
}
if len(c.selectEncoder.SelectFormat.Selected) == 0 {
showConversionMessage(c.conversionMessage, errors.New(c.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedFormat",
})))
return
}
if c.selectEncoder.Encoder == nil {
showConversionMessage(c.conversionMessage, errors.New(c.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "errorSelectedEncoder",
})))
return
}
c.conversionMessage.Text = ""
c.fileForConversion.button.Disable()
c.directoryForSaving.button.Disable()
c.form.form.Disable()
setting := HandleConvertSetting{
FileInput: *c.fileForConversion.file,
DirectoryForSave: c.directoryForSaving.path,
OverwriteOutputFiles: c.overwriteOutputFiles.IsChecked(),
Format: c.selectEncoder.SelectFormat.Selected,
Encoder: c.selectEncoder.Encoder,
}
c.runConvert(setting)
c.enableFormConversion()
c.fileForConversion.message.Text = ""
c.form.form.Disable()
}
func (c Conversion) enableFormConversion() {
c.fileForConversion.button.Enable()
c.directoryForSaving.button.Enable()
c.form.form.Enable()
}
type fileForConversion struct {
button *widget.Button
message *canvas.Text
file *kernel.File
changeCallbacks map[int]func(err error)
}
func newFileForConversion(app kernel.AppContract) *fileForConversion {
fileForConversion := &fileForConversion{
file: &kernel.File{},
changeCallbacks: map[int]func(err error){},
}
buttonTitle := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "choose",
})
fileForConversion.message = canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
fileForConversion.message.TextSize = 16
fileForConversion.message.TextStyle = fyne.TextStyle{Bold: true}
var locationURI fyne.ListableURI
fileForConversion.button = widget.NewButton(buttonTitle, func() {
app.GetWindow().NewFileOpen(func(r fyne.URIReadCloser, err error) {
if err != nil {
fileForConversion.message.Text = err.Error()
setStringErrorStyle(fileForConversion.message)
fileForConversion.eventSelectFile(err)
return
}
if r == nil {
return
}
fileForConversion.file.Path = r.URI().Path()
fileForConversion.file.Name = r.URI().Name()
fileForConversion.file.Ext = r.URI().Extension()
fileForConversion.message.Text = r.URI().Path()
setStringSuccessStyle(fileForConversion.message)
fileForConversion.eventSelectFile(nil)
listableURI := storage.NewFileURI(filepath.Dir(r.URI().Path()))
locationURI, err = storage.ListerForURI(listableURI)
}, locationURI)
})
return fileForConversion
}
func (c fileForConversion) AddChangeCallback(callback func(err error)) {
c.changeCallbacks[len(c.changeCallbacks)] = callback
}
func (c fileForConversion) eventSelectFile(err error) {
for _, changeCallback := range c.changeCallbacks {
changeCallback(err)
}
}
type directoryForSaving struct {
button *widget.Button
message *canvas.Text
path string
}
func newDirectoryForSaving(app kernel.AppContract) *directoryForSaving {
directoryForSaving := &directoryForSaving{
path: "",
}
directoryForSaving.message = canvas.NewText("", color.RGBA{R: 255, G: 0, B: 0, A: 255})
directoryForSaving.message.TextSize = 16
directoryForSaving.message.TextStyle = fyne.TextStyle{Bold: true}
buttonTitle := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "choose",
})
var locationURI fyne.ListableURI
directoryForSaving.button = widget.NewButton(buttonTitle, func() {
app.GetWindow().NewFolderOpen(func(r fyne.ListableURI, err error) {
if err != nil {
directoryForSaving.message.Text = err.Error()
setStringErrorStyle(directoryForSaving.message)
return
}
if r == nil {
return
}
directoryForSaving.path = r.Path()
directoryForSaving.message.Text = r.Path()
setStringSuccessStyle(directoryForSaving.message)
locationURI, _ = storage.ListerForURI(r)
}, locationURI)
})
return directoryForSaving
}
type overwriteOutputFiles struct {
checkbox *widget.Check
isChecked bool
}
func newOverwriteOutputFiles(app kernel.AppContract) *overwriteOutputFiles {
overwriteOutputFiles := &overwriteOutputFiles{
isChecked: false,
}
checkboxOverwriteOutputFilesTitle := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "checkboxOverwriteOutputFilesTitle",
})
overwriteOutputFiles.checkbox = widget.NewCheck(checkboxOverwriteOutputFilesTitle, func(b bool) {
overwriteOutputFiles.isChecked = b
})
return overwriteOutputFiles
}
func (receiver overwriteOutputFiles) IsChecked() bool {
return receiver.isChecked
}
type selectEncoder struct {
SelectFileType *widget.RadioGroup
SelectFormat *widget.Select
SelectEncoder *widget.Select
Encoder encoder2.EncoderContract
changeCallbacks map[int]func(encoder encoder2.EncoderContract)
}
func newSelectEncoder(app kernel.AppContract, formats encoder.ConvertorFormatsContract) *selectEncoder {
selectEncoder := &selectEncoder{
changeCallbacks: map[int]func(encoder encoder2.EncoderContract){},
}
encoders := map[int]encoder2.EncoderDataContract{}
selectEncoder.SelectEncoder = widget.NewSelect([]string{}, func(s string) {
if encoders[selectEncoder.SelectEncoder.SelectedIndex()] == nil {
return
}
selectEncoderData := encoders[selectEncoder.SelectEncoder.SelectedIndex()]
selectEncoder.ChangeEncoder(selectEncoderData.NewEncoder())
})
formatSelected := ""
selectEncoder.SelectFormat = widget.NewSelect([]string{}, func(s string) {
if formatSelected == s {
return
}
formatSelected = s
format, err := formats.GetFormat(s)
if err != nil {
return
}
encoderOptions := []string{}
encoders = map[int]encoder2.EncoderDataContract{}
for _, e := range format.GetEncoders() {
encoders[len(encoders)] = e
encoderOptions = append(encoderOptions, app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "encoder_" + e.GetTitle()}))
}
selectEncoder.SelectEncoder.SetOptions(encoderOptions)
selectEncoder.SelectEncoder.SetSelectedIndex(0)
})
fileTypeOptions := []string{}
for _, fileType := range encoder2.GetListFileType() {
fileTypeOptions = append(fileTypeOptions, fileType.Name())
}
encoderGroupVideo := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "encoderGroupVideo"})
encoderGroupAudio := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "encoderGroupAudio"})
encoderGroupImage := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "encoderGroupImage"})
encoderGroup := map[string]string{
encoderGroupVideo: "video",
encoderGroupAudio: "audio",
encoderGroupImage: "image",
}
selectEncoder.SelectFileType = widget.NewRadioGroup([]string{encoderGroupVideo, encoderGroupAudio, encoderGroupImage}, func(s string) {
groupCode := encoderGroup[s]
formatOptions := []string{}
for _, f := range formats.GetFormats() {
if groupCode != f.GetFileType().Name() {
continue
}
formatOptions = append(formatOptions, f.GetTitle())
}
selectEncoder.SelectFormat.SetOptions(formatOptions)
if groupCode == encoder2.FileType(encoder2.Video).Name() {
selectEncoder.SelectFormat.SetSelected("mp4")
} else {
selectEncoder.SelectFormat.SetSelectedIndex(0)
}
})
selectEncoder.SelectFileType.Horizontal = true
selectEncoder.SelectFileType.Required = true
selectEncoder.SelectFileType.SetSelected(encoderGroupVideo)
return selectEncoder
}
func (e *selectEncoder) ChangeEncoder(encoder encoder2.EncoderContract) {
e.Encoder = encoder
e.eventSelectEncoder(e.Encoder)
}
func (e *selectEncoder) AddChangeCallback(callback func(encoder encoder2.EncoderContract)) {
e.changeCallbacks[len(e.changeCallbacks)] = callback
}
func (e *selectEncoder) eventSelectEncoder(encoder encoder2.EncoderContract) {
for _, changeCallback := range e.changeCallbacks {
changeCallback(encoder)
}
}
func setStringErrorStyle(text *canvas.Text) {
text.Color = color.RGBA{R: 255, G: 0, B: 0, A: 255}
text.Refresh()
}
func setStringSuccessStyle(text *canvas.Text) {
text.Color = color.RGBA{R: 49, G: 127, B: 114, A: 255}
text.Refresh()
}
func showConversionMessage(conversionMessage *canvas.Text, err error) {
conversionMessage.Text = err.Error()
setStringErrorStyle(conversionMessage)
}
type form struct {
form *widget.Form
items []*widget.FormItem
}
func newForm(app kernel.AppContract, items []*widget.FormItem) *form {
f := widget.NewForm()
f.SubmitText = app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "converterVideoFilesSubmitTitle",
})
f.Items = items
return &form{
form: f,
items: items,
}
}
func (f form) ChangeItems(items []*widget.FormItem) {
f.form.Items = f.items
f.form.Refresh()
f.form.Items = append(f.form.Items, items...)
f.form.Refresh()
}

View File

@ -0,0 +1,12 @@
package form_items
import (
"fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor/view/form_items/libx264"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
)
var Views = map[string]func(encoder encoder.EncoderContract, app kernel.AppContract) []*widget.FormItem{
"libx264": libx264.View,
}

View File

@ -0,0 +1,65 @@
package libx264
import (
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder/libx264"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"github.com/nicksnyder/go-i18n/v2/i18n"
)
func View(encoder encoder.EncoderContract, app kernel.AppContract) []*widget.FormItem {
items := []*widget.FormItem{}
items = append(items, presetParameter(encoder, app)...)
return items
}
func presetParameter(encoder encoder.EncoderContract, app kernel.AppContract) []*widget.FormItem {
parameter, err := encoder.GetParameter("preset")
if err != nil {
return nil
}
presets := map[string]string{}
presetsForSelect := []string{}
presetDefault := ""
for _, name := range libx264.Presets {
title := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "preset_" + name})
presetsForSelect = append(presetsForSelect, title)
presets[title] = name
if name == parameter.Get() {
presetDefault = title
}
}
elementSelect := widget.NewSelect(presetsForSelect, func(s string) {
if presets[s] == "" {
return
}
parameter.Set(presets[s])
})
elementSelect.SetSelected(presetDefault)
elementSelect.Hide()
checkboxTitle := app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "parameterCheckbox"})
elementCheckbox := widget.NewCheck(checkboxTitle, func(b bool) {
if b == true {
parameter.SetEnable()
elementSelect.Show()
return
}
parameter.SetDisable()
elementSelect.Hide()
})
return []*widget.FormItem{
{
Text: app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{MessageID: "formPreset"}),
Widget: container.NewVBox(elementCheckbox, elementSelect),
},
}
}

View File

@ -2,15 +2,13 @@ package apng
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "apng"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("apng", parameters, getParams)
return []string{"-c:v", "apng"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package bmp
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "bmp"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("bmp", parameters, getParams)
return []string{"-c:v", "bmp"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -1,7 +1,20 @@
package encoder package encoder
import "errors"
type EncoderContract interface { type EncoderContract interface {
GetName() string
GetParams() []string GetParams() []string
GetParameter(name string) (ParameterContract, error)
}
type ParameterContract interface {
GetName() string
Set(string) error
Get() string
IsEnabled() bool
SetEnable()
SetDisable()
} }
type EncoderDataContract interface { type EncoderDataContract interface {
@ -77,3 +90,80 @@ func GetListFileType() []FileTypeContract {
FileType(Image), FileType(Image),
} }
} }
type Encoder struct {
name string
parameters map[string]ParameterContract
getParams func(parameters map[string]ParameterContract) []string
}
func NewEncoder(name string, parameters map[string]ParameterContract, getParams func(parameters map[string]ParameterContract) []string) *Encoder {
return &Encoder{
name: name,
parameters: parameters,
getParams: getParams,
}
}
func (e *Encoder) GetName() string {
return e.name
}
func (e *Encoder) GetParams() []string {
return e.getParams(e.parameters)
}
func (e *Encoder) GetParameter(name string) (ParameterContract, error) {
if e.parameters[name] == nil {
return nil, errors.New("parameter not found")
}
return e.parameters[name], nil
}
type Parameter struct {
name string
isEnabled bool
parameter string
setParameter func(string) (string, error)
}
func NewParameter(name string, isEnabled bool, defaultParameter string, setParameter func(string) (string, error)) *Parameter {
return &Parameter{
name: name,
isEnabled: isEnabled,
parameter: defaultParameter,
setParameter: setParameter,
}
}
func (p *Parameter) GetName() string {
return p.name
}
func (p *Parameter) Set(s string) (err error) {
if p.setParameter != nil {
s, err = p.setParameter(s)
if err != nil {
return err
}
}
p.parameter = s
return nil
}
func (p *Parameter) Get() string {
return p.parameter
}
func (p *Parameter) IsEnabled() bool {
return p.isEnabled
}
func (p *Parameter) SetEnable() {
p.isEnabled = true
}
func (p *Parameter) SetDisable() {
p.isEnabled = false
}

View File

@ -2,15 +2,13 @@ package flv
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "flv"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("flv", parameters, getParams)
return []string{"-c:v", "flv"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package gif
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "gif"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("gif", parameters, getParams)
return []string{"-c:v", "gif"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -4,15 +4,13 @@ import (
encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
) )
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "h264_nvenc"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("h264_nvenc", parameters, getParams)
return []string{"-c:v", "h264_nvenc"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libmp3lame
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "libmp3lame"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libmp3lame", parameters, getParams)
return []string{"-c:a", "libmp3lame"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libshine
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "libshine"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libshine", parameters, getParams)
return []string{"-c:a", "libshine"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libtwolame
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "libtwolame"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libtwolame", parameters, getParams)
return []string{"-c:a", "libtwolame"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libvpx
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libvpx"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libvpx", parameters, getParams)
return []string{"-c:v", "libvpx"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libvpx_vp9
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libvpx-vp9"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libvpx_vp9", parameters, getParams)
return []string{"-c:v", "libvpx-vp9"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libwebp
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libwebp"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libwebp", parameters, getParams)
return []string{"-c:v", "libwebp"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libwebp_anim
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libwebp_anim"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libwebp_anim", parameters, getParams)
return []string{"-c:v", "libwebp_anim"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -1,16 +1,38 @@
package libx264 package libx264
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import (
"errors"
encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
)
type encoder struct { var Presets = []string{
"ultrafast",
"superfast",
"veryfast",
"faster",
"fast",
"medium",
"slow",
"slower",
"veryslow",
"placebo",
} }
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{
} "preset": newParameterPreset(),
}
getParams := func(parameters map[string]encoder2.ParameterContract) []string {
params := []string{"-c:v", "libx264"}
func (e encoder) GetParams() []string { if parameters["preset"] != nil && parameters["preset"].IsEnabled() {
return []string{"-c:v", "libx264"} params = append(params, "-preset", parameters["preset"].Get())
}
return params
}
return encoder2.NewEncoder("libx264", parameters, getParams)
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {
@ -19,3 +41,16 @@ func NewData() encoder2.EncoderDataContract {
fileType := encoder2.FileType(encoder2.Video) fileType := encoder2.FileType(encoder2.Video)
return encoder2.NewData(title, formats, fileType, NewEncoder) return encoder2.NewData(title, formats, fileType, NewEncoder)
} }
func newParameterPreset() encoder2.ParameterContract {
setParameter := func(s string) (string, error) {
for _, value := range Presets {
if value == s {
return value, nil
}
}
return "", errors.New("preset not found")
}
return encoder2.NewParameter("preset", false, "medium", setParameter)
}

View File

@ -2,15 +2,13 @@ package libx265
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libx265"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libx265", parameters, getParams)
return []string{"-c:v", "libx265"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package libxvid
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "libxvid"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("libxvid", parameters, getParams)
return []string{"-c:v", "libxvid"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mjpeg
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "mjpeg"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mjpeg", parameters, getParams)
return []string{"-c:v", "mjpeg"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mp2
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "mp2"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mp2", parameters, getParams)
return []string{"-c:a", "mp2"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mp2fixed
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "mp2fixed"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mp2fixed", parameters, getParams)
return []string{"-c:a", "mp2fixed"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mpeg1video
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "mpeg1video"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mpeg1video", parameters, getParams)
return []string{"-c:v", "mpeg1video"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mpeg2video
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "mpeg2video"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mpeg2video", parameters, getParams)
return []string{"-c:v", "mpeg2video"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package mpeg4
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "mpeg4"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("mpeg4", parameters, getParams)
return []string{"-c:v", "mpeg4"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package msmpeg4
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "msmpeg4"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("msmpeg4", parameters, getParams)
return []string{"-c:v", "msmpeg4"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package msmpeg4v2
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "msmpeg4v2"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("msmpeg4v2", parameters, getParams)
return []string{"-c:v", "msmpeg4v2"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package msvideo1
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "msvideo1"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("msvideo1", parameters, getParams)
return []string{"-c:v", "msvideo1"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package png
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "png"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("png", parameters, getParams)
return []string{"-c:v", "png"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package qtrle
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "qtrle"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("qtrle", parameters, getParams)
return []string{"-c:v", "qtrle"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package sgi
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "sgi"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("sgi", parameters, getParams)
return []string{"-c:v", "sgi"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package tiff
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "tiff"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("tiff", parameters, getParams)
return []string{"-c:v", "tiff"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package wmav1
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "wmav1"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("wmav1", parameters, getParams)
return []string{"-c:a", "wmav1"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package wmav2
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:a", "wmav2"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("wmav2", parameters, getParams)
return []string{"-c:a", "wmav2"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package wmv1
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "wmv1"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("wmv1", parameters, getParams)
return []string{"-c:v", "wmv1"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package wmv2
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "wmv2"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("wmv2", parameters, getParams)
return []string{"-c:v", "wmv2"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -2,15 +2,13 @@ package xbm
import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder" import encoder2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/encoder"
type encoder struct {
}
func NewEncoder() encoder2.EncoderContract { func NewEncoder() encoder2.EncoderContract {
return &encoder{} parameters := map[string]encoder2.ParameterContract{}
} getParams := func(parameters map[string]encoder2.ParameterContract) []string {
return []string{"-c:v", "xbm"}
}
func (e encoder) GetParams() []string { return encoder2.NewEncoder("xbm", parameters, getParams)
return []string{"-c:v", "xbm"}
} }
func NewData() encoder2.EncoderDataContract { func NewData() encoder2.EncoderDataContract {

View File

@ -3,6 +3,7 @@ package handler
import ( import (
"errors" "errors"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/convertor/view"
error2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/error" error2 "git.kor-elf.net/kor-elf/gui-for-ffmpeg/error"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/helper" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/helper"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel" "git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
@ -44,7 +45,8 @@ func (h ConvertorHandler) MainConvertor() {
h.errorView.PanicError(err) h.errorView.PanicError(err)
return return
} }
h.convertorView.Main(h.runConvert, formats) conversion := view.NewConversion(h.app, formats, h.runConvert)
h.convertorView.Main(conversion)
return return
} }
h.convertorView.SelectFFPath("", "", h.saveSettingFFPath, nil, h.downloadFFmpeg) h.convertorView.SelectFFPath("", "", h.saveSettingFFPath, nil, h.downloadFFmpeg)
@ -64,12 +66,12 @@ func (h ConvertorHandler) GetFfprobeVersion() (string, error) {
return h.app.GetConvertorService().GetFFprobeVersion() return h.app.GetConvertorService().GetFFprobeVersion()
} }
func (h ConvertorHandler) runConvert(setting convertor.HandleConvertSetting) { func (h ConvertorHandler) runConvert(setting view.HandleConvertSetting) {
h.app.GetQueue().Add(&kernel.ConvertSetting{ h.app.GetQueue().Add(&kernel.ConvertSetting{
VideoFileInput: setting.VideoFileInput, VideoFileInput: setting.FileInput,
VideoFileOut: kernel.File{ VideoFileOut: kernel.File{
Path: setting.DirectoryForSave + helper.PathSeparator() + setting.VideoFileInput.Name + "." + setting.Format, Path: setting.DirectoryForSave + helper.PathSeparator() + setting.FileInput.Name + "." + setting.Format,
Name: setting.VideoFileInput.Name, Name: setting.FileInput.Name,
Ext: "." + setting.Format, Ext: "." + setting.Format,
}, },
OverwriteOutputFiles: setting.OverwriteOutputFiles, OverwriteOutputFiles: setting.OverwriteOutputFiles,

View File

@ -22,7 +22,8 @@ type Window struct {
} }
func newWindow(w fyne.Window, layout LayoutContract) Window { func newWindow(w fyne.Window, layout LayoutContract) Window {
w.Resize(fyne.Size{Width: 1039, Height: 599}) windowSize := fyne.Size{Width: 1039, Height: 599}
w.Resize(windowSize)
w.CenterOnScreen() w.CenterOnScreen()
go func() { go func() {
@ -30,11 +31,10 @@ func newWindow(w fyne.Window, layout LayoutContract) Window {
* Bug fixed. * Bug fixed.
* When starting the program, sometimes the window was displayed incorrectly. * When starting the program, sometimes the window was displayed incorrectly.
*/ */
windowSize.Width += 1
windowSize.Height += 1
time.Sleep(time.Millisecond * 500) time.Sleep(time.Millisecond * 500)
size := w.Canvas().Size() w.Resize(windowSize)
size.Width += 1
size.Height += 1
w.Resize(size)
}() }()
return Window{ return Window{

1
languages/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
translate.*.toml

View File

@ -15,8 +15,8 @@ hash = "sha1-c223c2e15171156192bc3146aee91e6094bb475b"
other = "Download FFmpeg automatically" other = "Download FFmpeg automatically"
[buttonForSelectedDirTitle] [buttonForSelectedDirTitle]
hash = "sha1-52b13f1b13e82d22e8c4102332db5d4ec551247b" hash = "sha1-8cbe5c67bcf89e4624635a79cbea104227faedda"
other = "Folder where it will be saved:" other = "Save to folder:"
[cancel] [cancel]
hash = "sha1-0ec753be8df955a117404fb634b01b45eb386e2a" hash = "sha1-0ec753be8df955a117404fb634b01b45eb386e2a"
@ -62,6 +62,18 @@ other = "Will be downloaded from the site:"
hash = "sha1-55f87f114628fa2d5d8e67d1e1cda22c0e4f9271" hash = "sha1-55f87f114628fa2d5d8e67d1e1cda22c0e4f9271"
other = "Downloading..." other = "Downloading..."
[encoderGroupAudio]
hash = "sha1-24321cb5400df96be8f3e2131918bebdb3a01bba"
other = "Audio"
[encoderGroupImage]
hash = "sha1-a7e528bc7ac9538aec87d1593c38b80be95d4745"
other = "Images"
[encoderGroupVideo]
hash = "sha1-8e7b9894c7ef0f57ac0bf910f6a8aac1c8a53683"
other = "Video"
[encoder_apng] [encoder_apng]
hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf" hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf"
other = "APNG image" other = "APNG image"
@ -251,8 +263,12 @@ hash = "sha1-45f772b2eca5098cd6d31f2d1dc6edec1987a617"
other = "**FFmpeg** is a trademark of **[Fabrice Bellard](http://bellard.org/)**, originator of the **[FFmpeg](https://ffmpeg.org/about.html)** project." other = "**FFmpeg** is a trademark of **[Fabrice Bellard](http://bellard.org/)**, originator of the **[FFmpeg](https://ffmpeg.org/about.html)** project."
[fileForConversionTitle] [fileForConversionTitle]
hash = "sha1-981bf090072a487e538d00780d337b47ca877372" hash = "sha1-96ac799e1086b31fd8f5f8d4c801829d6c853f08"
other = "File to convert:" other = "File:"
[formPreset]
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
other = "Preset"
[help] [help]
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f" hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
@ -278,6 +294,10 @@ other = "License information"
hash = "sha1-359fff328717c05104e51a2d29f05bf1875d26b7" hash = "sha1-359fff328717c05104e51a2d29f05bf1875d26b7"
other = "Licenses from other products used in the program" other = "Licenses from other products used in the program"
[parameterCheckbox]
hash = "sha1-9e35221d454870996fd51d576249cf47d1784a3c"
other = "Enable option"
[pathToFfmpeg] [pathToFfmpeg]
hash = "sha1-fafc50f1db0f720fe83a96cd70a9e1ad824e96b6" hash = "sha1-fafc50f1db0f720fe83a96cd70a9e1ad824e96b6"
other = "Path to FFmpeg:" other = "Path to FFmpeg:"
@ -286,6 +306,46 @@ other = "Path to FFmpeg:"
hash = "sha1-b872edc9633a2e81ef678dc46fe46a7e91732024" hash = "sha1-b872edc9633a2e81ef678dc46fe46a7e91732024"
other = "Path to FFprobe:" other = "Path to FFprobe:"
[preset_fast]
hash = "sha1-935e1ac9d3c8ba4478326c909ba66662acb0540e"
other = "fast (slower than \"faster\", but the file will weigh less)"
[preset_faster]
hash = "sha1-98620b73c896440c39ea6ec4b9b19d41301c9a7e"
other = "faster (slower than \"veryfast\", but the file will weigh less)"
[preset_medium]
hash = "sha1-f7d1c30135c22c2f07c247075c0df103bb3c3ea5"
other = "medium (slower than \"fast\", but the file will weigh less)"
[preset_placebo]
hash = "sha1-7bcff099104bb192881139e6404981bd426b3f91"
other = "placebo (not recommended)"
[preset_slow]
hash = "sha1-681bf587275a45b48af49bb2ad8f0947919530e7"
other = "slow (slower than \"medium\", but the file will weigh less)"
[preset_slower]
hash = "sha1-d1c692ee2b7643ae2c71a48bea880327a3c6b1e3"
other = "slower (slower than \"slow\", but the file will weigh less)"
[preset_superfast]
hash = "sha1-41c39959e8f1547cc9259a5b459c4ccbf368cc23"
other = "superfast (slower than \"ultrafast\", but the file will weigh less)"
[preset_ultrafast]
hash = "sha1-dfed981573ac2046832f9a9450bc9388958753fa"
other = "ultrafast (fast, but the file will weigh a lot)"
[preset_veryfast]
hash = "sha1-370b82509887d02d7a2ef9b110df4616b16123ce"
other = "veryfast (slower than \"superfast\", but the file will weigh less)"
[preset_veryslow]
hash = "sha1-d428bfa6deea9dd5c7c1f80ceba24e123ae96d0d"
other = "veryslow (slower than \"slower\", but the file will weigh less)"
[programmLink] [programmLink]
hash = "sha1-18f9a3fad6aacefe1b05eed23122800b391ff5ca" hash = "sha1-18f9a3fad6aacefe1b05eed23122800b391ff5ca"
other = "Project website" other = "Project website"
@ -303,16 +363,16 @@ hash = "sha1-4864057d626a868fa60f999bed3191d61d045ddc"
other = "Save" other = "Save"
[selectEncoder] [selectEncoder]
hash = "sha1-07beb734a090830bedf8e038e3b45c73d64b5696" hash = "sha1-88f3670b09758a3336057520a215058d61006abd"
other = "Select a converter" other = "Encoder:"
[selectFFPathTitle] [selectFFPathTitle]
hash = "sha1-95581446a28d968ff1a027c623159a7eb08654cf" hash = "sha1-95581446a28d968ff1a027c623159a7eb08654cf"
other = "Specify the path to FFmpeg and FFprobe" other = "Specify the path to FFmpeg and FFprobe"
[selectFormat] [selectFormat]
hash = "sha1-5e59b9376d321a49e73063eb7355b555d89bdd55" hash = "sha1-f3809b0b48886570cd4cf1d7099de6da5b6d4524"
other = "Select file extension" other = "File extension:"
[settings] [settings]
hash = "sha1-7f17c7c62a7fd8d1a508481f4778688927734c2f" hash = "sha1-7f17c7c62a7fd8d1a508481f4778688927734c2f"

View File

@ -15,8 +15,8 @@ hash = "sha1-c223c2e15171156192bc3146aee91e6094bb475b"
other = "FFmpeg автоматты түрде жүктеп алыңыз" other = "FFmpeg автоматты түрде жүктеп алыңыз"
[buttonForSelectedDirTitle] [buttonForSelectedDirTitle]
hash = "sha1-52b13f1b13e82d22e8c4102332db5d4ec551247b" hash = "sha1-8cbe5c67bcf89e4624635a79cbea104227faedda"
other = "Файлды сақтауға арналған каталог:" other = "Қалтаға сақтаңыз:"
[cancel] [cancel]
hash = "sha1-0ec753be8df955a117404fb634b01b45eb386e2a" hash = "sha1-0ec753be8df955a117404fb634b01b45eb386e2a"
@ -62,6 +62,18 @@ other = "Сайттан жүктеледі:"
hash = "sha1-55f87f114628fa2d5d8e67d1e1cda22c0e4f9271" hash = "sha1-55f87f114628fa2d5d8e67d1e1cda22c0e4f9271"
other = "Жүктеп алынуда..." other = "Жүктеп алынуда..."
[encoderGroupAudio]
hash = "sha1-24321cb5400df96be8f3e2131918bebdb3a01bba"
other = "Аудио"
[encoderGroupImage]
hash = "sha1-a7e528bc7ac9538aec87d1593c38b80be95d4745"
other = "Суреттер"
[encoderGroupVideo]
hash = "sha1-8e7b9894c7ef0f57ac0bf910f6a8aac1c8a53683"
other = "Бейне"
[encoder_apng] [encoder_apng]
hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf" hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf"
other = "APNG image" other = "APNG image"
@ -251,8 +263,12 @@ hash = "sha1-45f772b2eca5098cd6d31f2d1dc6edec1987a617"
other = "FFmpeg — **[FFmpeg](https://ffmpeg.org/about.html)** жобасын жасаушы **[Fabrice Bellard](http://bellard.org/)** сауда белгісі." other = "FFmpeg — **[FFmpeg](https://ffmpeg.org/about.html)** жобасын жасаушы **[Fabrice Bellard](http://bellard.org/)** сауда белгісі."
[fileForConversionTitle] [fileForConversionTitle]
hash = "sha1-981bf090072a487e538d00780d337b47ca877372" hash = "sha1-96ac799e1086b31fd8f5f8d4c801829d6c853f08"
other = "Түрлендіруге арналған файл:" other = "Файл:"
[formPreset]
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
other = "Алдын ала орнатылған"
[help] [help]
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f" hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
@ -278,6 +294,10 @@ other = "Лицензия туралы ақпарат"
hash = "sha1-359fff328717c05104e51a2d29f05bf1875d26b7" hash = "sha1-359fff328717c05104e51a2d29f05bf1875d26b7"
other = "Бағдарламада пайдаланылатын басқа өнімдердің лицензиялары" other = "Бағдарламада пайдаланылатын басқа өнімдердің лицензиялары"
[parameterCheckbox]
hash = "sha1-9e35221d454870996fd51d576249cf47d1784a3c"
other = "Опцияны қосу"
[pathToFfmpeg] [pathToFfmpeg]
hash = "sha1-fafc50f1db0f720fe83a96cd70a9e1ad824e96b6" hash = "sha1-fafc50f1db0f720fe83a96cd70a9e1ad824e96b6"
other = "FFmpeg жол:" other = "FFmpeg жол:"
@ -286,6 +306,46 @@ other = "FFmpeg жол:"
hash = "sha1-b872edc9633a2e81ef678dc46fe46a7e91732024" hash = "sha1-b872edc9633a2e81ef678dc46fe46a7e91732024"
other = "FFprobe жол:" other = "FFprobe жол:"
[preset_fast]
hash = "sha1-935e1ac9d3c8ba4478326c909ba66662acb0540e"
other = "fast («faster» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_faster]
hash = "sha1-98620b73c896440c39ea6ec4b9b19d41301c9a7e"
other = "faster («veryfast» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_medium]
hash = "sha1-f7d1c30135c22c2f07c247075c0df103bb3c3ea5"
other = "medium («fast» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_placebo]
hash = "sha1-7bcff099104bb192881139e6404981bd426b3f91"
other = "placebo (ұсынылмайды)"
[preset_slow]
hash = "sha1-681bf587275a45b48af49bb2ad8f0947919530e7"
other = "slow («medium» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_slower]
hash = "sha1-d1c692ee2b7643ae2c71a48bea880327a3c6b1e3"
other = "slower («slow» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_superfast]
hash = "sha1-41c39959e8f1547cc9259a5b459c4ccbf368cc23"
other = "superfast («ultrafast» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_ultrafast]
hash = "sha1-dfed981573ac2046832f9a9450bc9388958753fa"
other = "ultrafast (жылдам, бірақ файлдың салмағы көп болады)"
[preset_veryfast]
hash = "sha1-370b82509887d02d7a2ef9b110df4616b16123ce"
other = "veryfast («superfast» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[preset_veryslow]
hash = "sha1-d428bfa6deea9dd5c7c1f80ceba24e123ae96d0d"
other = "veryslow («slower» қарағанда баяуырақ, бірақ файлдың салмағы аз болады)"
[programmLink] [programmLink]
hash = "sha1-18f9a3fad6aacefe1b05eed23122800b391ff5ca" hash = "sha1-18f9a3fad6aacefe1b05eed23122800b391ff5ca"
other = "Жобаның веб-сайты" other = "Жобаның веб-сайты"
@ -303,16 +363,16 @@ hash = "sha1-4864057d626a868fa60f999bed3191d61d045ddc"
other = "Сақтау" other = "Сақтау"
[selectEncoder] [selectEncoder]
hash = "sha1-07beb734a090830bedf8e038e3b45c73d64b5696" hash = "sha1-88f3670b09758a3336057520a215058d61006abd"
other = "Түрлендіргішті таңдаңыз" other = "Кодировщик:"
[selectFFPathTitle] [selectFFPathTitle]
hash = "sha1-95581446a28d968ff1a027c623159a7eb08654cf" hash = "sha1-95581446a28d968ff1a027c623159a7eb08654cf"
other = "FFmpeg және FFprobe жолын көрсетіңіз" other = "FFmpeg және FFprobe жолын көрсетіңіз"
[selectFormat] [selectFormat]
hash = "sha1-5e59b9376d321a49e73063eb7355b555d89bdd55" hash = "sha1-f3809b0b48886570cd4cf1d7099de6da5b6d4524"
other = "Файл кеңейтімін таңдаңыз" other = "Файл кеңейтімі:"
[settings] [settings]
hash = "sha1-7f17c7c62a7fd8d1a508481f4778688927734c2f" hash = "sha1-7f17c7c62a7fd8d1a508481f4778688927734c2f"

View File

@ -2,7 +2,7 @@ AlsoUsedProgram = "Также в программе используется:"
about = "О программе" about = "О программе"
aboutText = "Простенький интерфейс для консольной утилиты FFmpeg. \nНо я не являюсь автором самой утилиты FFmpeg." aboutText = "Простенький интерфейс для консольной утилиты FFmpeg. \nНо я не являюсь автором самой утилиты FFmpeg."
buttonDownloadFFmpeg = "Скачать автоматически FFmpeg" buttonDownloadFFmpeg = "Скачать автоматически FFmpeg"
buttonForSelectedDirTitle = "Папка куда будет сохраняться:" buttonForSelectedDirTitle = "Сохранить в папку:"
cancel = "Отмена" cancel = "Отмена"
changeFFPath = "FFmpeg и FFprobe" changeFFPath = "FFmpeg и FFprobe"
changeLanguage = "Поменять язык" changeLanguage = "Поменять язык"
@ -14,6 +14,9 @@ converterVideoFilesTitle = "Конвертер видео, аудио и кар
download = "Скачать" download = "Скачать"
downloadFFmpegFromSite = "Будет скачано с сайта:" downloadFFmpegFromSite = "Будет скачано с сайта:"
downloadRun = "Скачивается..." downloadRun = "Скачивается..."
encoderGroupAudio = "Аудио"
encoderGroupImage = "Картинки"
encoderGroupVideo = "Видео"
encoder_apng = "APNG image" encoder_apng = "APNG image"
encoder_bmp = "BMP image" encoder_bmp = "BMP image"
encoder_flv = "FLV" encoder_flv = "FLV"
@ -61,22 +64,34 @@ errorSelectedFormat = "Расширение файла не выбрана"
exit = "Выход" exit = "Выход"
ffmpegLGPL = "Это программное обеспечение использует библиотеки из проекта **FFmpeg** под **[LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)**." ffmpegLGPL = "Это программное обеспечение использует библиотеки из проекта **FFmpeg** под **[LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)**."
ffmpegTrademark = "**FFmpeg** — торговая марка **[Fabrice Bellard](http://bellard.org/)** , создателя проекта **[FFmpeg](https://ffmpeg.org/about.html)**." ffmpegTrademark = "**FFmpeg** — торговая марка **[Fabrice Bellard](http://bellard.org/)** , создателя проекта **[FFmpeg](https://ffmpeg.org/about.html)**."
fileForConversionTitle = "Файл для конвертации:" fileForConversionTitle = "Файл:"
formPreset = "Предустановка"
help = "Справка" help = "Справка"
inProgressQueue = "Выполняется" inProgressQueue = "Выполняется"
languageSelectionFormHead = "Переключить язык" languageSelectionFormHead = "Переключить язык"
languageSelectionHead = "Выберите язык" languageSelectionHead = "Выберите язык"
licenseLink = "Сведения о лицензии" licenseLink = "Сведения о лицензии"
licenseLinkOther = "Лицензии от других продуктов, которые используются в программе" licenseLinkOther = "Лицензии от других продуктов, которые используются в программе"
parameterCheckbox = "Включить параметр"
pathToFfmpeg = "Путь к FFmpeg:" pathToFfmpeg = "Путь к FFmpeg:"
pathToFfprobe = "Путь к FFprobe:" pathToFfprobe = "Путь к FFprobe:"
preset_fast = "fast (медленней чем faster, но будет файл и меньше весить)"
preset_faster = "faster (медленней чем veryfast, но будет файл и меньше весить)"
preset_medium = "medium (медленней чем fast, но будет файл и меньше весить)"
preset_placebo = "placebo (не рекомендуется)"
preset_slow = "slow (медленней чем medium, но будет файл и меньше весить)"
preset_slower = "slower (медленней чем slow, но будет файл и меньше весить)"
preset_superfast = "superfast (медленней чем ultrafast, но будет файл и меньше весить)"
preset_ultrafast = "ultrafast (быстро, но файл будет много весить)"
preset_veryfast = "veryfast (медленней чем superfast, но будет файл и меньше весить)"
preset_veryslow = "veryslow (медленней чем slower, но будет файл и меньше весить)"
programmLink = "Сайт проекта" programmLink = "Сайт проекта"
programmVersion = "**Версия программы:** {{.Version}}" programmVersion = "**Версия программы:** {{.Version}}"
queue = "Очередь" queue = "Очередь"
save = "Сохранить" save = "Сохранить"
selectEncoder = "Выберите конвертер" selectEncoder = "Кодировщик:"
selectFFPathTitle = "Укажите путь к FFmpeg и к FFprobe" selectFFPathTitle = "Укажите путь к FFmpeg и к FFprobe"
selectFormat = "Выберите расширение файла" selectFormat = "Расширение файла:"
settings = "Настройки" settings = "Настройки"
testFF = "Проверка FFmpeg на работоспособность..." testFF = "Проверка FFmpeg на работоспособность..."
titleDownloadLink = "Скачать можно от сюда" titleDownloadLink = "Скачать можно от сюда"

View File

@ -1,139 +0,0 @@
[encoder_apng]
hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf"
other = "APNG image"
[encoder_bmp]
hash = "sha1-e0b9c16b016961a5abdc2217e8ffd1ba7ddebc40"
other = "BMP image"
[encoder_flv]
hash = "sha1-3602bbf1cc90e48254f81975c7879b5fc0c4d602"
other = "FLV"
[encoder_gif]
hash = "sha1-d092a779172291b5215aa095390a5b11659128a4"
other = "GIF image"
[encoder_h264_nvenc]
hash = "sha1-169389f8c4a2518410159c363378ab5c978c32e5"
other = "H.264 with NVIDIA support"
[encoder_libmp3lame]
hash = "sha1-cd2c8d6f246c8bc18554b7105cb50b78d3cb2b98"
other = "libmp3lame MP3 (MPEG audio layer 3)"
[encoder_libshine]
hash = "sha1-891d56c85857e5d83ef5a1fe077c1f1540788f49"
other = "libshine MP3 (MPEG audio layer 3)"
[encoder_libtwolame]
hash = "sha1-b2f53be810b74edc3c454ac75de7ddecfee322ca"
other = "libtwolame MP2 (MPEG audio layer 2)"
[encoder_libvpx]
hash = "sha1-b85c923aecfb48de0e87e71b6a21bfc2c547c70e"
other = "libvpx VP8 (codec vp8)"
[encoder_libvpx-vp9]
hash = "sha1-3106417bd89bee87daa691e87614caf78cb934fe"
other = "libvpx VP9 (codec vp9)"
[encoder_libwebp]
hash = "sha1-1d590d47d46f7880246061fce0e0de6d743db39e"
other = "libwebp WebP image"
[encoder_libwebp_anim]
hash = "sha1-f141a9c8f23d79c13d44c30d8f34e05b363771ad"
other = "libwebp_anim WebP image"
[encoder_libx264]
hash = "sha1-6d764ac459c0bf3c819d76618418cdfbb7a749eb"
other = "H.264 libx264"
[encoder_libx265]
hash = "sha1-55544c166b1e15fd71a58096518e528109599eea"
other = "H.265 libx265"
[encoder_libxvid]
hash = "sha1-d4bed46d6cdd2bfa8fd1689801164a83ab10c3f5"
other = "libxvidcore MPEG-4 part 2"
[encoder_mjpeg]
hash = "sha1-94ba63a322b493a04da65e566781fe1cf8bb0d50"
other = "MJPEG (Motion JPEG)"
[encoder_mp2]
hash = "sha1-a9154b7203349e5d6fbfd67d1ea97715f54b2065"
other = "MP2 (MPEG audio layer 2)"
[encoder_mp2fixed]
hash = "sha1-dd2ee670d8bc8a60a96a717ebd26f16b5748cf3f"
other = "MP2 fixed point (MPEG audio layer 2)"
[encoder_mpeg1video]
hash = "sha1-30043660719a3cb19dab5c33450665a8a9cc1c01"
other = "MPEG-1"
[encoder_mpeg2video]
hash = "sha1-ccb2dcd8510cfdc9d52e5258af1863e5f2c51e77"
other = "MPEG-2"
[encoder_mpeg4]
hash = "sha1-67fe42f18421b2f6c90fcdc579f9199bfca4b182"
other = "MPEG-4 part 2"
[encoder_msmpeg4]
hash = "sha1-313ee597e4f0d9bd63a2bc6ac1618f028aef76f4"
other = "MPEG-4 part 2 Microsoft variant version 3"
[encoder_msmpeg4v2]
hash = "sha1-adc442ce88f2717693b2da3010a1937d77ee522f"
other = "MPEG-4 part 2 Microsoft variant version 2"
[encoder_msvideo1]
hash = "sha1-00f43ac0dc162bca10e0d98d6b70c0c6a902f66f"
other = "Microsoft Video-1"
[encoder_png]
hash = "sha1-6715d4b82f5d9dfe3e53e30b402ffa1a6fbf30a5"
other = "PNG image"
[encoder_qtrle]
hash = "sha1-31bf155cffaf6842ebc54084e4337ca08fdd9848"
other = "QuickTime Animation (RLE) video"
[encoder_sgi]
hash = "sha1-f4510e237f7fc3c02caa728f9e500f4b069f9c11"
other = "SGI image"
[encoder_tiff]
hash = "sha1-ed09d78c38e0b17ed695f35740c756dd7340eeac"
other = "TIFF image"
[encoder_wmav1]
hash = "sha1-cd4a4c5eeac694b6699d55d0f9b477b3b50f18c7"
other = "Windows Media Audio 1"
[encoder_wmav2]
hash = "sha1-eb2e5306cb33a702577ecfbdca0461862c66c053"
other = "Windows Media Audio 2"
[encoder_wmv1]
hash = "sha1-f9b748554c590c36a56bcba2cd317196b7bdeddb"
other = "Windows Media Video 7"
[encoder_wmv2]
hash = "sha1-5b21c87f5c6104797ead60b488b2948428f6b1b7"
other = "Windows Media Video 8"
[encoder_xbm]
hash = "sha1-2dfc35881da62e9a1379d8238cf7839b24f79566"
other = "XBM (X BitMap) image"
[errorSelectedFormat]
hash = "sha1-cda92c56a1ef1aabc92bbfc405ede8ab13087e66"
other = "File extension not selected"
[selectFormat]
hash = "sha1-5e59b9376d321a49e73063eb7355b555d89bdd55"
other = "Select file extension"

View File

@ -1,139 +0,0 @@
[encoder_apng]
hash = "sha1-1cbd9abfef96d5614a7e569161b41bd6ad87bbaf"
other = "APNG image"
[encoder_bmp]
hash = "sha1-e0b9c16b016961a5abdc2217e8ffd1ba7ddebc40"
other = "BMP image"
[encoder_flv]
hash = "sha1-3602bbf1cc90e48254f81975c7879b5fc0c4d602"
other = "FLV"
[encoder_gif]
hash = "sha1-d092a779172291b5215aa095390a5b11659128a4"
other = "GIF image"
[encoder_h264_nvenc]
hash = "sha1-169389f8c4a2518410159c363378ab5c978c32e5"
other = "NVIDIA қолдауымен H.264"
[encoder_libmp3lame]
hash = "sha1-cd2c8d6f246c8bc18554b7105cb50b78d3cb2b98"
other = "libmp3lame MP3 (MPEG audio layer 3)"
[encoder_libshine]
hash = "sha1-891d56c85857e5d83ef5a1fe077c1f1540788f49"
other = "libshine MP3 (MPEG audio layer 3)"
[encoder_libtwolame]
hash = "sha1-b2f53be810b74edc3c454ac75de7ddecfee322ca"
other = "libtwolame MP2 (MPEG audio layer 2)"
[encoder_libvpx]
hash = "sha1-b85c923aecfb48de0e87e71b6a21bfc2c547c70e"
other = "libvpx VP8 (codec vp8)"
[encoder_libvpx-vp9]
hash = "sha1-3106417bd89bee87daa691e87614caf78cb934fe"
other = "libvpx VP9 (codec vp9)"
[encoder_libwebp]
hash = "sha1-1d590d47d46f7880246061fce0e0de6d743db39e"
other = "libwebp WebP image"
[encoder_libwebp_anim]
hash = "sha1-f141a9c8f23d79c13d44c30d8f34e05b363771ad"
other = "libwebp_anim WebP image"
[encoder_libx264]
hash = "sha1-6d764ac459c0bf3c819d76618418cdfbb7a749eb"
other = "H.264 libx264"
[encoder_libx265]
hash = "sha1-55544c166b1e15fd71a58096518e528109599eea"
other = "H.265 libx265"
[encoder_libxvid]
hash = "sha1-d4bed46d6cdd2bfa8fd1689801164a83ab10c3f5"
other = "libxvidcore MPEG-4 part 2"
[encoder_mjpeg]
hash = "sha1-94ba63a322b493a04da65e566781fe1cf8bb0d50"
other = "MJPEG (Motion JPEG)"
[encoder_mp2]
hash = "sha1-a9154b7203349e5d6fbfd67d1ea97715f54b2065"
other = "MP2 (MPEG audio layer 2)"
[encoder_mp2fixed]
hash = "sha1-dd2ee670d8bc8a60a96a717ebd26f16b5748cf3f"
other = "MP2 fixed point (MPEG audio layer 2)"
[encoder_mpeg1video]
hash = "sha1-30043660719a3cb19dab5c33450665a8a9cc1c01"
other = "MPEG-1"
[encoder_mpeg2video]
hash = "sha1-ccb2dcd8510cfdc9d52e5258af1863e5f2c51e77"
other = "MPEG-2"
[encoder_mpeg4]
hash = "sha1-67fe42f18421b2f6c90fcdc579f9199bfca4b182"
other = "MPEG-4 part 2"
[encoder_msmpeg4]
hash = "sha1-313ee597e4f0d9bd63a2bc6ac1618f028aef76f4"
other = "MPEG-4 part 2 Microsoft variant version 3"
[encoder_msmpeg4v2]
hash = "sha1-adc442ce88f2717693b2da3010a1937d77ee522f"
other = "MPEG-4 part 2 Microsoft variant version 2"
[encoder_msvideo1]
hash = "sha1-00f43ac0dc162bca10e0d98d6b70c0c6a902f66f"
other = "Microsoft Video-1"
[encoder_png]
hash = "sha1-6715d4b82f5d9dfe3e53e30b402ffa1a6fbf30a5"
other = "PNG image"
[encoder_qtrle]
hash = "sha1-31bf155cffaf6842ebc54084e4337ca08fdd9848"
other = "QuickTime Animation (RLE) video"
[encoder_sgi]
hash = "sha1-f4510e237f7fc3c02caa728f9e500f4b069f9c11"
other = "SGI image"
[encoder_tiff]
hash = "sha1-ed09d78c38e0b17ed695f35740c756dd7340eeac"
other = "TIFF image"
[encoder_wmav1]
hash = "sha1-cd4a4c5eeac694b6699d55d0f9b477b3b50f18c7"
other = "Windows Media Audio 1"
[encoder_wmav2]
hash = "sha1-eb2e5306cb33a702577ecfbdca0461862c66c053"
other = "Windows Media Audio 2"
[encoder_wmv1]
hash = "sha1-f9b748554c590c36a56bcba2cd317196b7bdeddb"
other = "Windows Media Video 7"
[encoder_wmv2]
hash = "sha1-5b21c87f5c6104797ead60b488b2948428f6b1b7"
other = "Windows Media Video 8"
[encoder_xbm]
hash = "sha1-2dfc35881da62e9a1379d8238cf7839b24f79566"
other = "XBM (X BitMap) image"
[errorSelectedFormat]
hash = "sha1-cda92c56a1ef1aabc92bbfc405ede8ab13087e66"
other = "Файл кеңейтімі таңдалмаған"
[selectFormat]
hash = "sha1-5e59b9376d321a49e73063eb7355b555d89bdd55"
other = "Файл кеңейтімін таңдаңыз"

View File

@ -26,7 +26,7 @@ func init() {
appMetadata := &fyne.AppMetadata{ appMetadata := &fyne.AppMetadata{
ID: "net.kor-elf.projects.gui-for-ffmpeg", ID: "net.kor-elf.projects.gui-for-ffmpeg",
Name: "GUI for FFmpeg", Name: "GUI for FFmpeg",
Version: "0.5.0", Version: "0.6.0",
Icon: iconResource, Icon: iconResource,
} }