Package-level declarations

Types

Link copied to clipboard
data class BraccatoAnimations(val lineScale: Boolean = true, val wordWobble: Boolean = true, val highlightSwipe: Boolean = true, val highlightGlow: Boolean = true, val highlightFade: Boolean = true, val scroll: Boolean = true, val instrumental: Boolean = true, val decorationEntry: Boolean = true)

Which effects run. --blyrics-animate-* upstream, each 1 or 0.

Link copied to clipboard

What the view reports back, and the one thing a host can ask of it.

Link copied to clipboard
data class BraccatoTheme(val textColor: Color = Color.White, val activeOpacity: Float = 1.0f, val inactiveOpacity: Float = 0.3f, val glowColor: Color = Color.White.copy(alpha = 0.5f), val translatedColor: Color = Color.White.copy(alpha = 0.6f), val lyricActiveColor: Color? = null, val lyricInactiveColor: Color? = null, val fontFamily: FontFamily? = null, val fontSize: Dp = 48.dp, val fontWeight: FontWeight = FontWeight.Bold, val lineHeight: Float = 1.333f, val rtlFontFamily: FontFamily? = FontFamily.Default, val translatedFontFamily: FontFamily? = null, val translatedFontSize: Dp = 32.dp, val translatedFontWeight: FontWeight = FontWeight.SemiBold, val romanizedFontSize: Dp? = null, val creditsLabel: String = "Written by", val creditsOpacity: Float = 0.2f, val creditsFocusedOpacity: Float = 0.85f, val linePadding: Dp = 32.dp, val scale: Float = 0.95f, val activeScale: Float = 1.0f, val animations: BraccatoAnimations = BraccatoAnimations(), val scaleTransitionMs: Double = 166.0, val lineEnterEasing: Easing = CssEasing.Ease, val lineExitEasing: Easing = CssEasing.Ease, val highlightFadeInMs: Double = 330.0, val highlightFadeOutMs: Double = 500.0, val highlightFadeInEasing: Easing = CssEasing.Ease, val highlightFadeOutEasing: Easing = CssEasing.Ease, val swipeEasing: Easing = LinearEasing, val swipeEasingName: String = "linear", val swipeStartFrom: Double = -0.2, val swipeEndFrom: Double = -0.1, val swipeStartTo: Double = 1.4, val swipeEndTo: Double = 1.5, val glowRadiusFrom: Dp = 12.8.dp, val glowRadiusTo: Dp = 0.dp, val glowDurationRatio: Double = 1.2, val glowMinDurationMs: Double = 1200.0, val glowEasing: Easing = CssEasing.Ease, val wobbleDurationMs: Double = 1000.0, val wobblePeakTranslateEm: Float = 0.05f, val wobblePeakScaleX: Float = 1.025f, val wobblePeakOffset: Float = 0.125f, val wobbleSettleOffset: Float = 0.75f, val wobbleEasing: Easing = CssEasing.Ease, val wobblePeakEasing: Easing = CssEasing.EaseInOut, val wobbleEndEasing: Easing = CssEasing.EaseOut, val letterWaveRiseEm: Float = -0.05f, val letterWaveSettleEm: Float = -0.02f, val letterWaveEmphasisScale: Float = 1.11f, val letterWaveDurationMs: Double = 900.0, val letterWaveRiseEasing: Easing = CssEasing.EaseInOut, val letterWaveFallEasing: Easing = CssEasing.EaseOut, val instrumentalFillFadeMs: Double = 150.0, val instrumentalFillFrom: Float = 0.78f, val instrumentalFillTo: Float = -0.04f, val instrumentalWaveFrom: Float = 1.2f, val instrumentalWaveTo: Float = 0.0f, val instrumentalWaveEasing: Easing = CssEasing.EaseIn, val instrumentalWaveOscillationMs: Double = 1250.0, val instrumentalWaveOscillationEasing: Easing = CssEasing.EaseInOut, val lyricScrollEasing: Easing = CubicBezierEasing(0.86f, 0f, 0.2f, 1f), val decorationEntryMs: Double = 350.0, val decorationEntryEasing: Easing = CubicBezierEasing(0.25f, 1f, 0.5f, 1f), val timingOffsets: TimingOffsets = TimingOffsets())

How the lyrics look and move. The defaults are upstream's stylesheet; most values stand for one of its --blyrics-* custom properties, and fromCss applies a Better Lyrics theme on top. Times are in milliseconds, sizes in em are shares of fontSize.

Link copied to clipboard
data class LineDecorations(val translation: BuiltTranslation? = null, val romanization: BuiltRomanization? = null)

What hangs under a line. injectTranslation and injectRomanization upstream. Equal when it shows the same.

Link copied to clipboard
data class PlaybackSnapshot(val timeS: Double, val isPlaying: Boolean, val playbackRate: Double = 1.0, val sampledAtMs: Double? = null)

One reading of the player.

Link copied to clipboard
class VoiceLabels(val names: Map<String, String>, val tint: (agent: String) -> Color?? = null, val bottom: androidx.compose.ui.unit.Dp = 16.dp, val backdrop: androidx.compose.ui.graphics.layer.GraphicsLayer? = null, val backdropOrigin: () -> Offset = { Offset.Zero }, val darken: Float = 0.0f, val scale: Float = 1.0f)

Who sings each line, by the agent ids lines carry (v1, v2, …, v1000 for a group), and optionally a colour for each, which tints their capsule. Shown only when two voices or more have a name (a singer and their group count).

Functions

Link copied to clipboard
fun BraccatoLyrics(lyrics: BuiltLyrics, playback: () -> PlaybackSnapshot, modifier: Modifier = Modifier, theme: BraccatoTheme = BraccatoTheme.Default, state: BraccatoLyricsState = rememberBraccatoLyricsState(), tickOptions: TickOptions = TickOptions(isPlaying = false), decorations: (BuiltLine) -> LineDecorations = ::lyricDecorations, onSeek: (Double) -> Unit? = null, wallClockMs: () -> Double? = null, footer: () -> Unit? = null, voices: VoiceLabels? = null, active: () -> Boolean = { true })

Synchronized lyrics, scrolling to follow the song.

Link copied to clipboard
fun BraccatoStage(lyrics: BuiltLyrics, playback: () -> PlaybackSnapshot, modifier: Modifier = Modifier, theme: BraccatoTheme = BraccatoTheme.Default, tickOptions: TickOptions = TickOptions(isPlaying = false), decorations: (BuiltLine) -> LineDecorations = ::lyricDecorations, onStageLayout: (StageBox?) -> Unit? = null, wallClockMs: () -> Double? = null, voices: VoiceLabels? = null)

Synchronized lyrics as subtitles: only the lines being sung, sitting at the bottom of the space.

Link copied to clipboard
fun lyricDecorations(line: BuiltLine): LineDecorations

The decorations a line's own lyric carries: its first translation and its romanization, timed when the provider timed it. A host that streams them in later passes its own instead.

Link copied to clipboard

A BraccatoLyricsState that lives as long as the composition.