kernel

package
v0.0.0-...-40848a7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Waiting = iota
	InProgress
	Completed
	Error
)

Variables

This section is empty.

Functions

func PanicErrorLang

func PanicErrorLang(err error, metadata *fyne.AppMetadata)

Types

type App

type App struct {
	AppFyne fyne.App
	Window  WindowContract
	Queue   QueueListContract
	// contains filtered or unexported fields
}

func NewApp

func NewApp(
	metadata *fyne.AppMetadata,
	localizerService LocalizerContract,
	queue QueueListContract,
	queueLayoutObject QueueLayoutObjectContract,
	convertorService ConvertorContract,
) *App

func (App) AfterClosing

func (a App) AfterClosing()

func (App) GetAppFyne

func (a App) GetAppFyne() fyne.App

func (App) GetConvertorService

func (a App) GetConvertorService() ConvertorContract

func (App) GetLocalizerService

func (a App) GetLocalizerService() LocalizerContract

func (App) GetQueue

func (a App) GetQueue() QueueListContract

func (App) GetWindow

func (a App) GetWindow() WindowContract

func (App) RunConvertor

func (a App) RunConvertor()

type AppContract

type AppContract interface {
	GetAppFyne() fyne.App
	GetWindow() WindowContract
	GetQueue() QueueListContract
	GetLocalizerService() LocalizerContract
	GetConvertorService() ConvertorContract
	AfterClosing()
	RunConvertor()
}

type ConvertData

type ConvertData struct {
	// contains filtered or unexported fields
}

type ConvertSetting

type ConvertSetting struct {
	VideoFileInput       File
	VideoFileOut         File
	OverwriteOutputFiles bool
	Encoder              encoder2.EncoderContract
}

type Convertor

type Convertor struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(ffPathUtilities *FFPathUtilities) *Convertor

func (Convertor) ChangeFFmpegPath

func (s Convertor) ChangeFFmpegPath(path string) (bool, error)

func (Convertor) ChangeFFprobePath

func (s Convertor) ChangeFFprobePath(path string) (bool, error)

func (Convertor) GetFFmpegVesrion

func (s Convertor) GetFFmpegVesrion() (string, error)

func (Convertor) GetFFprobeVersion

func (s Convertor) GetFFprobeVersion() (string, error)

func (Convertor) GetRunningProcesses

func (s Convertor) GetRunningProcesses() map[int]*exec.Cmd

func (Convertor) GetSupportFormats

func (s Convertor) GetSupportFormats() (encoder.ConvertorFormatsContract, error)

func (Convertor) GetTotalDuration

func (s Convertor) GetTotalDuration(file *File) (duration float64, err error)

func (Convertor) RunConvert

func (s Convertor) RunConvert(setting ConvertSetting, progress ProgressContract) error

type ConvertorContract

type ConvertorContract interface {
	RunConvert(setting ConvertSetting, progress ProgressContract) error
	GetTotalDuration(file *File) (float64, error)
	GetFFmpegVesrion() (string, error)
	GetFFprobeVersion() (string, error)
	ChangeFFmpegPath(path string) (bool, error)
	ChangeFFprobePath(path string) (bool, error)
	GetRunningProcesses() map[int]*exec.Cmd
	GetSupportFormats() (encoder.ConvertorFormatsContract, error)
}

type CurrentLanguage

type CurrentLanguage struct {
	Lang Lang
	// contains filtered or unexported fields
}

type FFPathUtilities

type FFPathUtilities struct {
	FFmpeg  string
	FFprobe string
}

type File

type File struct {
	Path string
	Name string
	Ext  string
}

type Lang

type Lang struct {
	Code  string
	Title string
}

type Layout

type Layout struct {
	// contains filtered or unexported fields
}

func NewLayout

func NewLayout(queueLayoutObject QueueLayoutObjectContract, localizerService LocalizerContract) *Layout

func (Layout) ChangeQueueStatus

func (l Layout) ChangeQueueStatus(queueId int, queue *Queue)

func (Layout) NewProgressbar

func (l Layout) NewProgressbar(queueId int, totalDuration float64) ProgressContract

func (Layout) SetContent

func (l Layout) SetContent(content fyne.CanvasObject) *fyne.Container

type LayoutContract

type LayoutContract interface {
	SetContent(content fyne.CanvasObject) *fyne.Container
	NewProgressbar(queueId int, totalDuration float64) ProgressContract
	ChangeQueueStatus(queueId int, queue *Queue)
}

type Localizer

type Localizer struct {
	// contains filtered or unexported fields
}

func NewLocalizer

func NewLocalizer(directory string, languageDefault language.Tag) (*Localizer, error)

func (Localizer) AddChangeCallback

func (l Localizer) AddChangeCallback(messageID string, callback func(text string))

func (Localizer) GetCurrentLanguage

func (l Localizer) GetCurrentLanguage() *CurrentLanguage

func (Localizer) GetLanguages

func (l Localizer) GetLanguages() []Lang

func (Localizer) GetMessage

func (l Localizer) GetMessage(localizeConfig *i18n.LocalizeConfig) string

func (Localizer) SetCurrentLanguage

