conformtools 0.6.5 → 0.6.6

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.
Files changed (147) hide show
  1. package/README.md +3 -3
  2. package/dist/account-HDXVTS5T.js +3 -0
  3. package/dist/arriraw-YIJ3BYNN.js +525 -0
  4. package/dist/avid-panel/MANIFEST.json +11 -0
  5. package/dist/avid-panel/avid-manifest.json +46 -0
  6. package/dist/avid-panel/icon.svg +4 -0
  7. package/dist/avid-panel/icons/conformtools.svg +4 -0
  8. package/dist/avid-panel/index.html +26 -0
  9. package/dist/avid-panel/panel.css +12 -0
  10. package/dist/avid-panel/panel.js +7 -0
  11. package/dist/bridge-D5KPIUSY.js +3 -0
  12. package/dist/browser/timeline_core_bg.wasm +0 -0
  13. package/dist/chunk-3OCQA33E.js +3 -0
  14. package/dist/chunk-3XD6NC4G.js +10 -0
  15. package/dist/chunk-5JBUCVRI.js +20 -0
  16. package/dist/chunk-5RSNFPED.js +8 -0
  17. package/dist/chunk-5SUGU2YR.js +3 -0
  18. package/dist/chunk-6ML26TIK.js +3 -0
  19. package/dist/chunk-7D7H6VFW.js +3 -0
  20. package/dist/chunk-7MC7M2Y5.js +3 -0
  21. package/dist/chunk-AACY2V3L.js +3 -0
  22. package/dist/chunk-AS7IXHYM.js +19 -0
  23. package/dist/chunk-BL6L5ZBP.js +39 -0
  24. package/dist/chunk-C2ESM27Z.js +3 -0
  25. package/dist/chunk-C5IX63YF.js +3 -0
  26. package/dist/chunk-D6YDLKSA.js +3 -0
  27. package/dist/chunk-DKGGJM6Z.js +3 -0
  28. package/dist/chunk-EJGVNQ3E.js +8 -0
  29. package/dist/chunk-HGDO3OED.js +3 -0
  30. package/dist/chunk-JV7TZDKJ.js +3 -0
  31. package/dist/chunk-LFJLRLEP.js +3 -0
  32. package/dist/chunk-NFJHWZJX.js +3 -0
  33. package/dist/chunk-NQHQKEP5.js +3 -0
  34. package/dist/chunk-NU3X7P4N.js +3 -0
  35. package/dist/chunk-OJWIBQK4.js +376 -0
  36. package/dist/chunk-OVUCL3YY.js +5 -0
  37. package/dist/chunk-P7OVDUA5.js +3 -0
  38. package/dist/chunk-PFISREY4.js +3 -0
  39. package/dist/chunk-PFZVET7S.js +3 -0
  40. package/dist/chunk-PLRB2YXJ.js +3 -0
  41. package/dist/chunk-PSANHDZM.js +3 -0
  42. package/dist/chunk-RFIPLBQ4.js +5 -0
  43. package/dist/chunk-SZD4C5MB.js +6 -0
  44. package/dist/chunk-TK55FA56.js +3 -0
  45. package/dist/chunk-TXQR2HI2.js +4 -0
  46. package/dist/chunk-UCMNH6Q6.js +3 -0
  47. package/dist/chunk-UKKRZ574.js +7 -0
  48. package/dist/chunk-VS3MKKJ5.js +3 -0
  49. package/dist/chunk-X53BNWNV.js +3 -0
  50. package/dist/chunk-XNR7M4VX.js +3 -0
  51. package/dist/claude-setup-IIWUB4CE.js +5 -0
  52. package/dist/cli.js +17 -0
  53. package/dist/clip-state-B6JOX3JE.js +3 -0
  54. package/dist/conformtools-analyze +0 -0
  55. package/dist/conformtools-decode +0 -0
  56. package/dist/cr3-wasm-L2LFY3LM.js +3 -0
  57. package/dist/dng-wasm-U6NC3MDK.js +3 -0
  58. package/dist/dpx-wasm-RMKEUKED.js +3 -0
  59. package/dist/engine-P6H5P6HP.js +5 -0
  60. package/dist/esm-SFFBP7PS.js +3 -0
  61. package/dist/exr-wasm-LBAOMOZD.js +3 -0
  62. package/dist/flame/hook/conformtools_flame/__init__.py +10 -0
  63. package/dist/flame/hook/conformtools_flame/building.py +191 -0
  64. package/dist/flame/hook/conformtools_flame/hook.py +177 -0
  65. package/dist/flame/hook/conformtools_flame/render.py +622 -0
  66. package/dist/flame/hook/conformtools_flame/util.py +33 -0
  67. package/dist/flame/hook/conformtools_flame/verbs.py +1037 -0
  68. package/dist/flame/hook/conformtools_flame_hook.py +42 -0
  69. package/dist/fonts/gfx/BarlowCondensed-Bold.ttf +0 -0
  70. package/dist/fonts/gfx/BarlowCondensed-Regular.ttf +0 -0
  71. package/dist/fonts/gfx/InstrumentSerif-Regular.ttf +0 -0
  72. package/dist/fonts/gfx/Inter-Bold.ttf +0 -0
  73. package/dist/fonts/gfx/Inter-Regular.ttf +0 -0
  74. package/dist/fonts/gfx/JetBrainsMono-Bold.ttf +0 -0
  75. package/dist/fonts/gfx/JetBrainsMono-Regular.ttf +0 -0
  76. package/dist/fonts/gfx/OFL.txt +100 -0
  77. package/dist/framing-SRCJKAYO.js +3 -0
  78. package/dist/gfx-worker.js +3 -0
  79. package/dist/h264-3ESGVT6G.js +3 -0
  80. package/dist/h264-mxf-NPFS7NGH.js +3 -0
  81. package/dist/host-relink-D6CB2VOQ.js +10 -0
  82. package/dist/hosts-W4AD2MYH.js +3 -0
  83. package/dist/http.js +5 -0
  84. package/dist/i2o-transfer +0 -0
  85. package/dist/inspect-7ASUPU73.js +68 -0
  86. package/dist/isobmff-SIOE67WL.js +3 -0
  87. package/dist/mcp.js +13 -0
  88. package/dist/media-7AUNRKHF.js +3 -0
  89. package/dist/media_core-Q2PIEV7D.js +9 -0
  90. package/dist/media_core_bg-FDL7GJZP.js +3 -0
  91. package/dist/media_core_bg-XRBVKQZH.js +3 -0
  92. package/dist/mxf-74TTDICM.js +3 -0
  93. package/dist/nuke/panel/python/Startup/conformtools_nuke_startup.py +44 -0
  94. package/dist/nuke/panel/python/conformtools_nuke/__init__.py +10 -0
  95. package/dist/nuke/panel/python/conformtools_nuke/panel.py +217 -0
  96. package/dist/nuke/panel/python/conformtools_nuke/verbs.py +837 -0
  97. package/dist/ops-FSOOBXMV.js +3 -0
  98. package/dist/peer-kit/ctpeer/__init__.py +21 -0
  99. package/dist/peer-kit/ctpeer/client.py +247 -0
  100. package/dist/peer-kit/ctpeer/neutral.py +178 -0
  101. package/dist/peer-kit/ctpeer/pairing.py +139 -0
  102. package/dist/peer-kit/ctpeer/protocol.py +209 -0
  103. package/dist/peer-kit/ctpeer/websocket.py +289 -0
  104. package/dist/premiere-uxp/icons/panel.png +0 -0
  105. package/dist/premiere-uxp/icons/panel@2x.png +0 -0
  106. package/dist/premiere-uxp/icons/plugin.png +0 -0
  107. package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
  108. package/dist/premiere-uxp/index.html +38 -0
  109. package/dist/premiere-uxp/index.js +93 -0
  110. package/dist/premiere-uxp/lib/clipmeta.js +170 -0
  111. package/dist/premiere-uxp/lib/ctx.js +68 -0
  112. package/dist/premiere-uxp/lib/edit.js +516 -0
  113. package/dist/premiere-uxp/lib/handles.js +57 -0
  114. package/dist/premiere-uxp/lib/markers.js +198 -0
  115. package/dist/premiere-uxp/lib/pairing.js +67 -0
  116. package/dist/premiere-uxp/lib/premiere.js +91 -0
  117. package/dist/premiere-uxp/lib/probe.js +241 -0
  118. package/dist/premiere-uxp/lib/protocol.js +165 -0
  119. package/dist/premiere-uxp/lib/render.js +45 -0
  120. package/dist/premiere-uxp/lib/session.js +85 -0
  121. package/dist/premiere-uxp/lib/sizing.js +325 -0
  122. package/dist/premiere-uxp/lib/time.js +88 -0
  123. package/dist/premiere-uxp/lib/timeline.js +336 -0
  124. package/dist/premiere-uxp/lib/verbs.js +21 -0
  125. package/dist/premiere-uxp/lib/write.js +97 -0
  126. package/dist/premiere-uxp/manifest.json +102 -0
  127. package/dist/probe-F7WQHMIA.js +3 -0
  128. package/dist/prores-RIG37OIH.js +526 -0
  129. package/dist/r3d-YTLOMC7C.js +3 -0
  130. package/dist/r3d-ZDJ3WURS.js +1025 -0
  131. package/dist/resolve-bridge.py +2286 -0
  132. package/dist/resolve-presets/conform.tools.xml +127 -0
  133. package/dist/source-BDJAUQVR.js +3 -0
  134. package/dist/statusline-GMMCFMOA.js +4 -0
  135. package/dist/statusline.js +3 -0
  136. package/dist/still-ZG2RUQAL.js +3 -0
  137. package/dist/store-ZHXLQCGN.js +3 -0
  138. package/dist/tiff-wasm-D2FJ3L56.js +3 -0
  139. package/dist/timeline-6DYFDVEH.js +3 -0
  140. package/dist/timeline_core-IOENXK4Z.js +3 -0
  141. package/dist/timeline_core_bg-JW42YM3G.js +3 -0
  142. package/dist/udf_bg-B37GKRIH.js +3 -0
  143. package/dist/wasm/media_core_bg.wasm +0 -0
  144. package/dist/wasm/udf_bg.wasm +0 -0
  145. package/dist/wasm-threads/media_core_bg.wasm +0 -0
  146. package/dist/wav-OWMUGQMM.js +3 -0
  147. package/package.json +6 -4
