rvlib-shipkit 2.20.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/package.json +1 -1
- package/src/asks/asks-queue.ts +8 -7
- package/src/assets/kits/identity-kit.ts +158 -2
- package/src/checks/SK004-gitignore-policy.check.ts +6 -3
- package/src/cli/cmd_Bump.ts +3 -3
- package/src/cli/cmd_GlobalProcesses.ts +2 -107
- package/src/cli/cmd_Home.ts +1 -1
- package/src/cli/cmd_Overview.ts +2 -1
- package/src/cli/cmd_Rec.ts +349 -0
- package/src/cli/cmd_Releases.ts +42 -3
- package/src/cli/cmd_Review.ts +22 -13
- package/src/cli/cmd_Secret.ts +10 -3
- package/src/cli/cmd_Sign.ts +24 -0
- package/src/cli/cmd_Social.ts +57 -8
- package/src/cli/cmd_Sound.ts +17 -4
- package/src/cli/cmd_Trailer.ts +67 -1
- package/src/cli/family-pages.ts +1 -0
- package/src/cli/registry.ts +6 -1
- package/src/collections/collection-types.ts +1 -1
- package/src/collections/review.ts +23 -4
- package/src/core/agent-spawn.ts +4 -17
- package/src/core/code-lines.ts +49 -0
- package/src/core/discover-checks.ts +27 -3
- package/src/core/hard-reset.ts +34 -0
- package/src/core/layout.ts +6 -0
- package/src/core/raw-access.ts +3 -13
- package/src/core/throwaway-worktree.ts +72 -0
- package/src/home/app-sign.ts +98 -0
- package/src/home/gui-app/ShipkitGui.swift +35 -0
- package/src/home/gui-app.ts +31 -11
- package/src/home/home-routes.ts +6 -0
- package/src/home/pm-switch.ts +112 -0
- package/src/home/serve-web.ts +1 -1
- package/src/identities/identities.ts +17 -6
- package/src/media-kinds.ts +5 -3
- package/src/media-store/forget.ts +54 -0
- package/src/media-store/put.ts +4 -3
- package/src/media-store/space.ts +63 -24
- package/src/messages/brief.ts +3 -3
- package/src/messages/score.ts +2 -0
- package/src/recordings/delete.ts +19 -0
- package/src/recordings/edit.ts +231 -0
- package/src/recordings/load.ts +37 -0
- package/src/recordings/marks-draw.ts +111 -0
- package/src/recordings/marks-png.ts +25 -0
- package/src/recordings/marks.ts +138 -0
- package/src/recordings/media-kind.ts +67 -0
- package/src/recordings/model.ts +170 -0
- package/src/recordings/open.ts +33 -0
- package/src/recordings/place.ts +89 -0
- package/src/recordings/presets.ts +99 -0
- package/src/recordings/recorder-app/Capture.swift +510 -0
- package/src/recordings/recorder-app/Clip.swift +107 -0
- package/src/recordings/recorder-app/Editor.swift +39 -0
- package/src/recordings/recorder-app/Tray.swift +298 -0
- package/src/recordings/recorder-app/main.swift +859 -0
- package/src/recordings/recorder-app.ts +46 -0
- package/src/recordings/recorder.shipkit.ts +11 -0
- package/src/recordings/routes.ts +140 -0
- package/src/recordings/run-recorder.ts +40 -0
- package/src/recordings/share.ts +107 -0
- package/src/recordings/take.ts +146 -0
- package/src/recordings/view.ts +40 -0
- package/src/release/gate-checkout.ts +74 -0
- package/src/release/release-scope.ts +35 -26
- package/src/release/run-bump.ts +79 -37
- package/src/release/run-release.ts +67 -53
- package/src/releases/add.ts +38 -5
- package/src/releases/before.ts +31 -0
- package/src/releases/from-card.ts +105 -20
- package/src/releases/model.ts +100 -18
- package/src/releases/pictures.ts +29 -8
- package/src/repo-config.ts +7 -3
- package/src/review/http.ts +1 -1
- package/src/review/model.ts +12 -2
- package/src/review/stage-card.ts +1 -1
- package/src/review/store.ts +12 -2
- package/src/review/trailer-desk.ts +20 -0
- package/src/review/trailer-model.ts +67 -0
- package/src/review/trailer-routes.ts +98 -1
- package/src/review/trailer-voices.ts +144 -0
- package/src/review/watchers.ts +58 -1
- package/src/secrets/manager.ts +18 -1
- package/src/serve/hub-app/benign-errors.ts +22 -0
- package/src/serve/hub-app/hash-route.ts +27 -15
- package/src/serve/hub-app/home-st.ts +23 -5
- package/src/serve/hub-app/home.html +1 -0
- package/src/serve/hub-app/hub-app.tsx +8 -1
- package/src/serve/hub-app/icons.tsx +2 -0
- package/src/serve/hub-app/palette-st.ts +1 -0
- package/src/serve/hub-app/project-list.css +7 -2
- package/src/serve/hub-app/project-list.tsx +10 -0
- package/src/serve/hub-app/projects-svc.ts +17 -7
- package/src/serve/hub-app/recordings-st.ts +641 -0
- package/src/serve/hub-app/recordings-view.tsx +504 -0
- package/src/serve/hub-app/recordings.css +82 -0
- package/src/serve/hub-app/releases/releases-page.tsx +121 -28
- package/src/serve/hub-app/releases/releases-st.ts +46 -4
- package/src/serve/hub-app/releases.css +30 -3
- package/src/serve/hub-app/repo-sections.ts +1 -1
- package/src/serve/hub-app/repo-st.ts +16 -11
- package/src/serve/hub-app/review/clip-st.ts +3 -1
- package/src/serve/hub-app/review/kit.tsx +3 -3
- package/src/serve/hub-app/review/trailer-page.tsx +32 -6
- package/src/serve/hub-app/review/trailer-st.ts +184 -8
- package/src/serve/hub-app/review/trailer-timeline.tsx +39 -4
- package/src/serve/hub-app/review/trailer-voices-st.ts +370 -0
- package/src/serve/hub-app/review/trailer-voices.tsx +574 -0
- package/src/serve/hub-app/review.css +90 -0
- package/src/serve/hub-app/social/comms-page.tsx +10 -5
- package/src/serve/hub-app/social/next-release.tsx +118 -0
- package/src/serve/hub-app/social/post-card.tsx +31 -3
- package/src/serve/hub-app/social/social-model.ts +6 -0
- package/src/serve/hub-app/social/social-st.ts +50 -1
- package/src/serve/hub-app/social.css +12 -0
- package/src/serve/hub-app/tree-build.ts +2 -0
- package/src/serve/project-gutter-route.ts +8 -0
- package/src/serve/project-gutter.ts +4 -2
- package/src/shipkit.ts +2 -2
- package/src/shot/box.ts +49 -22
- package/src/shot/browser-slot.ts +13 -3
- package/src/shot/client.ts +1 -1
- package/src/shot/film-box.ts +193 -117
- package/src/shot/shooter.ts +20 -8
- package/src/smoke/run-smoke.ts +8 -6
- package/src/social/compose.ts +14 -0
- package/src/social/desk-index.ts +49 -8
- package/src/social/discord-layout.ts +6 -2
- package/src/social/drafts.ts +1 -1
- package/src/social/kinds.ts +3 -2
- package/src/social/load.ts +42 -9
- package/src/social/publish/index.ts +27 -10
- package/src/social/publish/secret.ts +12 -4
- package/src/social/release-card.ts +69 -0
- package/src/social/release-stage.ts +173 -30
- package/src/social/routes.ts +7 -1
- package/src/social/stage.ts +45 -22
- package/src/trailer/bed.ts +111 -0
- package/src/trailer/build.ts +81 -38
- package/src/trailer/ffmpeg.ts +14 -0
- package/src/trailer/grammar.ts +32 -4
- package/src/trailer/graph.ts +12 -1
- package/src/trailer/look.ts +7 -0
- package/src/trailer/shot-plan.ts +75 -0
- package/src/trailer/shot-state.ts +191 -0
- package/src/trailer/sound/audio.ts +28 -0
- package/src/trailer/sound/brand.ts +53 -3
- package/src/trailer/sound/gen.ts +61 -2
- package/src/trailer/sound/index.ts +25 -11
- package/src/trailer/sound/presets.ts +86 -5
- package/src/trailer/sound/run.ts +1 -1
- package/src/trailer/sound/takes.ts +94 -0
- package/src/trailer/titles.ts +36 -0
- package/src/trailer/url.ts +1 -1
- package/src/veille/chrome.ts +6 -3
|
@@ -20,11 +20,14 @@ import {
|
|
|
20
20
|
type TrailerDesk,
|
|
21
21
|
type TrailerInfo,
|
|
22
22
|
type TrailerNote,
|
|
23
|
+
type VoicesDesk,
|
|
23
24
|
} from '../../../review/trailer-model.ts'
|
|
24
25
|
import { reach } from '../reach.ts'
|
|
25
26
|
import type { RepoSt } from '../repo-st.ts'
|
|
26
27
|
import { ClipSt } from './clip-st.ts'
|
|
28
|
+
import { VoicesSt } from './trailer-voices-st.ts'
|
|
27
29
|
import { LIT_S } from '../../../review/trailer-notes.ts'
|
|
30
|
+
import type { CutStates } from '../../../trailer/shot-state.ts'
|
|
28
31
|
|
|
29
32
|
const POLL_MS = 3000
|
|
30
33
|
|
|
@@ -57,6 +60,18 @@ export interface PlacedNote {
|
|
|
57
60
|
|
|
58
61
|
type NoteFilter = 'open' | 'all'
|
|
59
62
|
|
|
63
|
+
/** the whole cut with his takes (the standin where he made none), or with the standin on every line */
|
|
64
|
+
export type VoiceSide = 'takes' | 'standin'
|
|
65
|
+
|
|
66
|
+
/** who reads a working cut's lines of his voice, for the render on screen (`at`) */
|
|
67
|
+
export interface OwnVoice {
|
|
68
|
+
at: string
|
|
69
|
+
who: string
|
|
70
|
+
standin: string
|
|
71
|
+
/** the brand plays his takes */
|
|
72
|
+
takes: boolean
|
|
73
|
+
}
|
|
74
|
+
|
|
60
75
|
const ZOOMS = [1, 1.5, 2, 3, 4, 6, 8, 12, 16] as const
|
|
61
76
|
|
|
62
77
|
/** the caption's text as the title draws it: `\n` in the file is a line break */
|
|
@@ -98,13 +113,27 @@ export class TrailerSt {
|
|
|
98
113
|
zoom = 1
|
|
99
114
|
saving = false
|
|
100
115
|
error: string | null = null
|
|
116
|
+
/** what the last action said that is no error (a shot asked of the recorder) */
|
|
117
|
+
said: string | null = null
|
|
101
118
|
/** the montage page of the cut on screen, its markdown, once asked */
|
|
102
119
|
montage: { key: string; md: string | null } | null = null
|
|
103
120
|
montageOpen = false
|
|
121
|
+
/** the voice side he picked; null: the brand's */
|
|
122
|
+
voiceSide: VoiceSide | null = null
|
|
123
|
+
/** the cut on screen's lines of his voice; null while unknown or when it has none */
|
|
124
|
+
own: OwnVoice | null = null
|
|
125
|
+
/** the side asked for the render on screen: its file's key once made, or why it is refused */
|
|
126
|
+
voiced: { id: string; key: string | null; error: string | null } | null = null
|
|
127
|
+
/** the last side made for a render, on screen while the next is made */
|
|
128
|
+
private lastVoiced: { at: string; key: string } | null = null
|
|
129
|
+
/** a play asked while the side was being made: it plays once it is */
|
|
130
|
+
private held = false
|
|
104
131
|
private landing: { shot: string; offset: number; play: boolean } | null = null
|
|
105
132
|
private noteLanding: string | null = null
|
|
106
133
|
private timer: ReturnType<typeof setInterval> | null = null
|
|
107
134
|
private readonly prefs: string
|
|
135
|
+
/** the Voices view: the lines of the trailer, his takes, his microphone */
|
|
136
|
+
readonly voices: VoicesSt
|
|
108
137
|
|
|
109
138
|
constructor(
|
|
110
139
|
private readonly st: RepoSt,
|
|
@@ -112,19 +141,21 @@ export class TrailerSt {
|
|
|
112
141
|
readonly card: { id: string; spec: TrailerCard; lane: () => LaneMark[] } | null = null,
|
|
113
142
|
) {
|
|
114
143
|
this.prefs = `shipkit.trailer.${st.key}`
|
|
144
|
+
this.voices = new VoicesSt(st, () => this.trailer?.id ?? null)
|
|
115
145
|
if (card) {
|
|
116
146
|
this.trailerId = card.spec.trailer
|
|
117
147
|
this.cutId = card.spec.after.cut
|
|
118
148
|
}
|
|
119
149
|
try {
|
|
120
|
-
const p = JSON.parse(localStorage.getItem(this.prefs) ?? '{}') as { zoom?: number; filter?: NoteFilter; rate?: number }
|
|
150
|
+
const p = JSON.parse(localStorage.getItem(this.prefs) ?? '{}') as { zoom?: number; filter?: NoteFilter; rate?: number; voice?: VoiceSide }
|
|
121
151
|
if (p.zoom && ZOOMS.includes(p.zoom as never)) this.zoom = p.zoom
|
|
122
152
|
if (p.filter === 'open' || p.filter === 'all') this.filter = p.filter
|
|
123
153
|
if (p.rate) this.clock.setRate(p.rate)
|
|
154
|
+
if (p.voice === 'takes' || p.voice === 'standin') this.voiceSide = p.voice
|
|
124
155
|
} catch {
|
|
125
156
|
// a blocked storage only loses the kept choices
|
|
126
157
|
}
|
|
127
|
-
makeAutoObservable<this, 'st' | 'landing' | 'timer' | 'prefs' | 'noteLanding'>(this, { st: false, card: false, clock: false, shown: observableRef, landing: false, timer: false, prefs: false, noteLanding: false })
|
|
158
|
+
makeAutoObservable<this, 'st' | 'landing' | 'timer' | 'prefs' | 'noteLanding' | 'held'>(this, { st: false, card: false, clock: false, voices: false, shown: observableRef, landing: false, timer: false, prefs: false, noteLanding: false, held: false })
|
|
128
159
|
// a trailer is heard: the clock starts with its sound on
|
|
129
160
|
this.clock.hear(true)
|
|
130
161
|
// a card plays its pinned render from the start; no address is its own
|
|
@@ -152,8 +183,32 @@ export class TrailerSt {
|
|
|
152
183
|
() => [this.shown?.version ?? null, this.notes.length] as const,
|
|
153
184
|
() => this.landOnNote(),
|
|
154
185
|
)
|
|
186
|
+
// the render on screen, or the page back from Voices (a take recorded, edited): who reads its lines, read again
|
|
187
|
+
reaction(
|
|
188
|
+
() => [this.shownAt, this.voices.on] as const,
|
|
189
|
+
([, voicesOn]) => void (voicesOn ? undefined : this.readOwn()),
|
|
190
|
+
{ fireImmediately: true },
|
|
191
|
+
)
|
|
192
|
+
// a side flipped, or known at last: its file asked for
|
|
193
|
+
reaction(
|
|
194
|
+
() => this.voicedId,
|
|
195
|
+
() => void this.askVoiced(),
|
|
196
|
+
)
|
|
197
|
+
// nothing of the other side plays: a play while the side is made or refused waits, and plays once it is made
|
|
155
198
|
reaction(
|
|
156
|
-
() =>
|
|
199
|
+
() => [this.voicing, this.voiceError !== null, this.clock.paused] as const,
|
|
200
|
+
([making, refused, paused]) => {
|
|
201
|
+
if ((making || refused) && !paused) {
|
|
202
|
+
this.held = making
|
|
203
|
+
this.clock.pause()
|
|
204
|
+
} else if (!making && !refused && this.held) {
|
|
205
|
+
this.held = false
|
|
206
|
+
if (paused) this.clock.play()
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
)
|
|
210
|
+
reaction(
|
|
211
|
+
() => JSON.stringify({ zoom: this.zoom, filter: this.filter, rate: this.clock.rate, ...(this.voiceSide ? { voice: this.voiceSide } : {}) }),
|
|
157
212
|
(s) => {
|
|
158
213
|
try {
|
|
159
214
|
localStorage.setItem(this.prefs, s)
|
|
@@ -173,9 +228,11 @@ export class TrailerSt {
|
|
|
173
228
|
if (this.timer !== null) clearInterval(this.timer)
|
|
174
229
|
this.timer = null
|
|
175
230
|
if (!this.clock.paused) this.clock.pause()
|
|
231
|
+
void this.voices.cancel()
|
|
176
232
|
}
|
|
177
233
|
|
|
178
234
|
async refresh(): Promise<void> {
|
|
235
|
+
if (!this.card) void this.voices.refresh()
|
|
179
236
|
try {
|
|
180
237
|
const desk = await send<TrailerDesk>(this.st.url('/api/trailer'), 'GET')
|
|
181
238
|
runInAction(() => {
|
|
@@ -200,6 +257,18 @@ export class TrailerSt {
|
|
|
200
257
|
return cuts.find((c) => c.cut === this.cutId) ?? latestCut(cuts) ?? cuts.find((c) => c.video !== null) ?? cuts[0] ?? null
|
|
201
258
|
}
|
|
202
259
|
|
|
260
|
+
/** each shot of the cut on screen in plain words, and the summary (trailer/shot-state.ts); none on a card, whose
|
|
261
|
+
* renders are pinned history */
|
|
262
|
+
get shotStates(): CutStates | null {
|
|
263
|
+
const c = this.cut
|
|
264
|
+
return this.card || !c || this.shown?.cut !== c.cut ? null : c.shots
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/** a card a shot waits on, opened in the review page */
|
|
268
|
+
openCard(id: string): void {
|
|
269
|
+
this.st.showReview(id)
|
|
270
|
+
}
|
|
271
|
+
|
|
203
272
|
/** a finished render newer than the one on screen */
|
|
204
273
|
get newer(): boolean {
|
|
205
274
|
const v = this.cut?.video
|
|
@@ -208,7 +277,11 @@ export class TrailerSt {
|
|
|
208
277
|
|
|
209
278
|
/** the cut the address names, the note open on it (the player lands on its frame), the notes filter; an address
|
|
210
279
|
* with no filter keeps the one the page remembers */
|
|
211
|
-
select(trailer: string | null, cut: string | null, note: string | null = null, filter: NoteFilter | null = null): void {
|
|
280
|
+
select(trailer: string | null, cut: string | null, note: string | null = null, filter: NoteFilter | null = null, voices?: string): void {
|
|
281
|
+
// the Voices view rides on the address: '' is the view on its first line
|
|
282
|
+
if (voices === undefined) {
|
|
283
|
+
if (this.voices.on) this.voices.show(false)
|
|
284
|
+
} else this.voices.open(voices || null)
|
|
212
285
|
if (cut !== this.cutId || trailer !== this.trailerId) {
|
|
213
286
|
this.draft = null
|
|
214
287
|
this.editing = null
|
|
@@ -224,8 +297,9 @@ export class TrailerSt {
|
|
|
224
297
|
}
|
|
225
298
|
|
|
226
299
|
/** what the address carries of this page; RepoSt.setSel writes it, the one place an address is written */
|
|
227
|
-
get address(): { t: 'trailer'; trailer: string | null; cut: string | null; note: string | null; filter: NoteFilter | null } {
|
|
228
|
-
|
|
300
|
+
get address(): { t: 'trailer'; trailer: string | null; cut: string | null; note: string | null; filter: NoteFilter | null; voices?: string } {
|
|
301
|
+
const v = this.voices
|
|
302
|
+
return { t: 'trailer', trailer: this.trailerId, cut: this.cutId, note: this.selected, filter: this.filter === 'all' ? null : this.filter, ...(v.on ? { voices: v.openKey ?? '' } : {}) }
|
|
229
303
|
}
|
|
230
304
|
|
|
231
305
|
/** the note an address opened: the player lands on its frame once the cut on screen places it */
|
|
@@ -244,7 +318,9 @@ export class TrailerSt {
|
|
|
244
318
|
if (cut !== null) this.side(cut)
|
|
245
319
|
return
|
|
246
320
|
}
|
|
247
|
-
|
|
321
|
+
// a cut picked plays it; a trailer picked keeps the view on screen
|
|
322
|
+
const voices = cut === null && this.voices.on ? '' : undefined
|
|
323
|
+
this.st.showTrailer(trailer, cut, trailer === this.trailerId ? this.selected : null, this.filter === 'all' ? null : this.filter, voices)
|
|
248
324
|
}
|
|
249
325
|
|
|
250
326
|
showCurrent(): void {
|
|
@@ -342,9 +418,94 @@ export class TrailerSt {
|
|
|
342
418
|
this.showCurrent()
|
|
343
419
|
}
|
|
344
420
|
|
|
421
|
+
/** the render on screen, the cut with the side he hears once it is made (its picture is the render's) */
|
|
345
422
|
get videoUrl(): string | null {
|
|
346
423
|
const s = this.shown
|
|
347
|
-
|
|
424
|
+
if (!s) return null
|
|
425
|
+
// a side being made keeps the last side's file on screen, paused: the same picture, no reload
|
|
426
|
+
const v = this.voiced
|
|
427
|
+
const key = v && v.id === this.voicedId && v.key ? v.key : this.lastVoiced?.at === this.shownAt ? this.lastVoiced.key : null
|
|
428
|
+
return key ? this.st.url(`/api/trailer/voiced/${key}.mp4`) : this.st.url(`/api/trailer/video/${s.trailer}/${s.cut}/${s.version}.mp4`)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
// ── his voice or the standin's (wiki tools/trailer/trailer-sound.md, Your own voice) ──
|
|
432
|
+
|
|
433
|
+
private get shownAt(): string | null {
|
|
434
|
+
const s = this.shown
|
|
435
|
+
return s && !this.card ? `${s.trailer}/${s.cut}/${s.version}` : null
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** the lines of his voice of the render on screen; null when it has none */
|
|
439
|
+
get ownHere(): OwnVoice | null {
|
|
440
|
+
return this.own && this.own.at === this.shownAt ? this.own : null
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** the side heard: his pick, else the brand's; null when the cut has no line of his voice */
|
|
444
|
+
get heard(): VoiceSide | null {
|
|
445
|
+
const o = this.ownHere
|
|
446
|
+
return o ? (this.voiceSide ?? (o.takes ? 'takes' : 'standin')) : null
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
private get voicedId(): string | null {
|
|
450
|
+
const at = this.shownAt
|
|
451
|
+
return at && this.heard ? `${at}/${this.heard}` : null
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/** the side heard is still being made */
|
|
455
|
+
get voicing(): boolean {
|
|
456
|
+
const id = this.voicedId
|
|
457
|
+
return id !== null && (this.voiced?.id !== id || (this.voiced.key === null && this.voiced.error === null))
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
/** why the side heard cannot play */
|
|
461
|
+
get voiceError(): string | null {
|
|
462
|
+
return this.voiced && this.voiced.id === this.voicedId ? this.voiced.error : null
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
setVoice(side: VoiceSide): void {
|
|
466
|
+
this.voiceSide = side
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/** who reads the cut on screen's lines: the trailer's Voices, its uses on this cut */
|
|
470
|
+
private async readOwn(): Promise<void> {
|
|
471
|
+
const at = this.shownAt
|
|
472
|
+
const s = this.shown
|
|
473
|
+
const cut = this.cut
|
|
474
|
+
if (!at || !s || cut?.cut !== s.cut || cut.version || !cut.files.trailer) {
|
|
475
|
+
this.own = null
|
|
476
|
+
return
|
|
477
|
+
}
|
|
478
|
+
try {
|
|
479
|
+
const d = await send<VoicesDesk>(this.st.url(`/api/trailer/voices/${s.trailer}`), 'GET')
|
|
480
|
+
const use = d.lines.flatMap((l) => l.uses).find((u) => u.cut === s.cut && u.mine)
|
|
481
|
+
const had = this.voiced?.id ?? null
|
|
482
|
+
runInAction(() => {
|
|
483
|
+
this.own = use && d.recorder ? { at, who: d.recorder.who, standin: use.standin?.name ?? "the brand's voice", takes: d.recorder.takes } : null
|
|
484
|
+
})
|
|
485
|
+
// back from Voices: the same side asked again, a take made since changes its file
|
|
486
|
+
if (had !== null && had === this.voicedId) void this.askVoiced()
|
|
487
|
+
} catch (e) {
|
|
488
|
+
runInAction(() => (this.error = `voices: ${(e as Error).message}`))
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
/** the side heard, made on the hub when it is not yet; the file on screen stays until the new one is made */
|
|
493
|
+
private async askVoiced(): Promise<void> {
|
|
494
|
+
const id = this.voicedId
|
|
495
|
+
if (!id) return
|
|
496
|
+
const was = this.voiced
|
|
497
|
+
if (was?.key && this.shownAt) this.lastVoiced = { at: this.shownAt, key: was.key }
|
|
498
|
+
if (was?.id !== id) this.voiced = { id, key: null, error: null }
|
|
499
|
+
try {
|
|
500
|
+
const r = await send<{ key: string }>(this.st.url(`/api/trailer/voiced/${id}`), 'GET')
|
|
501
|
+
runInAction(() => {
|
|
502
|
+
if (this.voiced?.id === id) this.voiced = { id, key: r.key, error: null }
|
|
503
|
+
})
|
|
504
|
+
} catch (e) {
|
|
505
|
+
runInAction(() => {
|
|
506
|
+
if (this.voiced?.id === id) this.voiced = { id, key: null, error: (e as Error).message }
|
|
507
|
+
})
|
|
508
|
+
}
|
|
348
509
|
}
|
|
349
510
|
|
|
350
511
|
get stripUrl(): string | null {
|
|
@@ -657,6 +818,20 @@ export class TrailerSt {
|
|
|
657
818
|
}
|
|
658
819
|
}
|
|
659
820
|
|
|
821
|
+
/** a `film recording` shot shot again: the recorder app takes it as long as the shot, at the cut's size for a
|
|
822
|
+
* window, and files the new take under the old name (the home's recordings route) */
|
|
823
|
+
async shootAgain(shot: Pick<ShotSpan, 'recording' | 'length'>): Promise<void> {
|
|
824
|
+
const tl = this.timeline
|
|
825
|
+
if (!shot.recording || !tl) return
|
|
826
|
+
this.error = null
|
|
827
|
+
try {
|
|
828
|
+
const r = await send<{ said: string }>('/api/home/recordings/reshoot', 'POST', { ref: shot.recording, repo: this.st.key, seconds: shot.length, size: `${tl.size[0]}x${tl.size[1]}` })
|
|
829
|
+
runInAction(() => (this.said = r.said))
|
|
830
|
+
} catch (e) {
|
|
831
|
+
runInAction(() => (this.error = `shoot again: ${(e as Error).message}`))
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
660
835
|
/** the render on screen shown in the Finder */
|
|
661
836
|
async reveal(): Promise<void> {
|
|
662
837
|
const s = this.shown
|
|
@@ -689,6 +864,7 @@ export class TrailerSt {
|
|
|
689
864
|
* note), N a note on this frame, M the sound, - and + the timeline's zoom, Home the start. Arrows and plain keys,
|
|
690
865
|
* so an AZERTY keyboard reaches every one */
|
|
691
866
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'>): boolean {
|
|
867
|
+
if (this.voices.on) return this.voices.key(e)
|
|
692
868
|
const k = e.key.toLowerCase()
|
|
693
869
|
if (e.key === ' ') {
|
|
694
870
|
// a focused button would click again on the key's release
|
|
@@ -5,6 +5,7 @@ import { observer } from 'mobx-react-lite'
|
|
|
5
5
|
import { useEffect, useRef, useState, type CSSProperties, type RefObject } from 'react'
|
|
6
6
|
import { clock, shotAt, type LaneMark, type ShotSpan, type Timeline } from '../../../review/trailer-model.ts'
|
|
7
7
|
import { captionText, type TrailerSt } from './trailer-st.ts'
|
|
8
|
+
import type { ShotStatus } from '../../../trailer/shot-state.ts'
|
|
8
9
|
|
|
9
10
|
const RULER = 18
|
|
10
11
|
const SECTIONS = 22
|
|
@@ -115,7 +116,7 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
|
|
|
115
116
|
{s.name}
|
|
116
117
|
</div>
|
|
117
118
|
))}
|
|
118
|
-
{tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} changed={st.changed.has(s.name)} />)}
|
|
119
|
+
{tl.shots.map((s, i) => <ShotBlock key={`${s.name}@${i}`} s={s} i={i} x={xOf(s.start)} w={xOf(s.end) - xOf(s.start)} on={cur === s} hue={hueOf(tl, s.section)} changed={st.changed.has(s.name)} status={st.shotStates?.states[s.name]} />)}
|
|
119
120
|
{tl.shots.flatMap((s) =>
|
|
120
121
|
s.captions.map((c, j) => (
|
|
121
122
|
<div key={`${s.name}-${j}`} className={`tr-caption${lit.has(`${c.start}|${c.text}`) ? ' on' : ''}`} title={captionText(c)}
|
|
@@ -135,14 +136,43 @@ export const TrailerTimeline = observer(({ st }: { st: TrailerSt }) => {
|
|
|
135
136
|
)
|
|
136
137
|
})
|
|
137
138
|
|
|
138
|
-
|
|
139
|
-
|
|
139
|
+
/** a shot's state as its tooltip says it: the state, the lane and why, the card, then the dim details */
|
|
140
|
+
export const stateTip = (st: ShotStatus): string =>
|
|
141
|
+
[`${st.word}${st.state === 'waiting' && st.card ? ` on card ${st.card}` : ''}${st.by && st.state !== 'ready' ? ` · by ${st.by}` : ''}`, ...(st.why ? [`why: ${st.why}`] : []), ...st.detail].join('\n')
|
|
142
|
+
|
|
143
|
+
const ShotBlock = ({ s, i, x, w, on, hue, changed, status }: { s: ShotSpan; i: number; x: number; w: number; on: boolean; hue: string; changed: boolean; status: ShotStatus | undefined }) => (
|
|
144
|
+
<div className={`tr-shot ${hue}${on ? ' on' : ''}${i % 2 ? ' odd' : ''}${changed ? ' changed' : ''}`} title={`${s.name} · ${clock(s.start)} · ${secsOf(s.length)}${changed ? ' · changed' : ''}${status ? `\n${stateTip(status)}` : ''}`}
|
|
140
145
|
style={{ left: x + 0.5, width: Math.max(1, w - 1), top: ROW.shots, height: SHOTS }}>
|
|
141
146
|
{w > 26 ? s.name : ''}
|
|
142
147
|
{w > 44 ? <div className="tr-shottime">{clock(s.start)}</div> : null}
|
|
148
|
+
{status ? <div className={`tr-sbar ss-${status.state}`} /> : null}
|
|
143
149
|
</div>
|
|
144
150
|
)
|
|
145
151
|
|
|
152
|
+
/** the cut at a glance, over its timeline: how many shots are ready, queued, filming, not filmed, and the cards whose
|
|
153
|
+
* new takes wait for the owner's answer */
|
|
154
|
+
export const ShotSummary = observer(({ st }: { st: TrailerSt }) => {
|
|
155
|
+
const ss = st.shotStates
|
|
156
|
+
if (!ss) return null
|
|
157
|
+
const { counts: c, total, cards } = ss.summary
|
|
158
|
+
const cut = st.cut?.cut
|
|
159
|
+
return (
|
|
160
|
+
<div className="tr-summary" title="each shot's state: a coloured bar under it on the timeline, a line on its card; a lane writes it with sk trailer plan">
|
|
161
|
+
<span className="ss-ready"><span className="tr-sdot" /><b>{c.ready} of {total}</b> shots ready</span>
|
|
162
|
+
<span className="ss-queued"><span className="tr-sdot" />{c.queued} queued</span>
|
|
163
|
+
<span className="ss-filming"><span className="tr-sdot" />{c.filming} filming</span>
|
|
164
|
+
{c.unfilmed > 0 ? <span className="ss-unfilmed"><span className="tr-sdot" />{c.unfilmed} not filmed</span> : null}
|
|
165
|
+
<span className="ss-waiting">
|
|
166
|
+
<span className="tr-sdot" />cards waiting: {cards.length === 0 ? 'none' : cards.map((x) => (
|
|
167
|
+
<button key={x.card} type="button" className="tr-cardlink" title={`open card ${x.card}: the new take of ${x.shots.join(', ')}`} onClick={() => st.openCard(x.card)}>{x.card} ({x.shots.join(', ')})</button>
|
|
168
|
+
))}
|
|
169
|
+
</span>
|
|
170
|
+
{ss.plan !== cut ? <span className="tr-dim tr-small">the plan of {ss.plan}, the cut this version keeps</span> : null}
|
|
171
|
+
{ss.read === null && !st.cut?.version ? <span className="tr-dim tr-small">takes not read yet: sk trailer check shows which are filmed</span> : null}
|
|
172
|
+
</div>
|
|
173
|
+
)
|
|
174
|
+
})
|
|
175
|
+
|
|
146
176
|
/** one note on the lane, numbered in the order of the cut: a click lands on its frame */
|
|
147
177
|
const LaneMarker = ({ m, x }: { m: LaneMark; x: number }) => (
|
|
148
178
|
<>
|
|
@@ -206,12 +236,17 @@ export const ShotCards = observer(({ st }: { st: TrailerSt }) => {
|
|
|
206
236
|
{tl.shots.map((s, i) => {
|
|
207
237
|
const n = counts.get(s.name) ?? 0
|
|
208
238
|
const changed = st.changed.has(s.name)
|
|
239
|
+
const status = st.shotStates?.states[s.name]
|
|
209
240
|
return (
|
|
210
|
-
<button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}${changed ? ' changed' : ''}`} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
|
|
241
|
+
<button type="button" key={`${s.name}@${i}`} className={`tr-shotcard ${hueOf(tl, s.section)}${i === cur ? ' on' : ''}${changed ? ' changed' : ''}`} title={status ? stateTip(status) : undefined} onMouseDown={(e) => e.preventDefault()} onClick={() => st.seek(s.start)}>
|
|
211
242
|
<Thumb st={st} index={i} w={136} />
|
|
212
243
|
<div className="tr-shotname"><span className="tr-dim">{i + 1} </span>{s.name}{changed ? <span className="tr-changed" title="the change touched this shot">changed</span> : null}</div>
|
|
213
244
|
<div className="tr-dim tr-small">{clock(s.start)} · {secsOf(s.length)}{s.captions.length > 0 ? ` · ${s.captions.length} title${s.captions.length > 1 ? 's' : ''}` : ''}</div>
|
|
245
|
+
{status ? <div className={`tr-sstate ss-${status.state}`}><span className="tr-sdot" />{status.word}{status.state === 'waiting' && status.card ? <span className="tr-dim">{status.card}</span> : status.why && status.state !== 'ready' ? <span className="tr-dim">{status.why}</span> : null}</div> : null}
|
|
214
246
|
{n > 0 ? <span className="tr-shotnotes">{n}</span> : null}
|
|
247
|
+
{s.recording ? (
|
|
248
|
+
<span role="button" tabIndex={0} className="tr-reshoot" title={`shoot ${s.recording} again with the recorder: as long as the shot, the new take keeps its name`} onClick={(e) => { e.stopPropagation(); void st.shootAgain(s) }} onKeyDown={(e) => { if (e.key === 'Enter') { e.stopPropagation(); void st.shootAgain(s) } }}>● shoot again</span>
|
|
249
|
+
) : null}
|
|
215
250
|
</button>
|
|
216
251
|
)
|
|
217
252
|
})}
|