feat: implement audio file splitting functionality

- Added `splitFile` method to `LibraryStore` for splitting audio files into segments.
- Introduced `SplitSegmentRequest` and `SegmentMetadataInput` interfaces in models for segment metadata handling.
- Created `EditModePanel` component for editing segments, including waveform visualization and metadata assignment.
- Developed `WaveformEditorCanvas` for interactive waveform editing, supporting segment creation and resizing.
- Enhanced metadata handling in IPC with new fields for author and copyright.
- Updated styles for new components and improved UI interactions.
This commit is contained in:
2025-11-11 02:45:34 +11:00
parent bb7d31e748
commit 781187c427
14 changed files with 1286 additions and 118 deletions

View File

@@ -107,3 +107,33 @@ export interface AudioBufferPayload {
/** MIME type for the audio data. */
mimeType: string;
}
/**
* Optional metadata overrides applied while creating split segments.
*/
export interface SegmentMetadataInput {
/** Overrides the custom name embedded into the segment (null clears it). */
customName?: string | null;
/** Overrides the author/creator metadata. */
author?: string | null;
/** Overrides the rating metadata (1-5). */
rating?: number;
/** Overrides the applied free-form tags. */
tags?: string[];
/** Overrides the applied UCS categories. */
categories?: string[];
}
/**
* Describes a region that should be extracted as a new audio segment.
*/
export interface SplitSegmentRequest {
/** Inclusive start offset in milliseconds. */
startMs: number;
/** Exclusive end offset in milliseconds. */
endMs: number;
/** Optional display label used for segment naming. */
label?: string;
/** Metadata overrides to apply to the generated file. */
metadata?: SegmentMetadataInput;
}