Static files are now compiled into the binary using //go:embed.
- Add web/embed.go with //go:embed static directive
- Update server.New() to accept fs.FS parameter
- Switch file server from http.Dir to http.FS
Deployment is now: roadamp.exe + config.yaml + winamp/
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- viz/capture.go: waveFormatExtensibleEx now flat struct (not embedded)
Go pads waveFormatEx to 20 bytes (uint32 alignment), but the Windows
C struct is 18 bytes — embedding caused SubFormat to land at wrong
offset, breaking float32 detection (float=false bug)
- server.go: clamp position/length values > 24h to 0
Winamp returns 0xFFFFFFFF for these fields when stopped/no track loaded
- .gitignore: exclude winamp/ dir and runtime .dat files
- config.yaml: added (gitignored) pointing to winamp/winamp.exe
Tested: Winamp 5.9 portable in winamp/, IPC connection verified,
viz loopback correctly detects 48kHz float32 stereo
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WebSocket (/ws):
- Replaces 2s HTTP polling with persistent WS connection
- Server pushes status updates every 500ms to all clients
- Server pushes FFT spectrum frames at ~30fps
- Bidirectional: client sends commands as JSON ({cmd, delta, level, ...})
- Auto-reconnect on disconnect (3s backoff)
- Status pushed immediately on connect
Visualisation (internal/viz/capture.go):
- WASAPI loopback capture via IAudioClient (same COM approach as volume)
- Captures whatever is playing through the default render device
- 2048-sample Hanning-windowed FFT (pure Go, no deps)
- 64 log-spaced bars, 40Hz-20kHz
- Fast attack / slow decay smoothing per bar
Canvas renderer (app.js):
- requestAnimationFrame loop, DPR-aware resize
- Green->yellow->red HSL gradient by amplitude
- Peak-hold indicators with 1.2%/frame decay
- Graceful: canvas stays dark if no viz data (Winamp paused/stopped)
Architecture:
- internal/server/hub.go: gorilla/websocket hub (register/broadcast/unregister)
- internal/server/server.go: full //go:build windows, REST API kept for debug
- frontend uses WS for all commands, REST only for killist list fetch
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- internal/volume: IAudioEndpointVolume via COM (pure Go, no CGO)
- Get/Set master volume (0-100%)
- GetMute/SetMute
- Uses WASAPI instead of deprecated MMSystem mixer API
- server: /api/volume now uses system volume (0-100, was Winamp 0-255)
- server: new /api/mute endpoint (GET + POST ?muted=true|false)
- server: volume+mute included in /api/status response
- frontend: mute button with visual state (🔊/🔇, red bar when muted)
- frontend: volume display as percentage label
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>