diff --git a/README.md b/README.md index e6e906a..c75946f 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,6 @@ # Deckster ## To do -- Make the CLI of handlers more useful - Make the `playerctl` handler independent of… playerctl. Use the [`mpris` crate](https://lib.rs/crates/mpris) directly instead. - Implement scrolling - Move loupedeck_serial and pa_volume_interface out of this repository. diff --git a/handlers/pa_volume/src/main.rs b/handlers/pa_volume/src/main.rs index 0185686..bee9a25 100644 --- a/handlers/pa_volume/src/main.rs +++ b/handlers/pa_volume/src/main.rs @@ -1,5 +1,9 @@ use clap::Parser; use color_eyre::Result; +use pa_volume_interface::PaVolumeInterface; +use std::sync::Arc; +use std::thread::sleep; +use std::time::Duration; use crate::handler::Handler; @@ -19,7 +23,7 @@ fn main() -> Result<()> { let command = CliCommand::parse(); match command { - CliCommand::Entities => todo!(), + CliCommand::Entities => print_entities(), CliCommand::Run => { deckster_mode::run(Handler::new)?; } @@ -27,3 +31,15 @@ fn main() -> Result<()> { Ok(()) } + +fn print_entities() { + let pa_volume_interface = Arc::new(PaVolumeInterface::spawn_thread("deckster handler".to_owned())); + sleep(Duration::from_secs(1)); // wait for the data to load + + let full_state = pa_volume_interface.current_state(); + let entities_by_id = full_state.entities_by_id(); + + for (id, state) in entities_by_id { + println!("{id}: {:#?}\n", state.metadata()); + } +}