diff --git a/src/core_api.rs b/src/core_api.rs index e45dbd4..69e8686 100644 --- a/src/core_api.rs +++ b/src/core_api.rs @@ -41,7 +41,7 @@ pub enum MpvCommand { to: usize, }, Observe { - id: isize, + id: usize, property: String, }, PlaylistNext, @@ -59,7 +59,7 @@ pub enum MpvCommand { option: SeekOptions, }, Stop, - Unobserve(isize), + Unobserve(usize), } /// Helper trait to keep track of the string literals that mpv expects. diff --git a/src/highlevel_api_extension.rs b/src/highlevel_api_extension.rs index d6df375..61056b7 100644 --- a/src/highlevel_api_extension.rs +++ b/src/highlevel_api_extension.rs @@ -68,8 +68,8 @@ pub trait MpvExt { async fn restart(&self) -> Result<(), MpvError>; async fn prev(&self) -> Result<(), MpvError>; async fn pause(&self) -> Result<(), MpvError>; - async fn unobserve_property(&self, id: isize) -> Result<(), MpvError>; - async fn observe_property(&self, id: isize, property: &str) -> Result<(), MpvError>; + async fn unobserve_property(&self, id: usize) -> Result<(), MpvError>; + async fn observe_property(&self, id: usize, property: &str) -> Result<(), MpvError>; async fn next(&self) -> Result<(), MpvError>; async fn kill(&self) -> Result<(), MpvError>; async fn get_playlist(&self) -> Result; @@ -95,7 +95,7 @@ impl MpvExt for Mpv { self.run_command(MpvCommand::PlaylistNext).await } - async fn observe_property(&self, id: isize, property: &str) -> Result<(), MpvError> { + async fn observe_property(&self, id: usize, property: &str) -> Result<(), MpvError> { self.run_command(MpvCommand::Observe { id, property: property.to_string(), @@ -103,7 +103,7 @@ impl MpvExt for Mpv { .await } - async fn unobserve_property(&self, id: isize) -> Result<(), MpvError> { + async fn unobserve_property(&self, id: usize) -> Result<(), MpvError> { self.run_command(MpvCommand::Unobserve(id)).await } diff --git a/src/ipc.rs b/src/ipc.rs index e269c7f..8531639 100644 --- a/src/ipc.rs +++ b/src/ipc.rs @@ -24,8 +24,8 @@ pub(crate) enum MpvIpcCommand { Command(Vec), GetProperty(String), SetProperty(String, Value), - ObserveProperty(isize, String), - UnobserveProperty(isize), + ObserveProperty(usize, String), + UnobserveProperty(usize), Exit, } @@ -114,7 +114,7 @@ impl MpvIpc { pub(crate) async fn observe_property( &mut self, - id: isize, + id: usize, property: &str, ) -> Result, MpvError> { self.send_command(&[json!("observe_property"), json!(id), json!(property)]) @@ -123,7 +123,7 @@ impl MpvIpc { pub(crate) async fn unobserve_property( &mut self, - id: isize, + id: usize, ) -> Result, MpvError> { self.send_command(&[json!("unobserve_property"), json!(id)]) .await