Documentation ¶
Index ¶
- Constants
- type Application
- func (a *Application) AddTask(task Task) (err error)
- func (a *Application) CheckTask()
- func (a *Application) Destroy()
- func (a *Application) GetRunningMsg() string
- func (a *Application) LoadSrtGenerator() (err error)
- func (a *Application) LoadTranslateTools() (err error)
- func (a *Application) Merge() error
- func (a *Application) Run()
- type CleanTask
- type ConvertTask
- type GenerateStep
- type GenerateTask
- type SrtGenerator
- type Task
- type TaskState
- type TaskType
- type TranslateTask
- type Translator
Constants ¶
View Source
const ( TaskTypeUnknown = iota TaskTypeTranslate TaskTypeGenerate TaskTypeConvert TaskTypeMerge TaskTypeClean )
View Source
const ( TaskStateUnknown = iota TaskStateInit TaskStateDoing TaskStateTrying TaskStateDone TaskStateFailed )
View Source
const ( GenerateStepUnknown = iota GenerateStepAudio GenerateStepOss GenerateStepRecognize GenerateStepGenerateSrt )
View Source
const (
MaxRetryTimes = 99
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication() *Application
func (*Application) AddTask ¶
func (a *Application) AddTask(task Task) (err error)
func (*Application) CheckTask ¶
func (a *Application) CheckTask()
func (*Application) Destroy ¶
func (a *Application) Destroy()
func (*Application) GetRunningMsg ¶
func (a *Application) GetRunningMsg() string
func (*Application) LoadSrtGenerator ¶ added in v1.0.0
func (a *Application) LoadSrtGenerator() (err error)
func (*Application) LoadTranslateTools ¶
func (a *Application) LoadTranslateTools() (err error)
func (*Application) Merge ¶
func (a *Application) Merge() error
func (*Application) Run ¶
func (a *Application) Run()
type CleanTask ¶ added in v1.1.0
type CleanTask struct { SrcFile string DstFile string State TaskState Err error Progress float32 FailedTimes int }
func NewCleanTask ¶ added in v1.1.0
func (*CleanTask) GetFailedTimes ¶ added in v1.1.0
type ConvertTask ¶
type ConvertTask struct { SrcFile string DstFile string State TaskState From string To string FailedTimes int Err error }
字幕格式转换任务
func NewConvertTask ¶
func NewConvertTask(srcFile, from, to string) *ConvertTask
func (*ConvertTask) Failed ¶
func (g *ConvertTask) Failed(err error)
func (*ConvertTask) GetFailedTimes ¶
func (g *ConvertTask) GetFailedTimes() int
func (*ConvertTask) GetState ¶
func (c *ConvertTask) GetState() TaskState
func (*ConvertTask) Init ¶
func (c *ConvertTask) Init() (err error)
func (*ConvertTask) String ¶
func (c *ConvertTask) String() string
func (*ConvertTask) Type ¶
func (c *ConvertTask) Type() TaskType
type GenerateStep ¶
type GenerateStep int
func (GenerateStep) String ¶
func (g GenerateStep) String() string
type GenerateTask ¶
type GenerateTask struct { SrcFile string DstFile string State TaskState Step GenerateStep ChannelId int FailedTimes int Err error }
func NewGenerateTask ¶
func NewGenerateTask(src string) *GenerateTask
func (*GenerateTask) Failed ¶
func (g *GenerateTask) Failed(err error)
func (*GenerateTask) GetFailedTimes ¶
func (g *GenerateTask) GetFailedTimes() int
func (*GenerateTask) GetState ¶
func (g *GenerateTask) GetState() TaskState
func (*GenerateTask) String ¶
func (g *GenerateTask) String() string
func (*GenerateTask) Type ¶
func (g *GenerateTask) Type() TaskType
type SrtGenerator ¶ added in v1.0.0
func NewSrtGenerator ¶ added in v1.0.0
func (*SrtGenerator) Do ¶ added in v1.0.0
func (s *SrtGenerator) Do(ctx context.Context, task *GenerateTask, doneCallBack func(generator *SrtGenerator))
func (*SrtGenerator) Done ¶ added in v1.0.0
func (s *SrtGenerator) Done()
func (*SrtGenerator) Start ¶ added in v1.0.0
func (s *SrtGenerator) Start()
type TranslateTask ¶
type TranslateTask struct { SrcFile string DstFile string From string To string Progress float32 Merge bool // 双语字幕 State TaskState FailedTimes int Err error // contains filtered or unexported fields }
字幕翻译任务
func NewTranslateTask ¶
func NewTranslateTask(srcFile, from, to string, merge bool) *TranslateTask
func (*TranslateTask) Failed ¶
func (g *TranslateTask) Failed(err error)
func (*TranslateTask) GetFailedTimes ¶
func (g *TranslateTask) GetFailedTimes() int
func (*TranslateTask) GetState ¶
func (t *TranslateTask) GetState() TaskState
func (*TranslateTask) Init ¶
func (t *TranslateTask) Init() (err error)
func (*TranslateTask) String ¶
func (t *TranslateTask) String() string
func (*TranslateTask) Type ¶
func (t *TranslateTask) Type() TaskType
type Translator ¶
func NewTranslator ¶
func (*Translator) Do ¶
func (t *Translator) Do(ctx context.Context, task *TranslateTask, doneCallBack func(*Translator))
func (*Translator) Done ¶
func (t *Translator) Done()
func (*Translator) Start ¶
func (t *Translator) Start()
Click to show internal directories.
Click to hide internal directories.