diff --git a/Cargo.lock b/Cargo.lock index c2c1c29..07d04cb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -217,7 +217,6 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" name = "audrey" version = "0.1.0" dependencies = [ - "async-broadcast", "async-channel", "base16ct", "bindgen", diff --git a/Cargo.toml b/Cargo.toml index fd6e52e..2ce638b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ edition = "2021" [dependencies] adw = { version = "0.7.0", package = "libadwaita", features = ["v1_6"] } -async-broadcast = "0.7.1" async-channel = "2.3.1" base16ct = { version = "0.2.0", features = ["std"] } chrono = { version = "0.4.38", features = ["serde"] } diff --git a/src/event.rs b/src/event.rs deleted file mode 100644 index 61c1dc4..0000000 --- a/src/event.rs +++ /dev/null @@ -1,29 +0,0 @@ -#[derive(Clone, Debug)] -pub enum Event { - PlaybinVolumeChanged, - PlaybinMutedChanged, - PlaybinPausedChanged, - PlaybinCurrentEntryChanged, - - PlaybinEntryInserted(usize), - PlaybinStopped, - PlaybinEntryRemoved(usize), - - PlaybinFileStarted, -} - -use adw::prelude::*; -use gtk::glib; - -pub fn spawn_object_listener>( - mut receiver: async_broadcast::Receiver, - obj: &O, - mut f: impl FnMut(O, Event) + 'static, -) { - let weak = obj.downgrade(); - glib::spawn_future_local(async move { - while let Some(obj) = weak.upgrade() { - f(obj, receiver.recv_direct().await.unwrap()); - } - }); -} diff --git a/src/main.rs b/src/main.rs index 3b87de8..5f43ccb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,9 +16,6 @@ pub use playbin_song::Song as PlaybinSong; pub mod subsonic; -pub mod event; -pub use event::Event; - use gettextrs::{bind_textdomain_codeset, bindtextdomain, setlocale, textdomain, LocaleCategory}; use gtk::prelude::*; use gtk::{gio, glib};