ui

package
v0.0.0-...-e6569ce Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2026 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ui provides the Bubbletea terminal user interface for jivetalking

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllCompleteMsg

type AllCompleteMsg struct{}

AllCompleteMsg indicates all files have been processed

type AnalysisCompleteMsg

type AnalysisCompleteMsg struct {
	Measurements *processor.AudioMeasurements
	Config       *processor.FilterChainConfig
	Error        error
}

AnalysisCompleteMsg signals analysis has completed

type AnalysisModel

type AnalysisModel struct {
	// File being analysed
	FileName string
	FilePath string

	// Progress tracking
	Progress  float64 // 0.0 to 1.0
	Level     float64 // Current audio level in dB
	StartTime time.Time

	// Results (populated when complete)
	Measurements *processor.AudioMeasurements
	Config       *processor.FilterChainConfig
	Error        error
	Done         bool

	// Terminal dimensions
	Width  int
	Height int
	// contains filtered or unexported fields
}

AnalysisModel is the Bubbletea model for analysis-only mode

func NewAnalysisModel

func NewAnalysisModel() AnalysisModel

NewAnalysisModel creates a new analysis UI model

func (AnalysisModel) Init

func (m AnalysisModel) Init() tea.Cmd

Init initializes the model

func (AnalysisModel) Update

func (m AnalysisModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (AnalysisModel) View

func (m AnalysisModel) View() string

View renders the UI

type AnalysisProgressMsg

type AnalysisProgressMsg struct {
	Progress float64
	Level    float64
}

AnalysisProgressMsg signals progress update

type AnalysisStartMsg

type AnalysisStartMsg struct {
	FileName string
	FilePath string
}

AnalysisStartMsg signals analysis has started

type FileCompleteMsg

type FileCompleteMsg struct {
	FileIndex  int
	InputLUFS  float64
	OutputLUFS float64
	NoiseFloor float64
	OutputPath string
	Error      error
}

FileCompleteMsg indicates a file has finished processing

type FileProgress

type FileProgress struct {
	InputPath  string
	OutputPath string
	Status     FileStatus

	// Phase tracking
	CurrentPass processor.PassNumber
	PassName    string

	// Progress tracking (percentage-based)
	Progress    float64 // 0.0 to 1.0
	StartTime   time.Time
	ElapsedTime time.Duration

	// Analysis results (from Pass 1)
	Measurements *processor.AudioMeasurements

	// Processing statistics
	CurrentLevel float64 // Current audio level in dB
	PeakLevel    float64 // Peak level seen so far

	// Completion results
	InputLUFS  float64
	OutputLUFS float64
	NoiseFloor float64

	// Error tracking
	Error error
}

FileProgress tracks progress for a single audio file

type FileStartMsg

type FileStartMsg struct {
	FileIndex int
	FileName  string
}

FileStartMsg indicates a new file has started processing

type FileStatus

type FileStatus int

FileStatus represents the processing state of a single file

const (
	StatusQueued FileStatus = iota
	StatusAnalyzing
	StatusProcessing
	StatusNormalising
	StatusComplete
	StatusError
)

type Model

type Model struct {
	// File queue
	Files          []FileProgress
	CurrentIndex   int
	TotalFiles     int
	CompletedFiles int
	FailedFiles    int

	// Global state
	StartTime time.Time
	Done      bool

	// Terminal dimensions
	Width  int
	Height int
}

Model is the Bubbletea model for the processing UI

func NewModel

func NewModel(inputFiles []string) Model

NewModel creates a new UI model with the given input files

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the model

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles messages and updates the model

func (Model) View

func (m Model) View() string

View renders the UI

type ProgressMsg

type ProgressMsg struct {
	Pass         processor.PassNumber
	PassName     string
	Progress     float64
	Level        float64
	Measurements *processor.AudioMeasurements
}

ProgressMsg represents a progress update from the processor

Jump to

Keyboard shortcuts

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