Documentation
¶
Index ¶
- Variables
- func Maximums[S []E, E any, V constraints.Ordered](s S, f func(E) (V, error)) S
- func ParseDuration(s string) (time.Duration, error)
- func ParseLines(r io.Reader) iter.Seq2[Line, error]
- type CurrentProgressLine
- type Disc
- type DiscInfoLine
- type DriveScanLine
- type Info
- type InfoLine
- type Line
- type LineIterator
- type LineKind
- type MakeMKVCon
- func (c *MakeMKVCon) BackupTitle(ctx context.Context, driveIndex, titleIndex int, dstDir string) (iter.Seq2[Line, error], error)
- func (c *MakeMKVCon) ListDrives(ctx context.Context) (*LineIterator[[]*DriveScanLine], error)
- func (c *MakeMKVCon) ScanDrive(ctx context.Context, driveIndex int) (*LineIterator[*Disc], error)
- type MakeMKVConConfig
- type MessageLine
- type ProgressBarLine
- type Stream
- type StreamInfoLine
- type Title
- type TitleCountLine
- type TitleInfoLine
- type TotalProgressLine
Constants ¶
This section is empty.
Variables ¶
var ( ErrUnhandledLine = fmt.Errorf("unhandled line") ErrNotFound = fmt.Errorf("not found") )
Functions ¶
Types ¶
type CurrentProgressLine ¶
type CurrentProgressLine struct {
// contains filtered or unexported fields
}
func ParseCurrentProgressLine ¶
func ParseCurrentProgressLine(s string) (*CurrentProgressLine, error)
func (*CurrentProgressLine) Kind ¶
func (l *CurrentProgressLine) Kind() LineKind
type Disc ¶
func (*Disc) TitleCount ¶
func (*Disc) TitlesWithAngle ¶
func (*Disc) TitlesWithLongestDuration ¶
func (*Disc) TitlesWithMostChapters ¶
func (*Disc) TitlesWithMostStreams ¶
type DiscInfoLine ¶
type DiscInfoLine struct {
*InfoLine
}
func ParseDiscInfoLine ¶
func ParseDiscInfoLine(s string) (*DiscInfoLine, error)
func (*DiscInfoLine) Kind ¶
func (l *DiscInfoLine) Kind() LineKind
type DriveScanLine ¶
type DriveScanLine struct {
Index int `json:"index"`
Field1 int `json:"visible"`
Field2 int `json:"enabled"`
Field3 int `json:"flags"`
DriveName string `json:"drive_name"`
DiscTitle string `json:"disc_title"`
VolumeName string `json:"volume_name"`
}
From https://makemkv.com/developers/usage.txt:
DRV:index,visible,enabled,flags,drive name,disc name index - drive index visible - set to 1 if drive is present enabled - set to 1 if drive is accessible flags - media flags, see AP_DskFsFlagXXX in apdefs.h drive name - drive name string disc name - disc name string
Errata:
- Field 1 (visible?) is not boolean (e.g., 0, 1, 2)
- Field 2 (enabled?) is not boolean (e.g., 999)
- Undocumented title field between drive and disc name
func ParseDriveScanLine ¶
func ParseDriveScanLine(s string) (*DriveScanLine, error)
func (*DriveScanLine) Kind ¶
func (l *DriveScanLine) Kind() LineKind
type InfoLine ¶
type InfoLine struct {
ID defs.Attr `json:"id"`
Code int `json:"code"`
Value string `json:"value"`
// contains filtered or unexported fields
}
From https://makemkv.com/developers/usage.txt:
CINFO:id,code,value TINFO:id,code,value SINFO:id,code,value id - attribute id, see AP_ItemAttributeId in apdefs.h code - message code if attribute value is a constant string value - attribute value
type LineIterator ¶
type LineIterator[T any] struct { Seq iter.Seq2[Line, error] // contains filtered or unexported fields }
func (*LineIterator[T]) GetResult ¶
func (li *LineIterator[T]) GetResult() (T, error)
type MakeMKVCon ¶
type MakeMKVCon struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *MakeMKVConConfig) (*MakeMKVCon, error)
func (*MakeMKVCon) BackupTitle ¶
func (*MakeMKVCon) ListDrives ¶
func (c *MakeMKVCon) ListDrives(ctx context.Context) (*LineIterator[[]*DriveScanLine], error)
func (*MakeMKVCon) ScanDrive ¶
func (c *MakeMKVCon) ScanDrive(ctx context.Context, driveIndex int) (*LineIterator[*Disc], error)
type MakeMKVConConfig ¶
type MakeMKVConConfig struct {
ExePath string `` // path to makemkvcon executable
ProfilePath string `` // path to makemkv profile XML
ReadCacheSizeMB int64 `validate:"min=1"` // --cache argument
MinLengthSeconds int64 `validate:"min=1"` // --minlength argument
}
func (*MakeMKVConConfig) Validate ¶
func (cfg *MakeMKVConConfig) Validate() error
type MessageLine ¶
type MessageLine struct {
Code int `json:"code"`
Flags int `json:"flags"`
NumParams int `json:"num_params"`
Message string `json:"message"`
Format string `json:"format"`
Params []string `json:"params"`
}
From https://makemkv.com/developers/usage.txt:
MSG:code,flags,count,message,format,param0,param1,... code - unique message code, should be used to identify particular string in language-neutral way. flags - message flags, see AP_UIMSG_xxx flags in apdefs.h count - number of parameters message - raw message string suitable for output format - format string used for message. This string is localized and subject to change, unlike message code. paramX - parameter for message
func ParseMessageLine ¶
func ParseMessageLine(s string) (*MessageLine, error)
func (*MessageLine) Kind ¶
func (l *MessageLine) Kind() LineKind
type ProgressBarLine ¶
type ProgressBarLine struct {
Current int `json:"current"`
Total int `json:"total"`
Max int `json:"max"`
}
From https://makemkv.com/developers/usage.txt:
Progress bar values for current and total progress PRGV:current,total,max current - current progress value total - total progress value max - maximum possible value for a progress bar, constant
func ParseProgressBarLine ¶
func ParseProgressBarLine(s string) (*ProgressBarLine, error)
func (*ProgressBarLine) CurrentProgress ¶
func (l *ProgressBarLine) CurrentProgress() float64
func (*ProgressBarLine) Kind ¶
func (l *ProgressBarLine) Kind() LineKind
func (*ProgressBarLine) TotalProgress ¶
func (l *ProgressBarLine) TotalProgress() float64
type StreamInfoLine ¶
type StreamInfoLine struct {
TitleIndex int `json:"title_index"`
StreamIndex int `json:"stream_index"`
*InfoLine
}
func ParseStreamInfoLine ¶
func ParseStreamInfoLine(s string) (*StreamInfoLine, error)
func (*StreamInfoLine) Kind ¶
func (l *StreamInfoLine) Kind() LineKind
type TitleCountLine ¶
type TitleCountLine struct {
Count int `json:"count"`
}
From https://makemkv.com/developers/usage.txt:
TCOUT:count count - titles count
func ParseTitleCountLine ¶
func ParseTitleCountLine(s string) (*TitleCountLine, error)
func (*TitleCountLine) Kind ¶
func (l *TitleCountLine) Kind() LineKind
type TitleInfoLine ¶
func ParseTitleInfoLine ¶
func ParseTitleInfoLine(s string) (*TitleInfoLine, error)
func (*TitleInfoLine) Kind ¶
func (l *TitleInfoLine) Kind() LineKind
type TotalProgressLine ¶
type TotalProgressLine struct {
// contains filtered or unexported fields
}
func ParseTotalProgressLine ¶
func ParseTotalProgressLine(s string) (*TotalProgressLine, error)
func (*TotalProgressLine) Kind ¶
func (l *TotalProgressLine) Kind() LineKind