@@ -0,0 +1,88 @@
1
+ // Premiere counts time in TICKS: 254016000000 per second. A sequence's
2
+ // timebase is the tick count of one frame. The neutral model counts FRAMES at
3
+ // the sequence rate, so every conversion lives here and is tested in node.
4
+ "use strict";
5
+
6
+ const TICKS_PER_SECOND = 254016000000;
7
+
8
+ /** `ticks` may be a number, a numeric string (the API returns strings for
9
+ * large tick values) or a TickTime-like object with `ticks`/`ticksNumber`/`seconds`. */
10
+ function toTicks(v) {
11
+ if (v === null || v === undefined) return 0;
12
+ if (typeof v === "number") return v;
13
+ if (typeof v === "string") return Number(v);
14
+ if (typeof v === "object") {
15
+ if (typeof v.ticksNumber === "number") return v.ticksNumber;
16
+ if (v.ticks !== undefined) return Number(v.ticks);
17
+ if (typeof v.seconds === "number") return Math.round(v.seconds * TICKS_PER_SECOND);
18
+ }
19
+ return Number(v) || 0;
20
+ }
21
+
22
+ /** Frames per second from a sequence timebase (ticks per frame). */
23
+ function fpsFromTimebase(timebase) {
24
+ const tpf = toTicks(timebase);
25
+ return tpf > 0 ? TICKS_PER_SECOND / tpf : 0;
26
+ }
27
+
28
+ function ticksToFrames(ticks, timebase) {
29
+ const tpf = toTicks(timebase);
30
+ if (tpf <= 0) return 0;
31
+ return Math.round(toTicks(ticks) / tpf);
32
+ }
33
+
34
+ function framesToTicks(frames, timebase) {
35
+ return Math.round(Number(frames) * toTicks(timebase));
36
+ }
37
+
38
+ /** Timebase for common rates when only fps is known (tests, model_from fps). */
39
+ // MEASURED 26.5.2: Premiere reports a DJI clip's rate as its measured 29.970089…, not 30000/1001; ticks per frame
40
+ // from that put a source in-point just short of its frame, which Premiere floors — every cut-in landed 1 frame
41
+ // early. A rate within 0.01 % of a standard one is that standard rate, with Premiere's exact ticks per frame.
42
+ const STANDARD = [[24000, 1001], [24, 1], [25, 1], [30000, 1001], [30, 1], [48000, 1001], [48, 1], [50, 1], [60000, 1001], [60, 1], [120000, 1001], [120, 1]];
43
+ function timebaseFromFps(fps) {
44
+ const f = Number(fps);
45
+ for (const [n, d] of STANDARD) if (Math.abs(f - n / d) < (n / d) * 1e-4) return Math.round(TICKS_PER_SECOND * d / n);
46
+ return Math.round(TICKS_PER_SECOND / f);
47
+ }
48
+
49
+ /** HH:MM:SS:FF (or ; for drop-frame) from a frame count at `fps`. Drop-frame
50
+ * applies to 29.97 / 59.94 only when `drop` is true; Premiere's own display
51
+ * setting decides that, so callers pass it. */
52
+ function framesToTimecode(frames, fps, drop) {
53
+ const nominal = Math.round(fps);
54
+ let f = Math.max(0, Math.round(frames));
55
+ if (drop && (nominal === 30 || nominal === 60)) {
56
+ const dropPerMin = nominal === 30 ? 2 : 4;
57
+ const framesPer10 = nominal * 60 * 10 - dropPerMin * 9;
58
+ const d = Math.floor(f / framesPer10);
59
+ let m = f % framesPer10;
60
+ if (m < dropPerMin) m = m + dropPerMin;
61
+ f = f + dropPerMin * 9 * d + dropPerMin * Math.floor((m - dropPerMin) / (nominal * 60 - dropPerMin));
62
+ }
63
+ const ff = f % nominal;
64
+ const s = Math.floor(f / nominal) % 60;
65
+ const m = Math.floor(f / (nominal * 60)) % 60;
66
+ const h = Math.floor(f / (nominal * 3600));
67
+ const sep = drop ? ";" : ":";
68
+ const p = (n) => String(n).padStart(2, "0");
69
+ return `${p(h)}:${p(m)}:${p(s)}${sep}${p(ff)}`;
70
+ }
71
+
72
+ /** The inverse of framesToTimecode; accepts : or ; separators. */
73
+ function timecodeToFrames(tc, fps) {
74
+ const m = /^(\d+)[:;](\d+)[:;](\d+)[:;](\d+)$/.exec(String(tc).trim());
75
+ if (!m) throw new Error(`not a timecode: ${tc}`);
76
+ const nominal = Math.round(fps);
77
+ const [h, mi, s, f] = m.slice(1).map(Number);
78
+ const drop = tc.includes(";");
79
+ let frames = ((h * 60 + mi) * 60 + s) * nominal + f;
80
+ if (drop && (nominal === 30 || nominal === 60)) {
81
+ const dropPerMin = nominal === 30 ? 2 : 4;
82
+ const totalMinutes = h * 60 + mi;
83
+ frames -= dropPerMin * (totalMinutes - Math.floor(totalMinutes / 10));
84
+ }
85
+ return frames;
86
+ }
87
+
88
+ module.exports = { TICKS_PER_SECOND, toTicks, fpsFromTimebase, ticksToFrames, framesToTicks, timebaseFromFps, framesToTimecode, timecodeToFrames };
@@ -0,0 +1,336 @@
1
+ // `timeline_read`: a sequence as the neutral timeline model (the shape
2
+ // `editlist.model_from_session` produces for a file side - the Reconformer
3
+ // consumes it as-is), plus the structural primitives.
4
+ "use strict";
5
+
6
+ const { handles, h, g, projectOf, PeerError, P } = require("./ctx");
7
+ const T = require("./time");
8
+ const S = require("./sizing");
9
+
10
+ const MODEL_SCHEMA = 1;
11
+
12
+ async function tracksOf(seq, kind) {
13
+ const isVideo = kind !== "audio";
14
+ const count = await P.callAny(seq, isVideo ? ["getVideoTrackCount"] : ["getAudioTrackCount"]);
15
+ const out = [];
16
+ for (let i = 0; i < Number(count || 0); i += 1) {
17
+ out.push(await P.callAny(seq, isVideo ? ["getVideoTrack"] : ["getAudioTrack"], i));
18
+ }
19
+ return out;
20
+ }
21
+
22
+ async function clipItems(track) {
23
+ const ppro = P.api();
24
+ const type = ppro.Constants && ppro.Constants.TrackItemType ? ppro.Constants.TrackItemType.CLIP : 1;
25
+ const items = await P.callAny(track, ["getTrackItems"], type, false);
26
+ return Array.isArray(items) ? items : [];
27
+ }
28
+
29
+ async function transitionItems(track) {
30
+ const ppro = P.api();
31
+ const tt = ppro.Constants && ppro.Constants.TrackItemType;
32
+ if (!tt || tt.TRANSITION === undefined) return [];
33
+ try {
34
+ const items = await P.callAny(track, ["getTrackItems"], tt.TRANSITION, false);
35
+ return Array.isArray(items) ? items : [];
36
+ } catch (_) { return []; }
37
+ }
38
+
39
+ async function timebaseOf(seq) {
40
+ const tb = await P.callAny(seq, ["getTimebase"]);
41
+ return T.toTicks(tb);
42
+ }
43
+
44
+ async function zeroPointFrames(seq, timebase) {
45
+ if (!P.has(seq, "getZeroPoint")) return 0;
46
+ const zp = await seq.getZeroPoint();
47
+ return T.ticksToFrames(zp, timebase);
48
+ }
49
+
50
+ async function frameSize(seq) {
51
+ try {
52
+ const fs = await P.callAny(seq, ["getFrameSize"]);
53
+ if (fs && typeof fs === "object") return [Number(fs.width || fs.w || 0), Number(fs.height || fs.h || 0)];
54
+ } catch (_) { /* older DOM */ }
55
+ return [0, 0];
56
+ }
57
+
58
+ async function ticksOf(item, names) {
59
+ const v = await P.callAny(item, names);
60
+ return T.toTicks(v);
61
+ }
62
+
63
+ /** Source timecode origin of a project item, in frames at `fps`, or null.
64
+ * 26.5 has Media.getStart(); earlier hosts carry it in the XMP
65
+ * (`xmpDM:startTimecode/xmpDM:timeValue`) or the project metadata
66
+ * (`Column.Intrinsic.MediaStart`). */
67
+ async function sourceStartFrames(projectItem, fps) {
68
+ if (!projectItem) return null;
69
+ try {
70
+ if (P.has(projectItem, "getMedia")) {
71
+ const media = await projectItem.getMedia();
72
+ if (media && P.has(media, "getStart")) {
73
+ const st = await media.getStart();
74
+ // a media start of 0 is a real start (00:00:00:00, every DJI clip), not a missing one
75
+ if (st !== undefined && st !== null) return Math.round(T.toTicks(st) / (T.TICKS_PER_SECOND / fps));
76
+ }
77
+ }
78
+ } catch (_) { /* fall through */ }
79
+ const ppro = P.api();
80
+ try {
81
+ const xmp = ppro.Metadata && P.has(ppro.Metadata, "getXMPMetadata") ? await ppro.Metadata.getXMPMetadata(projectItem) : null;
82
+ const tc = xmp && /startTimecode[\s\S]*?timeValue[^>]*>([^<]+)</.exec(String(xmp));
83
+ if (tc) return T.timecodeToFrames(tc[1].trim(), fps);
84
+ } catch (_) { /* fall through */ }
85
+ try {
86
+ const pm = ppro.Metadata && P.has(ppro.Metadata, "getProjectMetadata") ? await ppro.Metadata.getProjectMetadata(projectItem) : null;
87
+ const tc = pm && /MediaStart[^>]*>([^<]+)</.exec(String(pm));
88
+ if (tc && /^\d+[:;]\d+[:;]\d+[:;]\d+$/.test(tc[1].trim())) return T.timecodeToFrames(tc[1].trim(), fps);
89
+ } catch (_) { /* fall through */ }
90
+ return null;
91
+ }
92
+
93
+ async function sourceFps(projectItem, fallback) {
94
+ try {
95
+ if (P.has(projectItem, "getFootageInterpretation")) {
96
+ const fi = await projectItem.getFootageInterpretation();
97
+ const fr = fi && (P.has(fi, "getFrameRate") ? await fi.getFrameRate() : fi.frameRate);
98
+ if (fr && Number(fr) > 0) return Number(fr);
99
+ }
100
+ } catch (_) { /* fall through */ }
101
+ return fallback;
102
+ }
103
+
104
+ async function mediaPath(projectItem) {
105
+ if (!projectItem) return "";
106
+ const ppro = P.api();
107
+ let clip = projectItem;
108
+ try { if (ppro.ClipProjectItem && P.has(ppro.ClipProjectItem, "cast")) clip = ppro.ClipProjectItem.cast(projectItem) || projectItem; } catch (_) { /* not a clip */ }
109
+ try { const p = await P.callAny(clip, ["getMediaFilePath"]); return p ? String(p) : ""; } catch (_) { return ""; }
110
+ }
111
+
112
+ async function itemSpeed(item) {
113
+ let speed = 1.0;
114
+ let reversed = false;
115
+ try { const s = await P.callAny(item, ["getSpeed"]); if (s !== undefined && s !== null && Number(s) > 0) speed = Number(s); } catch (_) { /* no speed */ }
116
+ try { reversed = !!(await P.callAny(item, ["isSpeedReversed"])); } catch (_) { /* no reverse */ }
117
+ // Premiere reports speed as a factor (1.0 = play speed) in UXP; ExtendScript
118
+ // used the same. Guard a percentage anyway.
119
+ if (speed > 5) speed = speed / 100;
120
+ return { speed: reversed ? -Math.abs(speed) : speed, reversed };
121
+ }
122
+
123
+ /** The speed keys the Reconformer reads (editlist.speed_fields), from what
124
+ * Premiere reports. Time remapping is UNREACHABLE from UXP (Adobe, 26.3):
125
+ * `speed_is_variable` is true only when a Time Remapping component is
126
+ * visible in the chain, which today it is not. */
127
+ function speedFields(srcIn, srcOut, dur, fpsFactor, reported, variable) {
128
+ const derived = (srcOut - srcIn) / Math.max(1, dur);
129
+ const factor = fpsFactor && fpsFactor > 0 ? fpsFactor : 1.0;
130
+ return {
131
+ speed: Math.round(reported * 10000) / 10000,
132
+ speed_derived: Math.round(derived * 10000) / 10000,
133
+ fps_factor: Math.round(factor * 1e6) / 1e6,
134
+ speed_reported: Math.round(reported * 10000) / 10000,
135
+ speed_is_variable: !!variable,
136
+ speed_listed: true,
137
+ };
138
+ }
139
+
140
+ async function itemRow(item, trackIndex, seqTimebase, seqFps, raster, cache) {
141
+ const startT = await ticksOf(item, ["getStartTime"]);
142
+ const endT = await ticksOf(item, ["getEndTime"]);
143
+ const start = T.ticksToFrames(startT, seqTimebase);
144
+ const end = T.ticksToFrames(endT, seqTimebase);
145
+ let projectItem = null;
146
+ try { projectItem = await P.callAny(item, ["getProjectItem"]); } catch (_) { /* a title, a bar */ }
147
+ const srcFps = await sourceFps(projectItem, seqFps);
148
+ const srcTimebase = T.timebaseFromFps(srcFps);
149
+ let inT = 0;
150
+ let outT = 0;
151
+ try { inT = await ticksOf(item, ["getInPoint"]); outT = await ticksOf(item, ["getOutPoint"]); } catch (_) { /* no source range */ }
152
+ const srcIn = T.ticksToFrames(inT, srcTimebase);
153
+ const srcOut = outT ? T.ticksToFrames(outT, srcTimebase) : srcIn + (end - start);
154
+ const { speed } = await itemSpeed(item);
155
+ const path = await mediaPath(projectItem);
156
+ let name = "";
157
+ try { name = item.name || (projectItem && projectItem.name) || ""; } catch (_) { /* nameless */ }
158
+ let enabled = true;
159
+ try { enabled = !(await P.callAny(item, ["isDisabled"])); } catch (_) { /* assume enabled */ }
160
+ const key = projectItem ? (projectItem.guid || projectItem.nodeId || path || name) : "";
161
+ let startTc = null;
162
+ if (key && cache.has(key)) startTc = cache.get(key);
163
+ else { startTc = await sourceStartFrames(projectItem, srcFps); if (key) cache.set(key, startTc); }
164
+ const sz = await S.readSizingForModel(item, raster);
165
+ const fileName = path ? path.split(/[\\/]/).pop() : "";
166
+ const handle = h("item", item);
167
+ const dur = Math.max(1, end - start);
168
+ return {
169
+ clip_id: handle["$h"], name: String(name || fileName || ""), mpi_id: projectItem ? String(projectItem.guid || projectItem.nodeId || "") : "",
170
+ track: trackIndex, start, end, enabled, track_enabled: true,
171
+ src_in: srcIn, src_out: srcOut, src_relative: true,
172
+ src_abs_in: startTc !== null ? startTc + srcIn : null,
173
+ src_abs_out: startTc !== null ? startTc + srcOut : null,
174
+ ...speedFields(srcIn, srcOut, dur, srcFps / seqFps, Math.abs(speed) || 1.0, sz.variable_speed),
175
+ sizing: sz.sizing, nodes: null, markers: {}, flags: [], color: "",
176
+ sizing_keyframed: sz.keyframed,
177
+ reel: "", file_name: fileName, file_path: path, start_tc: startTc,
178
+ source_id: projectItem ? String(projectItem.guid || projectItem.nodeId || "") : "", nested: false, item: null,
179
+ src_fps: srcFps, reversed: speed < 0, handle,
180
+ };
181
+ }
182
+
183
+ async function model(seq, project) {
184
+ const timebase = await timebaseOf(seq);
185
+ const fps = T.fpsFromTimebase(timebase);
186
+ const startFrame = await zeroPointFrames(seq, timebase);
187
+ const raster = await frameSize(seq);
188
+ const items = [];
189
+ const trackStates = {};
190
+ const transitions = [];
191
+ const tracks = [];
192
+ const cache = new Map();
193
+ const vtracks = await tracksOf(seq, "video");
194
+ for (let i = 0; i < vtracks.length; i += 1) {
195
+ const track = vtracks[i];
196
+ const idx = i + 1;
197
+ let enabled = true;
198
+ try { if (P.has(track, "isMuted")) enabled = !(await track.isMuted()); } catch (_) { /* assume on */ }
199
+ trackStates[idx] = enabled;
200
+ const rows = [];
201
+ for (const it of await clipItems(track)) {
202
+ try {
203
+ const row = await itemRow(it, idx, timebase, fps, raster, cache);
204
+ row.track_enabled = enabled;
205
+ if (row.end > row.start) { rows.push(row); items.push(row); }
206
+ } catch (e) { /* a title or generator without media: skipped, like the file side skips fillers */ }
207
+ }
208
+ for (const tr of await transitionItems(track)) {
209
+ try {
210
+ const s = T.ticksToFrames(await ticksOf(tr, ["getStartTime"]), timebase);
211
+ const e = T.ticksToFrames(await ticksOf(tr, ["getEndTime"]), timebase);
212
+ transitions.push({ start: s, end: e, track: idx, kind: "dissolve" });
213
+ } catch (_) { /* skip */ }
214
+ }
215
+ tracks.push({ index: idx, enabled, items: rows });
216
+ }
217
+ items.sort((a, b) => (a.start - b.start) || (a.track - b.track));
218
+ // Frames in this model are ABSOLUTE (start_frame added), like a Resolve model.
219
+ for (const r of items) { r.start += startFrame; r.end += startFrame; }
220
+ for (const t of transitions) { t.start += startFrame; t.end += startFrame; }
221
+ return {
222
+ model_schema: MODEL_SCHEMA, timeline: String(seq.name || ""), start_frame: startFrame, fps,
223
+ items, tracks, track_states: trackStates, transitions, source: "premiere", format: "premiere",
224
+ raster, sizing_basis: "ir", markers: {}, timelines: [], timeline_index: null,
225
+ };
226
+ }
227
+
228
+ async function currentTimecode(seq) {
229
+ const timebase = await timebaseOf(seq);
230
+ const fps = T.fpsFromTimebase(timebase);
231
+ const pos = await P.callAny(seq, ["getPlayerPosition"]);
232
+ // MEASURED 26.2: the player position is relative to the sequence start; the
233
+ // timecode the user sees (and Resolve reports) is absolute.
234
+ const frames = T.ticksToFrames(pos, timebase) + (await zeroPointFrames(seq, timebase));
235
+ return T.framesToTimecode(frames, fps, false);
236
+ }
237
+
238
+ const verbs = {
239
+ "timeline_read.model": async ({ timeline, project }) => model(g(timeline, "seq"), project ? await projectOf(project) : null),
240
+ "timeline_read.start_frame": async ({ timeline }) => {
241
+ const seq = g(timeline, "seq");
242
+ return zeroPointFrames(seq, await timebaseOf(seq));
243
+ },
244
+ "timeline_read.setting": async ({ handle, key }) => {
245
+ const seq = g(handle, "seq");
246
+ const timebase = await timebaseOf(seq);
247
+ const fps = T.fpsFromTimebase(timebase);
248
+ const raster = await frameSize(seq);
249
+ const table = {
250
+ timelineFrameRate: fps, timelineResolutionWidth: raster[0], timelineResolutionHeight: raster[1],
251
+ timelineOutputResolutionWidth: raster[0], timelineOutputResolutionHeight: raster[1],
252
+ timelineDropFrameTimecode: "0", timelineTimebase: timebase,
253
+ };
254
+ return key in table ? table[key] : null;
255
+ },
256
+ "timeline_read.track_count": async ({ timeline, kind }) => (await tracksOf(g(timeline, "seq"), kind)).length,
257
+ "timeline_read.items_in_track": async ({ timeline, kind, index }) => {
258
+ const tracks = await tracksOf(g(timeline, "seq"), kind);
259
+ const track = tracks[Number(index) - 1];
260
+ if (!track) return [];
261
+ return (await clipItems(track)).map((it) => h("item", it));
262
+ },
263
+ "timeline_read.item_start": async ({ item }) => {
264
+ const it = g(item, "item");
265
+ const seq = await currentSeq();
266
+ return T.ticksToFrames(await ticksOf(it, ["getStartTime"]), await timebaseOf(seq)) + await zeroPointFrames(seq, await timebaseOf(seq));
267
+ },
268
+ "timeline_read.item_end": async ({ item }) => {
269
+ const it = g(item, "item");
270
+ const seq = await currentSeq();
271
+ return T.ticksToFrames(await ticksOf(it, ["getEndTime"]), await timebaseOf(seq)) + await zeroPointFrames(seq, await timebaseOf(seq));
272
+ },
273
+ "timeline_read.item_left_offset": async ({ item }) => {
274
+ const it = g(item, "item");
275
+ let pi = null;
276
+ try { pi = await P.callAny(it, ["getProjectItem"]); } catch (_) { /* none */ }
277
+ const fps = await sourceFps(pi, T.fpsFromTimebase(await timebaseOf(await currentSeq())));
278
+ return T.ticksToFrames(await ticksOf(it, ["getInPoint"]), T.timebaseFromFps(fps));
279
+ },
280
+ "timeline_read.item_source_start": async ({ item }) => {
281
+ const it = g(item, "item");
282
+ let pi = null;
283
+ try { pi = await P.callAny(it, ["getProjectItem"]); } catch (_) { /* none */ }
284
+ const fps = await sourceFps(pi, T.fpsFromTimebase(await timebaseOf(await currentSeq())));
285
+ const inF = T.ticksToFrames(await ticksOf(it, ["getInPoint"]), T.timebaseFromFps(fps));
286
+ const origin = await sourceStartFrames(pi, fps);
287
+ return (origin || 0) + inF;
288
+ },
289
+ "timeline_read.current_timecode": async ({ timeline }) => currentTimecode(g(timeline, "seq")),
290
+ "timeline_read.set_current_timecode": async ({ timeline, timecode }) => {
291
+ const seq = g(timeline, "seq");
292
+ const timebase = await timebaseOf(seq);
293
+ const fps = T.fpsFromTimebase(timebase);
294
+ const frames = T.timecodeToFrames(timecode, fps) - await zeroPointFrames(seq, timebase);
295
+ return setPlayer(seq, frames, timebase);
296
+ },
297
+ "timeline_read.set_current_frame": async ({ timeline, frame }) => {
298
+ const seq = g(timeline, "seq");
299
+ const timebase = await timebaseOf(seq);
300
+ return setPlayer(seq, Number(frame) - await zeroPointFrames(seq, timebase), timebase);
301
+ },
302
+ "timeline_read.current_video_item": async ({ timeline }) => {
303
+ const seq = g(timeline, "seq");
304
+ const timebase = await timebaseOf(seq);
305
+ const pos = T.toTicks(await P.callAny(seq, ["getPlayerPosition"]));
306
+ const tracks = await tracksOf(seq, "video");
307
+ let found = null;
308
+ for (let i = tracks.length - 1; i >= 0 && !found; i -= 1) {
309
+ for (const it of await clipItems(tracks[i])) {
310
+ const s = await ticksOf(it, ["getStartTime"]);
311
+ const e = await ticksOf(it, ["getEndTime"]);
312
+ if (pos >= s && pos < e) { found = it; break; }
313
+ }
314
+ }
315
+ return found ? h("item", found) : null;
316
+ },
317
+ };
318
+
319
+ async function currentSeq() {
320
+ const p = await projectOf(null);
321
+ if (!p) throw new PeerError("no_project", "No project open");
322
+ const seq = await P.callAny(p, ["getActiveSequence"]);
323
+ if (!seq) throw new PeerError("no_timeline", "No sequence active");
324
+ return seq;
325
+ }
326
+
327
+ async function setPlayer(seq, frames, timebase) {
328
+ const ppro = P.api();
329
+ const ticks = T.framesToTicks(Math.max(0, frames), timebase);
330
+ const tt = ppro.TickTime && P.has(ppro.TickTime, "createWithTicks") ? ppro.TickTime.createWithTicks(String(ticks))
331
+ : ppro.TickTime && P.has(ppro.TickTime, "createWithSeconds") ? ppro.TickTime.createWithSeconds(ticks / T.TICKS_PER_SECOND) : ticks;
332
+ const ok = await P.callAny(seq, ["setPlayerPosition"], tt);
333
+ return ok !== false;
334
+ }
335
+
336
+ module.exports = { verbs, model, tracksOf, clipItems, timebaseOf, zeroPointFrames, frameSize, itemRow, speedFields, sourceStartFrames, MODEL_SCHEMA, handles };
@@ -0,0 +1,21 @@
1
+ // The panel's whole verb table and what it announces - one place, so the
2
+ // panel, the tests and the stdio peer (scripts/stdio_peer.js) agree.
3
+ "use strict";
4
+
5
+ const VERBS = Object.assign({},
6
+ require("./session").verbs,
7
+ require("./timeline").verbs,
8
+ require("./markers").verbs,
9
+ require("./clipmeta").verbs,
10
+ require("./sizing").verbs,
11
+ require("./write").verbs,
12
+ require("./render").verbs,
13
+ require("./probe").verbs,
14
+ require("./edit").verbs,
15
+ );
16
+
17
+ const CAPABILITIES = ["session", "timeline_read", "markers", "clip_meta", "sizing", "timeline_write", "render", "edit"];
18
+ const OPTIONAL_VERBS = ["timeline_read.set_current_frame", "markers.move", "markers.set_color", "markers.set_text", "clip_meta.set_clip_properties",
19
+ "timeline_write.import_file", "timeline_write.export_xml", "render.export_sequence", "debug.probe", "debug.sizing_probe", "debug.marker_probe", "debug.place_probe", "debug.settings_probe", "timeline_write.export_otio"];
20
+
21
+ module.exports = { VERBS, CAPABILITIES, OPTIONAL_VERBS };
@@ -0,0 +1,97 @@
1
+ // `timeline_write`: a finished timeline handed to Premiere. The app's engine
2
+ // writes the .prproj (it is render-proven in real Premiere); this side only
3
+ // IMPORTS it (`Project.importSequences`) and, for small edits, drives
4
+ // SequenceEditor insert / overwrite / remove as one undo step.
5
+ "use strict";
6
+
7
+ const { handles, h, g, transact, activeProject, projectOf, PeerError, P } = require("./ctx");
8
+ const T = require("./time");
9
+ const TL = require("./timeline");
10
+
11
+ const verbs = {
12
+ // {path, sequences?: [guid]} -> the sequences now in the project, by name
13
+ "timeline_write.import_file": async ({ project, path, sequences }) => {
14
+ const p = await projectOf(project);
15
+ if (!p) throw new PeerError("no_project", "No project open");
16
+ const before = new Set((await P.callAny(p, ["getSequences"]) || []).map((s) => String(s.guid || s.name)));
17
+ const ext = String(path).toLowerCase().split(".").pop();
18
+ let ok;
19
+ let how = "importFiles";
20
+ if (ext === "prproj" && Array.isArray(sequences) && sequences.length) {
21
+ // Named sequences out of another project (needs their ids).
22
+ how = "importSequences";
23
+ ok = await P.callAny(p, ["importSequences"], String(path), sequences);
24
+ } else {
25
+ // MEASURED 26.2: importSequences with no ids imports nothing and says
26
+ // true; importFiles on a .prproj brings its sequences in (as a bin).
27
+ const root = await P.callAny(p, ["getRootItem"]);
28
+ ok = await P.callAny(p, ["importFiles"], [String(path)], true, root || null, false);
29
+ }
30
+ const after = await P.callAny(p, ["getSequences"]) || [];
31
+ const added = after.filter((s) => !before.has(String(s.guid || s.name)));
32
+ return { ok: ok !== false, how, imported: added.map((s) => ({ name: s.name, handle: h("seq", s) })) };
33
+ },
34
+ "timeline_write.import_media": async ({ project, paths }) => {
35
+ const p = await projectOf(project);
36
+ if (!p) throw new PeerError("no_project", "No project open");
37
+ const ok = await P.callAny(p, ["importFiles"], (paths || []).map(String), true, null, false);
38
+ return ok !== false;
39
+ },
40
+ "timeline_write.create_sequence": async ({ project, name }) => {
41
+ const p = await projectOf(project);
42
+ if (!p) throw new PeerError("no_project", "No project open");
43
+ const seq = await P.callAny(p, ["createSequence"], String(name));
44
+ return seq ? h("seq", seq) : null;
45
+ },
46
+ // {timeline, clip (pool clip handle), frame, track (1-based), mode: insert|overwrite}
47
+ "timeline_write.place": async ({ timeline, clip, frame, track, mode }) => {
48
+ const ppro = P.api();
49
+ const project = await activeProject();
50
+ const seq = g(timeline, "seq");
51
+ const item = g(clip, "clip");
52
+ const timebase = await TL.timebaseOf(seq);
53
+ const zero = await TL.zeroPointFrames(seq, timebase);
54
+ const ticks = T.framesToTicks(Number(frame) - zero, timebase);
55
+ const tt = ppro.TickTime && P.has(ppro.TickTime, "createWithTicks") ? ppro.TickTime.createWithTicks(String(ticks)) : ticks;
56
+ const editor = await P.callAny(ppro.SequenceEditor, ["getEditor"], seq);
57
+ const vIdx = Math.max(0, Number(track || 1) - 1);
58
+ const n = await transact(project, mode === "insert" ? "Insert clip" : "Overwrite clip", async (add) => {
59
+ if (mode === "insert") add(() => P.callAnySync(editor, ["createInsertProjectItemAction"], item, tt, vIdx, 0, false));
60
+ else add(() => P.callAnySync(editor, ["createOverwriteItemAction"], item, tt, vIdx, 0));
61
+ });
62
+ return n > 0;
63
+ },
64
+ "timeline_write.remove": async ({ timeline, items, ripple }) => {
65
+ const ppro = P.api();
66
+ const project = await activeProject();
67
+ const seq = g(timeline, "seq");
68
+ const editor = await P.callAny(ppro.SequenceEditor, ["getEditor"], seq);
69
+ const objs = (items || []).map((x) => g(x, "item"));
70
+ const mt = ppro.Constants && ppro.Constants.MediaType ? ppro.Constants.MediaType.VIDEO : 0;
71
+ const n = await transact(project, "Remove clips", async (add) => { add(() => P.callAnySync(editor, ["createRemoveItemsAction"], objs, !!ripple, mt)); });
72
+ return n > 0;
73
+ },
74
+ "timeline_write.export_xml": async ({ project, timeline, path }) => {
75
+ const ppro = P.api();
76
+ const p = await projectOf(project);
77
+ const seq = timeline ? g(timeline, "seq") : await P.callAny(p, ["getActiveSequence"]);
78
+ const conv = ppro.ProjectConverter;
79
+ if (!conv) throw new PeerError("api_missing", "ProjectConverter is not in this Premiere");
80
+ let ok = false;
81
+ let how = "";
82
+ if (!P.has(conv, "exportAsFinalCutProXML")) throw new PeerError("api_missing", "exportAsFinalCutProXML is not in this Premiere");
83
+ // The static's signature is not documented for 26.2: try (project, path,
84
+ // sequence), then (project, path), then (sequence, path); record which took.
85
+ const tries = [["project,path,sequence", () => conv.exportAsFinalCutProXML(p, String(path), seq)],
86
+ ["project,path", () => conv.exportAsFinalCutProXML(p, String(path))],
87
+ ["sequence,path", () => conv.exportAsFinalCutProXML(seq, String(path))]];
88
+ const errors = [];
89
+ for (const [label, fn] of tries) {
90
+ try { ok = await fn(); } catch (e) { errors.push(`${label}: ${e.message || e}`); ok = false; }
91
+ if (ok !== false && ok !== undefined) { how = label; break; }
92
+ }
93
+ return { ok: ok !== false && ok !== undefined, how, errors, path: String(path) };
94
+ },
95
+ };
96
+
97
+ module.exports = { verbs };
@@ -0,0 +1,102 @@
1
+ {
2
+ "id": "com.conformtools.premiere",
3
+ "name": "conform.tools",
4
+ "version": "0.4.2",
5
+ "main": "index.html",
6
+ "manifestVersion": 5,
7
+ "host": {
8
+ "app": "premierepro",
9
+ "minVersion": "26.2"
10
+ },
11
+ "entrypoints": [
12
+ {
13
+ "type": "panel",
14
+ "id": "conformtools.bridge",
15
+ "label": {
16
+ "default": "conform.tools"
17
+ },
18
+ "minimumSize": {
19
+ "width": 280,
20
+ "height": 220
21
+ },
22
+ "maximumSize": {
23
+ "width": 1200,
24
+ "height": 2000
25
+ },
26
+ "preferredDockedSize": {
27
+ "width": 320,
28
+ "height": 360
29
+ },
30
+ "preferredFloatingSize": {
31
+ "width": 360,
32
+ "height": 420
33
+ },
34
+ "icons": [
35
+ {
36
+ "width": 23,
37
+ "height": 23,
38
+ "path": "icons/panel.png",
39
+ "scale": [
40
+ 1,
41
+ 2
42
+ ],
43
+ "theme": [
44
+ "darkest",
45
+ "dark",
46
+ "medium",
47
+ "lightest",
48
+ "light",
49
+ "all"
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ ],
55
+ "requiredPermissions": {
56
+ "network": {
57
+ "domains": [
58
+ "ws://127.0.0.1",
59
+ "ws://localhost",
60
+ "ws://127.0.0.1:48127",
61
+ "ws://127.0.0.1:48128",
62
+ "ws://127.0.0.1:48129",
63
+ "ws://127.0.0.1:48130",
64
+ "ws://127.0.0.1:48131",
65
+ "ws://127.0.0.1:48132",
66
+ "ws://127.0.0.1:48133",
67
+ "ws://127.0.0.1:48134",
68
+ "ws://localhost:48127",
69
+ "ws://localhost:48128",
70
+ "ws://localhost:48129",
71
+ "ws://localhost:48130",
72
+ "ws://localhost:48131",
73
+ "ws://localhost:48132",
74
+ "ws://localhost:48133",
75
+ "ws://localhost:48134"
76
+ ]
77
+ },
78
+ "localFileSystem": "fullAccess"
79
+ },
80
+ "icons": [
81
+ {
82
+ "width": 48,
83
+ "height": 48,
84
+ "path": "icons/plugin.png",
85
+ "scale": [
86
+ 1,
87
+ 2
88
+ ],
89
+ "theme": [
90
+ "darkest",
91
+ "dark",
92
+ "medium",
93
+ "lightest",
94
+ "light",
95
+ "all"
96
+ ],
97
+ "species": [
98
+ "pluginList"
99
+ ]
100
+ }
101
+ ]
102
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __conformRequire } from 'node:module'; const require = __conformRequire(import.meta.url);
3
+ import{d as h}from"./chunk-TXQR2HI2.js";import{D as d,Y as o,b as p,g as n,i as a,l as u,r as s}from"./chunk-PLRB2YXJ.js";import"./chunk-PSANHDZM.js";import{dirname as m}from"node:path";import{fileURLToPath as P}from"node:url";import w from"node:process";var r="ColorMatchProbe.ofx.bundle",x="http://127.0.0.1:9876",i="/Library/OFX/Plugins";async function b(){let e=w.execPath;for(let t of[p("CONFORM_RESOLVE_PROBE"),o(m(e),"..","Resources","resolve-probe",r),o(m(P(import.meta.url)),"..","..","..","resolve_hook","build",r)])if(t&&await s(o(t,"Contents","MacOS","ColorMatchProbe.ofx")))return t;return null}async function E(){let e=n()==="darwin"&&a()==="arm64",t=await s(o(i,r)),l=await fetch(x+"/",{signal:AbortSignal.timeout(500)}).then(f=>f.ok).catch(()=>!1),c=!!await b();return{installed:t,loaded:l,shipped:c,supported:e,next:e?l?"running: the Color page selection and the selected node are read live":t?"installed; restart Resolve to load it":c?"host_setup host=resolve action=install_probe (asks for an administrator), then restart Resolve":"not in this build":"the probe runs on Apple silicon Macs only"}}async function S(){if(n()!=="darwin"||a()!=="arm64")throw new Error("the probe runs on Apple silicon Macs only");let e=await b();if(!e)throw new Error("this build does not carry the probe (resolve_hook/build.sh makes it)");return await h("darwin",e,i,r),await d(o(u(),"Library","Application Support","Blackmagic Design","DaVinci Resolve","OFXPluginCacheV2.xml")).catch(()=>{}),{path:o(i,r),restart_required:!0}}export{r as PROBE_BUNDLE,x as PROBE_URL,S as installProbe,E as probeStatus};