$ show ebruck/radiotray-ng
Radiotray-NG is an internet radio player for Linux that runs in the system tray. It allows users to select and play configured radio stations, displays stream metadata, shows notifications, and provides control via system tray menu, media keys, or DBus. The application features a modular architecture with separate components for bookmarks management, configuration, event handling, playback (using GStreamer), playlist format handling, notifications, and GUI (with AppIndicator or ncurses fallback). It includes a bookmark editor GUI and supports sleep timer functionality.
The LLM identified 5 files worth highlighting for reuse:
Provides string manipulation utilities (trim, word_expand, word_wrap, basename) and XDG directory helpers. These are isolated, reusable functions that could be extracted to a utility library with minimal changes. The word_expand function handles environment variable expansion safely, and word_wrap implements proper text wrapping logic.
Implements a file change monitor using inotify on Linux. It's self-contained, handles edge cases (file deletion, moves), and could be reused in any project needing file monitoring with minimal modification. Properly cleans up resources and handles errors.
A lightweight event bus implementation with support for first/last/default position subscribers. It's completely isolated, uses std::function for callbacks, and could be dropped into any C++ project. The implementation is clean and handles subscription lifecycle properly.
Handles downloading and detecting playlist formats (M3U, PLS, ASX, etc.) and direct streams. It uses a strategy pattern with decoder plugins. While it depends on some internal types, the core logic for detecting direct streams and trying multiple decoders is reusable. The curl_write_callback shows good handling of size limits.
Abstracts notification functionality with platform-specific implementations (Linux via libnotify, Darwin via terminal-notifier). The interface is clean and the implementations are isolated. This pattern could be reused for any cross-platform notification need.