mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-04-28 06:21:23 +00:00
feat: get daemon's version using pwsp-cli
pwsp-cli get daemon-version
This commit is contained in:
+10
-1
@@ -82,6 +82,8 @@ pub struct ToggleLoopCommand {
|
||||
pub id: Option<u32>,
|
||||
}
|
||||
|
||||
pub struct GetDaemonVersionCommand {}
|
||||
|
||||
pub struct GetFullStateCommand {}
|
||||
|
||||
#[async_trait]
|
||||
@@ -347,6 +349,13 @@ impl Executable for ToggleLoopCommand {
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Executable for GetDaemonVersionCommand {
|
||||
async fn execute(&self) -> Response {
|
||||
Response::new(true, env!("CARGO_PKG_VERSION"))
|
||||
}
|
||||
}
|
||||
|
||||
#[async_trait]
|
||||
impl Executable for GetFullStateCommand {
|
||||
async fn execute(&self) -> Response {
|
||||
@@ -374,7 +383,7 @@ impl Executable for GetFullStateCommand {
|
||||
tracks: audio_player.get_tracks(),
|
||||
volume: audio_player.volume,
|
||||
current_input: current_input_nick,
|
||||
all_inputs,
|
||||
all_inputs: all_inputs,
|
||||
};
|
||||
|
||||
Response::new(true, serde_json::to_string(&full_state).unwrap())
|
||||
|
||||
@@ -156,6 +156,10 @@ impl Request {
|
||||
Request::new("toggle_loop", args)
|
||||
}
|
||||
|
||||
pub fn get_daemon_version() -> Self {
|
||||
Request::new("get_daemon_version", vec![])
|
||||
}
|
||||
|
||||
pub fn get_full_state() -> Self {
|
||||
Request::new("get_full_state", vec![])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user