conformtools 0.6.4 → 0.6.5
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/package.json +1 -1
- package/dist/arriraw-3GKCR6K2.js +0 -525
- package/dist/browser/timeline_core_bg.wasm +0 -0
- package/dist/chunk-42QQI3WX.js +0 -3
- package/dist/chunk-6FVGUJ6L.js +0 -3
- package/dist/chunk-6TM32YIJ.js +0 -7
- package/dist/chunk-7D7H6VFW.js +0 -3
- package/dist/chunk-AACY2V3L.js +0 -3
- package/dist/chunk-BUEIRRNY.js +0 -3
- package/dist/chunk-BW2NQ54J.js +0 -3
- package/dist/chunk-C2ESM27Z.js +0 -3
- package/dist/chunk-CL26XMDO.js +0 -3
- package/dist/chunk-DKGGJM6Z.js +0 -3
- package/dist/chunk-DRHOPOC7.js +0 -3
- package/dist/chunk-EO5NIBOV.js +0 -3
- package/dist/chunk-EPZ6NWE4.js +0 -3
- package/dist/chunk-GXEVALBL.js +0 -3
- package/dist/chunk-HKP4P6JN.js +0 -3
- package/dist/chunk-JB7PR2TQ.js +0 -3
- package/dist/chunk-P7OVDUA5.js +0 -3
- package/dist/chunk-PSANHDZM.js +0 -3
- package/dist/chunk-QDWB7QU7.js +0 -3
- package/dist/chunk-QTKRMXL5.js +0 -363
- package/dist/chunk-QTPCU2TF.js +0 -3
- package/dist/chunk-SP5RGDAM.js +0 -3
- package/dist/chunk-TEZP6VEQ.js +0 -3
- package/dist/chunk-TK55FA56.js +0 -3
- package/dist/chunk-UCMNH6Q6.js +0 -3
- package/dist/chunk-WHY3DVXS.js +0 -3
- package/dist/chunk-WT6NIJCB.js +0 -3
- package/dist/chunk-Y2BEEOPB.js +0 -3
- package/dist/claude-setup-BM3AAUKR.js +0 -5
- package/dist/cli.js +0 -17
- package/dist/clip-state-B6JOX3JE.js +0 -3
- package/dist/conformtools-decode +0 -0
- package/dist/cr3-wasm-WKWMEK3V.js +0 -3
- package/dist/dng-wasm-Z5OVO4UI.js +0 -3
- package/dist/dpx-wasm-QNYXAOAJ.js +0 -3
- package/dist/esm-SFFBP7PS.js +0 -3
- package/dist/exr-wasm-BHSBJLQH.js +0 -3
- package/dist/h264-LIZVHN2W.js +0 -3
- package/dist/h264-mxf-MWS7DDV7.js +0 -3
- package/dist/http.js +0 -4
- package/dist/i2o-transfer +0 -0
- package/dist/inspect-DZF537QL.js +0 -46
- package/dist/isobmff-HM3UPWPZ.js +0 -3
- package/dist/mcp.js +0 -14
- package/dist/media_core-R5PPN3AY.js +0 -9
- package/dist/media_core_bg-FGAR5KA5.js +0 -3
- package/dist/media_core_bg-YK63OUDM.js +0 -3
- package/dist/mxf-K465SWBN.js +0 -3
- package/dist/onnxruntime-web-stub-PKJ2NZBF.js +0 -3
- package/dist/ops-73NR3X6R.js +0 -3
- package/dist/premiere-uxp/icons/panel.png +0 -0
- package/dist/premiere-uxp/icons/panel@2x.png +0 -0
- package/dist/premiere-uxp/icons/plugin.png +0 -0
- package/dist/premiere-uxp/icons/plugin@2x.png +0 -0
- package/dist/premiere-uxp/index.html +0 -38
- package/dist/premiere-uxp/index.js +0 -93
- package/dist/premiere-uxp/lib/clipmeta.js +0 -170
- package/dist/premiere-uxp/lib/ctx.js +0 -62
- package/dist/premiere-uxp/lib/handles.js +0 -57
- package/dist/premiere-uxp/lib/markers.js +0 -198
- package/dist/premiere-uxp/lib/pairing.js +0 -58
- package/dist/premiere-uxp/lib/premiere.js +0 -82
- package/dist/premiere-uxp/lib/probe.js +0 -139
- package/dist/premiere-uxp/lib/protocol.js +0 -165
- package/dist/premiere-uxp/lib/render.js +0 -38
- package/dist/premiere-uxp/lib/session.js +0 -85
- package/dist/premiere-uxp/lib/sizing.js +0 -312
- package/dist/premiere-uxp/lib/time.js +0 -82
- package/dist/premiere-uxp/lib/timeline.js +0 -336
- package/dist/premiere-uxp/lib/verbs.js +0 -20
- package/dist/premiere-uxp/lib/write.js +0 -97
- package/dist/premiere-uxp/manifest.json +0 -102
- package/dist/prores-L4JZZWGH.js +0 -526
- package/dist/r3d-RR3FUM6H.js +0 -3
- package/dist/r3d-VUOYU2KQ.js +0 -1025
- package/dist/resolve-bridge.py +0 -1037
- package/dist/resolve-presets/conform.tools.xml +0 -127
- package/dist/source-BDJAUQVR.js +0 -3
- package/dist/sscd-embed-DHFTEIOC.js +0 -3
- package/dist/sscd-sweep-OYS4XAID.js +0 -3
- package/dist/statusline-GMMCFMOA.js +0 -4
- package/dist/statusline.js +0 -3
- package/dist/still-4G25EYN5.js +0 -3
- package/dist/tiff-wasm-QJPCR7JT.js +0 -3
- package/dist/timeline_core-VK2ZWPCO.js +0 -3
- package/dist/timeline_core_bg-2TYWZ35G.js +0 -3
- package/dist/udf_bg-A4WEMSAX.js +0 -3
- package/dist/wasm/media_core_bg.wasm +0 -0
- package/dist/wasm/udf_bg.wasm +0 -0
- package/dist/wasm-threads/media_core_bg.wasm +0 -0
- package/dist/wav-63QF6SCT.js +0 -3
|
@@ -1,336 +0,0 @@
|
|
|
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
|
-
const ticks = T.toTicks(st);
|
|
75
|
-
if (ticks) return Math.round(ticks / (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 };
|
|
@@ -1,20 +0,0 @@
|
|
|
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
|
-
);
|
|
15
|
-
|
|
16
|
-
const CAPABILITIES = ["session", "timeline_read", "markers", "clip_meta", "sizing", "timeline_write", "render"];
|
|
17
|
-
const OPTIONAL_VERBS = ["timeline_read.set_current_frame", "markers.move", "markers.set_color", "markers.set_text", "clip_meta.set_clip_properties",
|
|
18
|
-
"timeline_write.import_file", "timeline_write.export_xml", "render.export_sequence", "debug.probe", "debug.sizing_probe"];
|
|
19
|
-
|
|
20
|
-
module.exports = { VERBS, CAPABILITIES, OPTIONAL_VERBS };
|
|
@@ -1,97 +0,0 @@
|
|
|
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(await P.callAny(editor, ["createInsertProjectItemAction"], item, tt, vIdx, 0, false));
|
|
60
|
-
else add(await P.callAny(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(await P.callAny(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 };
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"id": "com.conformtools.premiere",
|
|
3
|
-
"name": "conform.tools",
|
|
4
|
-
"version": "0.2.0",
|
|
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
|
-
}
|