Cotton code
32 lines · 1.2 KB · SwiftRaw
// What was said, a turn each (`"presentation": "turns"`): the core answers a// transcript as turns apart by a blank line, each headed by its clock time// and who spoke ("4:07 · Asha"). A turn is its own tap — the page's recording// plays from that time. With the recording not on this phone the tapped turn// says so beside Fetch, and plays from there once the bytes arrive; a record// with no recording left draws its turns as plain words.import SwiftUI/// The page's one recording, shared by the player that draws it and the/// turns that play from it.@MainActor@Observablefinal class PagePlayback {    /// Where the recording's bytes are; the page's player sets it.    var stage: MediaStageModel?    /// The time last asked for, in seconds; `ask` counts the askings, so the    /// same turn tapped twice plays twice.    private(set) var from: Double = 0    private(set) var ask = 0    /// A time asked for while the bytes were not here.    var waiting: Double?    /// Whether the recording is playing now; the player says so, and the    /// turn it was asked from says it under its words.    var playing = false    func play(from seconds: Double) {        from = seconds        ask += 1    }}