Commit Graph

2 Commits

Author SHA1 Message Date
Glenn Thompson b54af08eeb Fix frameset mode persistent audio and spectrum analyzer
Frameset mode now works correctly with:
- Persistent audio across all navigation via AJAX
- Spectrum analyzer MUTED indicator working
- Now Playing panel updates (200ms delay)
- Interval cleanup before navigation
- Cache-control headers for player.js

Fixed issues:
- Replace all == operators with equal in player.lisp
- Add defvar instead of let in redirect-when-frame
- Add interval/timeout cleanup before AJAX navigation
- Fix spectrum analyzer re-initialization after navigation
- Add cache-busting headers for JavaScript

Known issue:
- Non-frameset mode has ParenScript compilation issue
- Only 15/36 functions compile due to parenthesis imbalance
- Frameset mode is the recommended interface for persistent audio

Files modified:
- asteroid.lisp: Add cache-control headers
- parenscript/player.lisp: Fix == operators, fix redirect-when-frame
- template/*-content.ctml: Add AJAX navigation and interval cleanup
- template/status-content.ctml: Created placeholder
- parenscript/spectrum-analyzer.lisp: Fix re-initialization
2025-12-07 09:40:25 +03:00
Glenn Thompson b6be0ebab1 feat: Convert JavaScript to Parenscript with stream fixes and UX improvements
Major Changes:
- Convert all JavaScript files to Parenscript for better maintainability
- Move spectrum-analyzer to parenscript/ directory structure
- Add parenscript-utils.lisp for shared utilities
- Convert admin.js, player.js, front-page.js, auth-ui.js to Parenscript
- Convert profile.js, users.js, recently-played.js to Parenscript

Stream Reconnect Fixes (from merged PR):
- Add reset-spectrum-analyzer function to properly clean up Web Audio API
- Implement reconnect logic for pauses longer than 10 seconds
- Detect stale audio in 'playing' event and force stream reconnection
- Prevent 'Now Playing' updates while stream is paused
- Reduce reconnect delay to 200ms for faster response
- Add proper spectrum analyzer reset/reinit during reconnection

UX Improvements:
- Change live indicator from blink to smooth pulse (2s ease-in-out)
- Pulse animation like old PowerBook/MacBook sleep indicator
- Add MUTED indicator to spectrum analyzer when audio is muted
- Spectrum continues to flow even when muted (data still streaming)
- Red 'MUTED' text displayed in top-right corner of canvas

Technical Details:
- Parenscript files generate JavaScript via API endpoints
- All player modes updated: main player, front page, popout, frame player
- Improved audio context handling to only create once per element
- Added comprehensive error handling and logging
- Updated asteroid.asd to include parenscript module structure

Documentation:
- Updated all documentation dates to 2025-12-06
- Added PARENSCRIPT-EXPERIMENT.org documenting the conversion
- Updated PROJECT-HISTORY.org with Phase 9 (Visual Audio Features)
- Added comprehensive project statistics (408 commits, 9,300 LOC)

This conversion improves code maintainability by using Lisp throughout
the stack and makes it easier to share code between frontend and backend.
2025-12-06 11:55:24 -05:00