Add Ableton Live version selection and validation for export options
This commit is contained in:
@@ -18,7 +18,7 @@ import { getCustomSceneNames } from './useSceneName';
|
|||||||
|
|
||||||
export const EXPORT_FORMATS: ExportFormat[] = [
|
export const EXPORT_FORMATS: ExportFormat[] = [
|
||||||
{
|
{
|
||||||
name: 'Ableton 11+',
|
name: 'Ableton Live',
|
||||||
value: 'ableton',
|
value: 'ableton',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useMemo } from 'preact/hooks';
|
|||||||
import { useFormContext, useWatch } from 'react-hook-form';
|
import { useFormContext, useWatch } from 'react-hook-form';
|
||||||
import { projectIdAtom } from '~/atoms/project';
|
import { projectIdAtom } from '~/atoms/project';
|
||||||
import CheckboxField from '~/components/form/CheckboxField';
|
import CheckboxField from '~/components/form/CheckboxField';
|
||||||
|
import SelectField from '~/components/form/SelectField';
|
||||||
import useProject from '~/hooks/useProject';
|
import useProject from '~/hooks/useProject';
|
||||||
import { hasMultipleNoteVariations } from '~/lib/utils';
|
import { hasMultipleNoteVariations } from '~/lib/utils';
|
||||||
import { ExportFormValues } from './exportFormSchema';
|
import { ExportFormValues } from './exportFormSchema';
|
||||||
@@ -89,6 +90,13 @@ function ExportOptions({ disabled = false }: { disabled?: boolean }) {
|
|||||||
|
|
||||||
{format === 'ableton' && (
|
{format === 'ableton' && (
|
||||||
<>
|
<>
|
||||||
|
<label className="flex flex-col gap-1 mb-2">
|
||||||
|
<span className="text-sm">Ableton Live version</span>
|
||||||
|
<SelectField name="abletonVersion" disabled={disabled} className="mr-auto">
|
||||||
|
<option value="10">Live 10</option>
|
||||||
|
<option value="11">Live 11+</option>
|
||||||
|
</SelectField>
|
||||||
|
</label>
|
||||||
<CheckboxField
|
<CheckboxField
|
||||||
name="includeArchivedSamples"
|
name="includeArchivedSamples"
|
||||||
title="Include samples"
|
title="Include samples"
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ function ExportProjectDialog({
|
|||||||
resolver: zodResolver(exportFormSchema),
|
resolver: zodResolver(exportFormSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
format: EXPORT_FORMATS[0].value,
|
format: EXPORT_FORMATS[0].value,
|
||||||
|
abletonVersion: '10',
|
||||||
projectName: `Project${projectId}`,
|
projectName: `Project${projectId}`,
|
||||||
includeArchivedSamples: true,
|
includeArchivedSamples: true,
|
||||||
exportAllPadsWithSamples: false,
|
exportAllPadsWithSamples: false,
|
||||||
@@ -122,24 +123,6 @@ function ExportProjectDialog({
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!result && !percentage && (
|
|
||||||
<a
|
|
||||||
href="https://eptoolkit.ep133-to-daw.cc/"
|
|
||||||
target="_blank"
|
|
||||||
rel="noopener noreferrer"
|
|
||||||
className="bg-creme w-full bg-grid border border-black gap-2 p-2 text-black flex mt-4 justify-center items-center"
|
|
||||||
>
|
|
||||||
<p>
|
|
||||||
Want fader automation support? Get <strong>EP Toolkit</strong>: desktop app for
|
|
||||||
exporting, sample management, backups and more.{' '}
|
|
||||||
</p>
|
|
||||||
<img
|
|
||||||
src="/eptoolkit/eptoolkit-logo.png"
|
|
||||||
alt="EP Toolkit"
|
|
||||||
className="size-10 shrink-0 ml-auto"
|
|
||||||
/>
|
|
||||||
</a>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="mt-4 min-h-13.5">
|
<div className="mt-4 min-h-13.5">
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ const FORMAT_IDS: [ExportFormatId, ...ExportFormatId[]] = [
|
|||||||
|
|
||||||
export const exportFormSchema = z.object({
|
export const exportFormSchema = z.object({
|
||||||
format: z.enum(FORMAT_IDS),
|
format: z.enum(FORMAT_IDS),
|
||||||
|
abletonVersion: z.enum(['10', '11']),
|
||||||
projectName: z.string(),
|
projectName: z.string(),
|
||||||
includeArchivedSamples: z.boolean(),
|
includeArchivedSamples: z.boolean(),
|
||||||
exportAllPadsWithSamples: z.boolean(),
|
exportAllPadsWithSamples: z.boolean(),
|
||||||
@@ -28,6 +29,7 @@ export type ExportFormValues = z.infer<typeof exportFormSchema>;
|
|||||||
|
|
||||||
export const PERSISTED_FIELDS: (keyof ExportFormValues)[] = [
|
export const PERSISTED_FIELDS: (keyof ExportFormValues)[] = [
|
||||||
'format',
|
'format',
|
||||||
|
'abletonVersion',
|
||||||
'includeArchivedSamples',
|
'includeArchivedSamples',
|
||||||
'exportAllPadsWithSamples',
|
'exportAllPadsWithSamples',
|
||||||
'clips',
|
'clips',
|
||||||
|
|||||||
@@ -216,6 +216,7 @@ export type ExportFormat = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type ExporterParams = {
|
export type ExporterParams = {
|
||||||
|
abletonVersion?: '10' | '11';
|
||||||
projectName?: string; // custom project name for exported files
|
projectName?: string; // custom project name for exported files
|
||||||
includeArchivedSamples?: boolean;
|
includeArchivedSamples?: boolean;
|
||||||
exportAllPadsWithSamples?: boolean; // export all pads with assigned samples even if not used
|
exportAllPadsWithSamples?: boolean; // export all pads with assigned samples even if not used
|
||||||
|
|||||||
Reference in New Issue
Block a user