// The SONG PLAYING as a RECORD ON A TURNTABLE AT A PARTY (the coordinator's// pick, 4 Nov 2026; the picture `music9-worlds/party-player`, the proof// `music12-faces/composite-party`): the fourth player face of Music's// Listening deck (beside the hi-fi, the turntable and the amp; the `player`// face setting picks one). It IS the turntable (`SongTurntableFace`, drawn in// `TurntableLook.party`): the same slipmat, record, spindle, arm and jewel,// the record turning at 33⅓ and coasting to rest upright, the arm the clock// and lifted while paused, the same tagged parts and gestures — on the// party's dark wood dance floor (`FaceGround.partyFloor`) under its warm// lights, which the ground drifts slowly, with no lamp.//// What the party draws of its own:// - its LABEL, black paper with a red and a cream ring, turning with the// record: the song's name big in red condensed capitals, two lines at// most, above the spindle; the artist and the album in cream capitals// under it; the time played, the time left and the song's length small at// its foot, typed. Where the album has a cover, the cover goes round// behind the rings, veiled, the words over it (the person chose a party,// not a label);// - the one warm REFLECTION streak, lying still over the record as it turns// (`party-glow`), where the proof lays it;// - the album's COVER lying flat on the floor at the upper left, where it// has one (the `picture` part).//// PAINTED (`Media.xcassets`, `scripts/import-music-materials.py party`):// the floor, the lights, the reflection and the blank label, Round 12, laid// where `music12-faces/layout.json` places them in the turntable's 1420 x// 1450 box; the rest are the turntable's, Round 11, already imported.//// Every word is the card's (`title`, `artist`, `album`, `duration`), the// player's or a line (the turntable's).importCottonPaperimportCottonValuesimportSwiftUIenumSongPartyFaceKnobs {// THE WHOLE DRAWING, in the box's pixels (`layout.json`'s `party`): the// cover lying above the mat at the upper left (`sampleCoverRect`), down// to the box's foot. The mat, the record, the arm, the spindle and the// jewel lie where the turntable's do (`SongTurntableFaceKnobs`): the// layout reuses them unmoved.staticlet whole = CGRect(x: 0, y: -200, width: 1420, height: 1650)staticlet cover = CGRect(x: 100, y: -200, width: 330, height: 330)// THE REFLECTION, laid at the size its layout declares (`phoneMaxSize`// 341 points, three pixels a point, so 1365 of the box's four a point)// and placed so its streak lies where the proof has it: down the// record's left, from above the record to under the label.staticlet glow = CGRect(x: -332, y: 0, width: 1365, height: 1365)// THE LABEL over the record's middle: laid larger than the layout's 390,// as the turntable's is, its round (radius 250) inside the run-out// groove (260). Its painting's pixels (`painted`), every place on it// below being in them, about its centre (512, 512); the painted round// (508, measured off `party-label-blank`, not the layout's 450, which is// inside its red ring), a cover's round, just inside the red ring (its// inner edge 456), and the spindle hole (30).staticlet label = CGRect(x: 348, y: 498, width: 504, height: 504)staticlet painted: CGFloat = 1024staticlet round: CGFloat = 508staticlet coverRound: CGFloat = 452staticlet hole: CGFloat = 30/// The veil over a cover, darker than the dark room's: the red name/// reads on a bright cover only over a deep shade.staticlet veil: Double = 0.62// THE LABEL'S WORDS, in the label painting's pixels, on the layout's// `labelTextRects` drawn larger with the label and held inside its rings:// the name above the spindle (two lines at most), the artist and the// album under it, the times at the foot.staticlet titleBox = CGRect(x: 222, y: 150, width: 580, height: 290)staticlet titleSize: CGFloat = 116/// The name's sizes, largest first, each on two lines at most; past the/// last, two lines shrinking.staticlet titleSteps: [CGFloat] = [1, 0.8]staticlet artistBox = CGRect(x: 170, y: 600, width: 684, height: 74)staticlet albumBox = CGRect(x: 180, y: 680, width: 664, height: 70)staticlet artistSize: CGFloat = 64staticlet albumSize: CGFloat = 58staticlet timesBox = CGRect(x: 262, y: 790, width: 500, height: 64)staticlet timeSize: CGFloat = 50staticlet timesGap: CGFloat = 34}/// What the party's label says, in its order: the song's name in capitals,/// red, above the spindle; its artist and its album in capitals, cream, under/// it.publicenumPartyLabel {publicstaticfunc title(_ card: DeckCard) -> String? { card.text("title")?.uppercased() }publicstaticfunc artist(_ card: DeckCard) -> String? { card.text("artist")?.uppercased() }publicstaticfunc album(_ card: DeckCard) -> String? { card.text("album")?.uppercased() }}/// The party label's printed words, laid on a square the label's side: the/// song's name in red condensed capitals, two lines at most, the artist and/// the album in cream capitals. The same over a cover: the cover is veiled.structPartyLabelWords: View {let card: DeckCardlet side: CGFloatvar body: someView {let knobs = SongPartyFaceKnobs.selflet k = side / knobs.painted ZStack(alignment: .topLeading) {iflet title = PartyLabel.title(card) {PartyTitle(words: title, s: k) .frame(width: knobs.titleBox.width * k, height: knobs.titleBox.height * k, alignment: .bottom) .offset(x: knobs.titleBox.minX * k, y: knobs.titleBox.minY * k) }iflet artist = PartyLabel.artist(card) { capitals(Text(artist).font(.system(size: knobs.artistSize * k, weight: .bold).width(.condensed))) .frame(width: knobs.artistBox.width * k, height: knobs.artistBox.height * k) .offset(x: knobs.artistBox.minX * k, y: knobs.artistBox.minY * k) }iflet album = PartyLabel.album(card) { capitals(Text(album).font(CottonFonts.sleeve(knobs.albumSize * k))) .frame(width: knobs.albumBox.width * k, height: knobs.albumBox.height * k) .offset(x: knobs.albumBox.minX * k, y: knobs.albumBox.minY * k) } } .foregroundStyle(MusicMaterial.partyCream.colour) .frame(width: side, height: side, alignment: .topLeading) }/// One line at its size while it fits, else shrinking.privatefunc capitals(_ line: Text) -> someView {ViewThatFits(in: .horizontal) { line.lineLimit(1).fixedSize() line.lineLimit(1).minimumScaleFactor(0.45) } }}/// The song's name (in capitals already) in the party's red condensed type: at its size on one/// line or two, else a step smaller on one or two, else two lines shrinking.privatestructPartyTitle: View {let words: Stringlet s: CGFloatvar body: someView {let knobs = SongPartyFaceKnobs.selfViewThatFits(in: .vertical) {ForEach(knobs.titleSteps, id: \.self) { step in line(knobs.titleSize * step).fixedSize(horizontal: false, vertical: true) } line(knobs.titleSize * knobs.titleSteps[knobs.titleSteps.count - 1]) .lineLimit(2) .minimumScaleFactor(0.4) } .foregroundStyle(MusicMaterial.partyRed.colour) }privatefunc line(_ size: CGFloat) -> someView {Text(words) .font(CottonFonts.sleeve(size * s)) .multilineTextAlignment(.center) }}/// The party's face, and the songs it is reviewed playing: the turntable's/// songs, under the player the app installs (`faceTrackPlayer`), else paused.publicenumSongPartyFaceCatalogue {publicstaticlet stock: FaceStock = .ownpublicstaticlet ground: FaceGround = .partyFloorpublicstaticlet face = Face(id: "song.party", specimens: [Specimen("playing", harbour, picture: "poster-ferry", play: TrackPlay(held: true, playing: true, elapsed: 134, duration: 242)),Specimen("paused", harbour, picture: "poster-ferry", play: TrackPlay(held: true, playing: false, elapsed: 134, duration: 242)),Specimen("no cover", train, play: TrackPlay(held: true, playing: true, elapsed: 61, duration: 197)),Specimen("largest", largest, play: TrackPlay(held: true, playing: false, elapsed: 312, duration: 669)), ]) { card, picture, _ inTrackPlaying(card: card) { player inSongTurntableFace(card: card, cover: picture, play: player.play, toggle: player.toggle, seek: player.seek, look: .party) } }/// An invented song off an invented album, 4:02 long.publicstaticlet harbour = DeckCard(face: .songParty, fields: ["title": .text("Harbour Lights"),"artist": .text("The Low Tide"),"album": .text("Night Ferry"),"duration": .number(242), ])/// Another album's song, no cover, 3:17 long.publicstaticlet train = DeckCard(face: .songParty, fields: ["title": .text("Slow Train"),"artist": .text("Mara Vance"),"album": .text("Common Ground"),"duration": .number(197), ])/// The longest words, no cover, drawn at every text size Loom has, the/// largest among them.publicstaticlet largest = DeckCard(face: .songParty, fields: ["title": .text("The Slow Train Home Through Sixteen Lanterns"),"artist": .text("Mara Vance and The Low Tide"),"album": .text("Sixteen Lanterns and the Blue Hour Sessions"),"duration": .number(669), ])}