package com.keylightpiano.pianotimeline.player

/**
 * Immutable snapshot of what the player is doing right now.
 * The UI observes this to know which card is playing, button states, etc.
 *
 * `nowPlayingId` is the recording id currently loaded (or null if nothing).
 * The list cards compare their own id against this to decide whether to show
 * the pause icon + red title.
 */
data class PlaybackState(
    val nowPlayingId: String? = null,
    val isPlaying: Boolean = false,
    val isBuffering: Boolean = false,
    val positionMs: Long = 0L,
    val durationMs: Long = 0L
) {
    val hasActiveTrack: Boolean get() = nowPlayingId != null
}