func (l Localizer) SetCurrentLanguage(lang Lang) error

func (Localizer) SetCurrentLanguageByCode

func (l Localizer) SetCurrentLanguageByCode(code string) error

type LocalizerContract

type LocalizerContract interface {
	GetLanguages() []Lang
	GetMessage(localizeConfig *i18n.LocalizeConfig) string
	SetCurrentLanguage(lang Lang) error
	SetCurrentLanguageByCode(code string) error
	GetCurrentLanguage() *CurrentLanguage
	AddChangeCallback(messageID string, callback func(text string))
}

type Progress

type Progress struct {
	// contains filtered or unexported fields
}

func NewProgress

func NewProgress(totalDuration float64, progressbar *widget.ProgressBar, localizerService LocalizerContract) Progress

func (Progress) GetProtocole

func (p Progress) GetProtocole() string

func (Progress) Run

func (p Progress) Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error

type ProgressContract

type ProgressContract interface {
	GetProtocole() string
	Run(stdOut io.ReadCloser, stdErr io.ReadCloser) error
}

type Queue

type Queue struct {
	Setting *ConvertSetting
	Status  StatusContract
	Error   error
}

type QueueLayoutItem

type QueueLayoutItem struct {
	CanvasObject  fyne.CanvasObject
	ProgressBar   *widget.ProgressBar
	StatusMessage *canvas.Text
	MessageError  *canvas.Text
	// contains filtered or unexported fields
}

type QueueLayoutObject

type QueueLayoutObject struct {
	QueueListContract QueueListContract
	// contains filtered or unexported fields
}

func NewQueueLayoutObject

func NewQueueLayoutObject(queue QueueListContract, localizerService LocalizerContract) *QueueLayoutObject

func (QueueLayoutObject) Add

func (o QueueLayoutObject) Add(id int, queue *Queue)

func (QueueLayoutObject) ChangeQueueStatus

func (o QueueLayoutObject) ChangeQueueStatus(queueId int, queue *Queue)

func (QueueLayoutObject) GetCanvasObject

func (o QueueLayoutObject) GetCanvasObject() fyne.CanvasObject

func (QueueLayoutObject) GetProgressbar

func (o QueueLayoutObject) GetProgressbar(queueId int) *widget.ProgressBar

func (QueueLayoutObject) Remove

func (o QueueLayoutObject) Remove(id int)

type QueueLayoutObjectContract

type QueueLayoutObjectContract interface {
	GetCanvasObject() fyne.CanvasObject
	GetProgressbar(queueId int) *widget.ProgressBar
	ChangeQueueStatus(queueId int, queue *Queue)
}

type QueueList

type QueueList struct {
	// contains filtered or unexported fields
}

func NewQueueList

func NewQueueList() *QueueList

func (QueueList) Add

func (l QueueList) Add(setting *ConvertSetting)

func (QueueList) AddListener

func (l QueueList) AddListener(queueListener QueueListenerContract)

func (QueueList) GetItem

func (l QueueList) GetItem(key int) (*Queue, error)

func (QueueList) GetItems

func (l QueueList) GetItems() map[int]*Queue

func (QueueList) Next

func (l QueueList) Next() (key int, queue *Queue)

func (QueueList) Remove

func (l QueueList) Remove(key int)

type QueueListContract

type QueueListContract interface {
	AddListener(queueListener QueueListenerContract)
	GetItems() map[int]*Queue
	Add(setting *ConvertSetting)
	Remove(key int)
	GetItem(key int) (*Queue, error)
	Next() (key int, queue *Queue)
}

type QueueListenerContract

type QueueListenerContract interface {
	Add(key int, queue *Queue)
	Remove(key int)
}

type StatusContract

type StatusContract interface {
	Name() string
	Ordinal() int
}

type StatusType

type StatusType uint

func (StatusType) Name

func (status StatusType) Name() string

func (StatusType) Ordinal

func (status StatusType) Ordinal() int

type Window

type Window struct {
	// contains filtered or unexported fields
}

func (Window) GetLayout

func (w Window) GetLayout() LayoutContract

func (Window) NewFileOpen

func (w Window) NewFileOpen(callback func(fyne.URIReadCloser, error), location fyne.ListableURI) *dialog.FileDialog

func (Window) NewFolderOpen

func (w Window) NewFolderOpen(callback func(fyne.ListableURI, error), location fyne.ListableURI) *dialog.FileDialog

func (Window) SetContent

func (w Window) SetContent(content fyne.CanvasObject)

func (Window) SetMainMenu

func (w Window) SetMainMenu(menu *fyne.MainMenu)

func (Window) ShowAndRun

func (w Window) ShowAndRun()

type WindowContract

type WindowContract interface {
	SetContent(content fyne.CanvasObject)
	SetMainMenu(menu *fyne.MainMenu)
	NewFileOpen(callback func(fyne.URIReadCloser, error), location fyne.ListableURI) *dialog.FileDialog
	NewFolderOpen(callback func(fyne.ListableURI, error), location fyne.ListableURI) *dialog.FileDialog
	ShowAndRun()
	GetLayout() LayoutContract
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL