five-on-it / apps/client/src/audio/radio-timeline
apps/client/src/audio/radio-timeline
The radio's clock: every station plays all the time, as a real one does, whether anyone listens or not. Since RADIO_EPOCH each has played its items one after the other, round and round, each round in its order (the items' own, or a shuffle of them of its own, seeded by the station and the round: the same for every player and every page), so tuning in lands in the middle of whatever is on, and tuning away and back finds the station further on. positionAt says what is on and how far into it, from the items' lengths (an item that will not play, length 0, is skipped).