gui-for-ffmpeg/handler/main.go
Leonid Nikitin a1c9143685
Added queues.
Reworked the architecture.
2024-02-17 19:08:58 +06:00

39 lines
958 B
Go

package handler
import (
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/localizer"
)
type MainHandler struct {
app kernel.AppContract
convertorHandler ConvertorHandlerContract
menuHandler MenuHandlerContract
localizerRepository localizer.RepositoryContract
}
func NewMainHandler(
app kernel.AppContract,
convertorHandler ConvertorHandlerContract,
menuHandler MenuHandlerContract,
localizerRepository localizer.RepositoryContract,
) *MainHandler {
return &MainHandler{
app: app,
convertorHandler: convertorHandler,
menuHandler: menuHandler,
localizerRepository: localizerRepository,
}
}
func (h MainHandler) Start() {
language, err := h.localizerRepository.GetCode()
if err != nil {
h.menuHandler.LanguageSelection()
return
}
_ = h.app.GetLocalizerService().SetCurrentLanguageByCode(language)
h.convertorHandler.MainConvertor()
}