feat: implement Ableton Live-style DAW layout

Major UX refactor to match professional DAW workflows (Ableton/Bitwig):

**Layout Changes:**
- Removed sidebar completely
- Track actions moved to header toolbar (Add/Import/Clear All)
- Each track now shows its own devices/effects in the track strip
- Master section moved to bottom footer area
- Full-width waveform display

**Track Strip (left panel):**
- Track name (editable inline)
- Color indicator
- Collapse/Solo/Mute/Delete buttons
- Volume slider with percentage
- Pan slider with L/C/R indicator
- Collapsible "Devices" section showing track effects
  - Shows effect count in header
  - Each effect card shows: name, enable/disable toggle, remove button
  - Effects are colored based on enabled/disabled state
  - Click to expand/collapse devices section

**Master Section (bottom):**
- Transport controls (Play/Pause/Stop) with timeline
- Master volume control
- Master effects placeholder (to be implemented)

**Benefits:**
- True DAW experience like Ableton Live
- Each track is self-contained with its own effect chain
- No context switching between tabs
- Effects are always visible for each track
- More screen space for waveforms
- Professional mixer-style layout

Note: Effects are visible but not yet applied to audio - that's next!

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-18 07:46:27 +01:00
parent a8f2391400
commit f3f5b65e1e
3 changed files with 134 additions and 48 deletions

View File

@@ -23,6 +23,8 @@ export interface TrackProps {
onNameChange: (name: string) => void;
onSeek?: (time: number) => void;
onLoadAudio?: (buffer: AudioBuffer) => void;
onToggleEffect?: (effectId: string) => void;
onRemoveEffect?: (effectId: string) => void;
}
export function Track({
@@ -41,12 +43,15 @@ export function Track({
onNameChange,
onSeek,
onLoadAudio,
onToggleEffect,
onRemoveEffect,
}: TrackProps) {
const canvasRef = React.useRef<HTMLCanvasElement>(null);
const containerRef = React.useRef<HTMLDivElement>(null);
const fileInputRef = React.useRef<HTMLInputElement>(null);
const [isEditingName, setIsEditingName] = React.useState(false);
const [nameInput, setNameInput] = React.useState(String(track.name || 'Untitled Track'));
const [showDevices, setShowDevices] = React.useState(true);
const inputRef = React.useRef<HTMLInputElement>(null);
const handleNameClick = () => {
@@ -378,6 +383,61 @@ export function Track({
: `R${Math.round(track.pan * 100)}`}
</span>
</div>
{/* Devices/Effects Section */}
<div className="pt-2 border-t border-border">
<button
onClick={() => setShowDevices(!showDevices)}
className="flex items-center justify-between w-full text-xs font-medium text-foreground hover:text-primary transition-colors mb-2"
>
<span>Devices ({track.effectChain.effects.length})</span>
{showDevices ? (
<ChevronDown className="h-3.5 w-3.5" />
) : (
<ChevronRight className="h-3.5 w-3.5" />
)}
</button>
{showDevices && (
<div className="space-y-1">
{track.effectChain.effects.length === 0 ? (
<div className="text-xs text-muted-foreground text-center py-2">
No devices
</div>
) : (
track.effectChain.effects.map((effect) => (
<div
key={effect.id}
className={cn(
'flex items-center justify-between px-2 py-1.5 rounded text-xs',
effect.enabled
? 'bg-accent/50 text-foreground'
: 'bg-muted/50 text-muted-foreground'
)}
>
<span className="truncate">{effect.name}</span>
<div className="flex items-center gap-1">
<button
onClick={() => onToggleEffect?.(effect.id)}
className="hover:text-primary"
title={effect.enabled ? 'Disable' : 'Enable'}
>
{effect.enabled ? '●' : '○'}
</button>
<button
onClick={() => onRemoveEffect?.(effect.id)}
className="hover:text-destructive"
title="Remove"
>
×
</button>
</div>
</div>
))
)}
</div>
)}
</div>
</>
)}
</div>