Added comprehensive audio editing capabilities: - Region selection with Shift+drag on waveform - Visual selection feedback with blue overlay and borders - AudioBuffer manipulation utilities (cut, copy, paste, delete, trim) - EditControls UI component with edit buttons - Keyboard shortcuts (Ctrl+A, Ctrl+X, Ctrl+C, Ctrl+V, Delete, Escape) - Clipboard management for cut/copy/paste operations - Updated useAudioPlayer hook with loadBuffer method New files: - types/selection.ts - Selection and ClipboardData interfaces - lib/audio/buffer-utils.ts - AudioBuffer manipulation utilities - components/editor/EditControls.tsx - Edit controls UI Modified files: - components/editor/Waveform.tsx - Added selection support - components/editor/AudioEditor.tsx - Integrated edit operations - lib/hooks/useAudioPlayer.ts - Added loadBuffer method 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
24 lines
324 B
TypeScript
24 lines
324 B
TypeScript
/**
|
|
* Selection and region types
|
|
*/
|
|
|
|
export interface Selection {
|
|
start: number;
|
|
end: number;
|
|
}
|
|
|
|
export interface Region {
|
|
id: string;
|
|
start: number;
|
|
end: number;
|
|
label?: string;
|
|
color?: string;
|
|
}
|
|
|
|
export interface ClipboardData {
|
|
buffer: AudioBuffer;
|
|
start: number;
|
|
end: number;
|
|
duration: number;
|
|
}
|