pub struct CommandProcessor { /* private fields */ }Expand description
Processes commands from the control channel and broadcasts state updates.
Accepts a shared Arc<Player> so that the TUI can also read from the
same player instance for rendering.
Implementations§
Source§impl CommandProcessor
impl CommandProcessor
Sourcepub fn new(
player: Arc<Player>,
settings: ProcessorSettings,
start_path: PathBuf,
browse: bool,
command_rx: Receiver<AppCommand>,
broadcast_tx: Sender<StateUpdate>,
) -> Self
pub fn new( player: Arc<Player>, settings: ProcessorSettings, start_path: PathBuf, browse: bool, command_rx: Receiver<AppCommand>, broadcast_tx: Sender<StateUpdate>, ) -> Self
Creates a new command processor with a shared player.
@param player - Shared player instance (also held by the TUI) @param settings - Application settings @param start_path - Starting directory for the file browser @param browse - Whether to start in browse mode @param command_rx - Receiver for commands from frontends @param broadcast_tx - Sender for broadcasting state updates
Sourcepub fn cover_art_path(&self) -> Arc<Mutex<Option<PathBuf>>>
pub fn cover_art_path(&self) -> Arc<Mutex<Option<PathBuf>>>
Returns a cloneable reference to the shared cover art path.
Used by the web server to serve album art via /api/cover.
Sourcepub async fn run(&mut self)
pub async fn run(&mut self)
Runs the command processing loop.
Blocks until the channel is closed or a Quit command is received.
Sourcepub fn settings(&self) -> &ProcessorSettings
pub fn settings(&self) -> &ProcessorSettings
Gets a reference to the current settings.