Skip to content

Commit d6ea0f3

Browse files
committed
feat: disable tc generation
1 parent 921063c commit d6ea0f3

1 file changed

Lines changed: 92 additions & 13 deletions

File tree

src/routes/+page.svelte

Lines changed: 92 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
let sequenceNumber = 101;
88
let driveNumber = 2;
99
let prefix = "1";
10+
let exportMode: "cues-and-timecode" | "cues-only" = "cues-and-timecode";
1011
let isDragOver = false;
1112
let isProcessing = false;
1213
let processingStatus = "";
@@ -126,8 +127,10 @@
126127
const xmlContent = generateMacroXML({ repeatedSequences, uniqueSequences, filename });
127128
downloadContentWithName(xmlContent, `${filename}_macro.xml`);
128129
129-
const timecodeContent = generateTimecodeXML({ repeatedSequences, uniqueSequences, filename });
130-
downloadContentWithName(timecodeContent, `${filename}_timecode.xml`);
130+
if (exportMode === "cues-and-timecode") {
131+
const timecodeContent = generateTimecodeXML({ repeatedSequences, uniqueSequences, filename });
132+
downloadContentWithName(timecodeContent, `${filename}_timecode.xml`);
133+
}
131134
132135
processingStatus = "✅ Files generated successfully!";
133136
setTimeout(() => {
@@ -237,15 +240,19 @@
237240
},
238241
];
239242
}),
240-
/// Timecode Import
241-
{
242-
"@_Command": `Drive ${driveNumber}`,
243-
"@_Wait": "0.10",
244-
},
245-
{
246-
"@_Command": `import Timecode "${filename}_timecode"`,
247-
"@_Wait": "0.10",
248-
},
243+
/// Timecode Import (only if exportMode is cues-and-timecode)
244+
...(exportMode === "cues-and-timecode"
245+
? [
246+
{
247+
"@_Command": `Drive ${driveNumber}`,
248+
"@_Wait": "0.10",
249+
},
250+
{
251+
"@_Command": `import Timecode "${filename}_timecode"`,
252+
"@_Wait": "0.10",
253+
},
254+
]
255+
: []),
249256
],
250257
},
251258
},
@@ -450,12 +457,28 @@
450457
<input id="prefix" type="text" bind:value={prefix} class="input" />
451458
</div>
452459

453-
<div class="input-group">
460+
<div class="input-group" class:disabled={exportMode === "cues-only"}>
454461
<label for="drive-number" class="label">
455462
<span class="label-text">Drive Number</span>
456463
<span class="label-hint">Drive to use for import (1-8)</span>
457464
</label>
458-
<input id="drive-number" type="number" min="1" max="8" step="1" bind:value={driveNumber} class="input" />
465+
<input id="drive-number" type="number" min="1" max="8" step="1" bind:value={driveNumber} class="input" disabled={exportMode === "cues-only"} />
466+
</div>
467+
</div>
468+
469+
<div class="export-mode-section">
470+
<div class="label">
471+
<span class="label-text">Export Mode</span>
472+
</div>
473+
<div class="radio-group">
474+
<label class="radio-label">
475+
<input type="radio" bind:group={exportMode} value="cues-and-timecode" class="radio-input" />
476+
<span class="radio-text">Cues & Timecode</span>
477+
</label>
478+
<label class="radio-label">
479+
<input type="radio" bind:group={exportMode} value="cues-only" class="radio-input" />
480+
<span class="radio-text">Cues Only</span>
481+
</label>
459482
</div>
460483
</div>
461484
</div>
@@ -773,6 +796,53 @@
773796
flex-shrink: 0;
774797
}
775798
799+
.export-mode-section {
800+
margin-top: 1.5rem;
801+
}
802+
803+
.radio-group {
804+
display: grid;
805+
grid-template-columns: repeat(2, 1fr);
806+
gap: 1rem;
807+
margin-top: 0.75rem;
808+
}
809+
810+
.radio-label {
811+
display: flex;
812+
align-items: center;
813+
gap: 0.5rem;
814+
padding: 0.75rem 1rem;
815+
border: 2px solid var(--border-light);
816+
border-radius: 8px;
817+
cursor: pointer;
818+
transition: all 0.2s ease;
819+
background: var(--upload-bg);
820+
}
821+
822+
.radio-label:hover {
823+
border-color: var(--accent-blue);
824+
background: var(--upload-hover);
825+
}
826+
827+
.radio-input {
828+
width: 18px;
829+
height: 18px;
830+
cursor: pointer;
831+
accent-color: var(--accent-blue);
832+
}
833+
834+
.radio-text {
835+
color: var(--text-primary);
836+
font-size: 0.95rem;
837+
font-weight: 500;
838+
}
839+
840+
.radio-label:has(.radio-input:checked) {
841+
border-color: var(--accent-blue);
842+
background: var(--upload-hover);
843+
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
844+
}
845+
776846
.settings-grid {
777847
display: grid;
778848
grid-template-columns: repeat(3, minmax(0, 1fr));
@@ -784,6 +854,11 @@
784854
flex-direction: column;
785855
}
786856
857+
.input-group.disabled {
858+
opacity: 0.5;
859+
pointer-events: none;
860+
}
861+
787862
.label {
788863
margin-bottom: 0.5rem;
789864
display: block;
@@ -908,6 +983,10 @@
908983
padding: 1.5rem;
909984
}
910985
986+
.radio-group {
987+
grid-template-columns: 1fr;
988+
}
989+
911990
.settings-grid {
912991
grid-template-columns: 1fr;
913992
gap: 1.5rem;

0 commit comments

Comments
 (0)