init commit

This commit is contained in:
2026-01-25 17:13:15 -06:00
commit 1bbfc332d8
27 changed files with 2462 additions and 0 deletions

39
internal/srt/types.go Normal file
View File

@@ -0,0 +1,39 @@
package srt
import "time"
// Cue represents a single subtitle entry
type Cue struct {
Index int
Start time.Duration
End time.Duration
Text string
LineNumber int // Line number in the SRT file (1-indexed)
}
// Transcript represents a complete subtitle file
type Transcript struct {
Cues []Cue
FilePath string
IsTemp bool
}
// CueAt returns the cue that contains the given time position
func (t *Transcript) CueAt(pos time.Duration) *Cue {
for i := range t.Cues {
if pos >= t.Cues[i].Start && pos < t.Cues[i].End {
return &t.Cues[i]
}
}
return nil
}
// CueIndexAt returns the index of the cue at the given position, or -1
func (t *Transcript) CueIndexAt(pos time.Duration) int {
for i := range t.Cues {
if pos >= t.Cues[i].Start && pos < t.Cues[i].End {
return i
}
}
return -1
}