$ show vzhd1701/gridplayer
GridPlayer is a desktop application that plays multiple video streams simultaneously in a configurable grid layout. Built with PyQt5 and backed by VLC (libvlc), it provides per-video controls (play/pause, seek, speed, zoom, crop, loop, transformation), full playlist management with snapshots, and support for streaming via yt-dlp and Streamlink. The architecture uses a modular Manager pattern (ManagersManager, ManagerBase) where each subsystem (menu, grid, settings, video drivers, drag-and-drop, etc.) is a QObject-based manager registered with a shared Context/Commands dispatcher. Video playback can run in separate processes via multiprocessing with shared memory for hardware-accelerated decoding. The application is cross-platform (Windows, macOS, Linux) with packaging for PyPI, AppImage, Flatpak, Snap, and Chocolatey. Internationalization is handled via Crowdin with 18 translation files. Entry point is gridplayer/__main__.py which initializes the application, VLC instance, and main Player widget. The codebase demonstrates solid software engineering practices with extensive test coverage for core components like grid layout, drag-and-drop, settings, and keymap management. However, it carries significant technical debt from heavy reliance on VLC 3.0.x, PyQt5 (no migration to Qt6), and complex cross-platform workarounds for Wayland, X11 overlay, and hardware decoder multiprocessing.
The LLM identified 5 files worth highlighting for reuse:
Pure Python grid layout algorithm that handles packing, resizing, drop-on-edge (4 directions), place-in-empties, shuffle, swap, and compact edges. Designed with no Qt dependency, making it testable independently. Thoroughly tested with 30+ test cases. Can be extracted for any application needing custom grid arrangement logic.
Normalizes keyboard and mouse shortcuts, supports mouse chords (clicks, wheel, double), deduplication, and sparse overrides for user settings. Includes merge_keymap and build_conflict_map. Reusable for any application requiring complex shortcut management.
RAII wrapper for multiprocessing.shared_memory with automatic cleanup, retry on close, and optional lock. Handles edge cases like resource unlink errors. Demonstrates robust shared memory management pattern for inter-process data transfer.
Cross-platform dark mode detection: macOS via NSUserDefaults, Windows via registry, Linux via D-Bus portal and GTK environment variables. Provides a clean abstraction that can be reused in any Qt application for theme adaptation.
Configurable URL resolver chain that tries resolvers (Streamlink, yt-dlp, direct) in priority order based on pattern matching (host wildcard, URL wildcard, regex). Returns resolved media URIs. The pattern is reusable for any application needing modular URL resolution with fallback.