mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 19:46:10 +08:00
update Helvum to track the latest pipewire0.8.0
update Helvum to track the latest pipewire0.8.0
This commit is contained in:
104
Cargo.lock
generated
104
Cargo.lock
generated
@@ -11,6 +11,16 @@ dependencies = [
|
|||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "annotate-snippets"
|
||||||
|
version = "0.9.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ccaf7e9dfbb6ab22c82e473cd1a8a7bd313c19a5b7e40970f3d89ef5a5c9e81e"
|
||||||
|
dependencies = [
|
||||||
|
"unicode-width",
|
||||||
|
"yansi-term",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.75"
|
version = "1.0.75"
|
||||||
@@ -25,16 +35,17 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bindgen"
|
name = "bindgen"
|
||||||
version = "0.66.1"
|
version = "0.69.4"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7"
|
checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"annotate-snippets",
|
||||||
|
"bitflags",
|
||||||
"cexpr",
|
"cexpr",
|
||||||
"clang-sys",
|
"clang-sys",
|
||||||
|
"itertools",
|
||||||
"lazy_static",
|
"lazy_static",
|
||||||
"lazycell",
|
"lazycell",
|
||||||
"peeking_take_while",
|
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"regex",
|
"regex",
|
||||||
@@ -43,12 +54,6 @@ dependencies = [
|
|||||||
"syn 2.0.37",
|
"syn 2.0.37",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "bitflags"
|
|
||||||
version = "1.3.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.4.0"
|
version = "2.4.0"
|
||||||
@@ -61,7 +66,7 @@ version = "0.18.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c0466dfa8c0ee78deef390c274ad756801e0a6dbb86c5ef0924a298c5761c4d"
|
checksum = "1c0466dfa8c0ee78deef390c274ad756801e0a6dbb86c5ef0924a298c5761c4d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags",
|
||||||
"cairo-sys-rs",
|
"cairo-sys-rs",
|
||||||
"glib",
|
"glib",
|
||||||
"libc",
|
"libc",
|
||||||
@@ -140,6 +145,12 @@ version = "0.3.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b"
|
checksum = "396de984970346b0d9e93d1415082923c679e5ae5c3ee3dcbd104f5610af126b"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "either"
|
||||||
|
version = "1.10.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "equivalent"
|
name = "equivalent"
|
||||||
version = "1.0.1"
|
version = "1.0.1"
|
||||||
@@ -152,7 +163,7 @@ version = "0.3.6"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f"
|
checksum = "38e2275cc4e4fc009b0669731a1e5ab7ebf11f469eaede2bab9309a5b4d6057f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memoffset 0.9.0",
|
"memoffset",
|
||||||
"rustc_version",
|
"rustc_version",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -315,7 +326,7 @@ version = "0.18.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19"
|
checksum = "1c316afb01ce8067c5eaab1fc4f2cd47dc21ce7b6296358605e2ffab23ccbd19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-core",
|
"futures-core",
|
||||||
"futures-executor",
|
"futures-executor",
|
||||||
@@ -516,6 +527,15 @@ dependencies = [
|
|||||||
"hashbrown",
|
"hashbrown",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "itertools"
|
||||||
|
version = "0.12.1"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
|
||||||
|
dependencies = [
|
||||||
|
"either",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "lazy_static"
|
name = "lazy_static"
|
||||||
version = "1.4.0"
|
version = "1.4.0"
|
||||||
@@ -578,11 +598,11 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libspa"
|
name = "libspa"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0434617020ddca18b86067912970c55410ca654cdafd775480322f50b857a8c4"
|
checksum = "65f3a4b81b2a2d8c7f300643676202debd1b7c929dbf5c9bb89402ea11d19810"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags",
|
||||||
"cc",
|
"cc",
|
||||||
"convert_case",
|
"convert_case",
|
||||||
"cookie-factory",
|
"cookie-factory",
|
||||||
@@ -595,9 +615,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libspa-sys"
|
name = "libspa-sys"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b3e70ca3f3e70f858ef363046d06178c427b4e0b63d210c95fd87d752679d345"
|
checksum = "bf0d9716420364790e85cbb9d3ac2c950bde16a7dd36f3209b7dfdfc4a24d01f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"cc",
|
"cc",
|
||||||
@@ -616,15 +636,6 @@ version = "2.6.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
|
checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "memoffset"
|
|
||||||
version = "0.7.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
|
|
||||||
dependencies = [
|
|
||||||
"autocfg",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memoffset"
|
name = "memoffset"
|
||||||
version = "0.9.0"
|
version = "0.9.0"
|
||||||
@@ -642,15 +653,13 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nix"
|
name = "nix"
|
||||||
version = "0.26.4"
|
version = "0.27.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b"
|
checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 1.3.2",
|
"bitflags",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"libc",
|
"libc",
|
||||||
"memoffset 0.7.1",
|
|
||||||
"pin-utils",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@@ -694,12 +703,6 @@ dependencies = [
|
|||||||
"system-deps",
|
"system-deps",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "peeking_take_while"
|
|
||||||
version = "0.1.2"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pin-project-lite"
|
name = "pin-project-lite"
|
||||||
version = "0.2.13"
|
version = "0.2.13"
|
||||||
@@ -714,12 +717,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pipewire"
|
name = "pipewire"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a2d009c8dd65e890b515a71950f7e4c801523b8894ff33863a40830bf762e9e9"
|
checksum = "08e645ba5c45109106d56610b3ee60eb13a6f2beb8b74f8dc8186cf261788dda"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bitflags 2.4.0",
|
"bitflags",
|
||||||
"libc",
|
"libc",
|
||||||
"libspa",
|
"libspa",
|
||||||
"libspa-sys",
|
"libspa-sys",
|
||||||
@@ -731,9 +734,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pipewire-sys"
|
name = "pipewire-sys"
|
||||||
version = "0.7.2"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "890c084e7b737246cb4799c86b71a0e4da536031ff7473dd639eba9f95039f64"
|
checksum = "849e188f90b1dda88fe2bfe1ad31fe5f158af2c98f80fb5d13726c44f3f01112"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bindgen",
|
"bindgen",
|
||||||
"libspa-sys",
|
"libspa-sys",
|
||||||
@@ -1005,6 +1008,12 @@ version = "1.10.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
|
checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "unicode-width"
|
||||||
|
version = "0.1.11"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "version-compare"
|
name = "version-compare"
|
||||||
version = "0.1.1"
|
version = "0.1.1"
|
||||||
@@ -1047,3 +1056,12 @@ checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc"
|
|||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "yansi-term"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "fe5c30ade05e61656247b2e334a031dfd0cc466fadef865bdcdea8d537951bf1"
|
||||||
|
dependencies = [
|
||||||
|
"winapi",
|
||||||
|
]
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ categories = ["gui", "multimedia"]
|
|||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
pipewire = "0.7.1"
|
pipewire = "0.8.0"
|
||||||
adw = { version = "0.5", package = "libadwaita", features = ["v1_4"] }
|
adw = { version = "0.5", package = "libadwaita", features = ["v1_4"] }
|
||||||
glib = { version = "0.18", features = ["log"] }
|
glib = { version = "0.18", features = ["log"] }
|
||||||
|
|
||||||
|
|||||||
@@ -130,7 +130,13 @@ mod imp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Add a new port to the view.
|
/// Add a new port to the view.
|
||||||
fn add_port(&self, id: u32, name: &str, node_id: u32, direction: pipewire::spa::Direction) {
|
fn add_port(
|
||||||
|
&self,
|
||||||
|
id: u32,
|
||||||
|
name: &str,
|
||||||
|
node_id: u32,
|
||||||
|
direction: pipewire::spa::utils::Direction,
|
||||||
|
) {
|
||||||
log::info!("Adding port to graph: id {}", id);
|
log::info!("Adding port to graph: id {}", id);
|
||||||
|
|
||||||
let mut items = self.items.borrow_mut();
|
let mut items = self.items.borrow_mut();
|
||||||
@@ -273,7 +279,11 @@ mod imp {
|
|||||||
link.set_active(active);
|
link.set_active(active);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn link_format_changed(&self, id: u32, media_type: pipewire::spa::format::MediaType) {
|
fn link_format_changed(
|
||||||
|
&self,
|
||||||
|
id: u32,
|
||||||
|
media_type: pipewire::spa::param::format::MediaType,
|
||||||
|
) {
|
||||||
let items = self.items.borrow();
|
let items = self.items.borrow();
|
||||||
|
|
||||||
let Some(link) = items.get(&id) else {
|
let Some(link) = items.get(&id) else {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ mod pipewire_connection;
|
|||||||
mod ui;
|
mod ui;
|
||||||
|
|
||||||
use adw::{gtk, prelude::*};
|
use adw::{gtk, prelude::*};
|
||||||
use pipewire::spa::{format::MediaType, Direction};
|
use pipewire::spa::{param::format::MediaType, utils::Direction};
|
||||||
|
|
||||||
/// Messages sent by the GTK thread to notify the pipewire thread.
|
/// Messages sent by the GTK thread to notify the pipewire thread.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -26,19 +26,21 @@ use std::{
|
|||||||
use adw::glib::{self, clone};
|
use adw::glib::{self, clone};
|
||||||
use log::{debug, error, info, warn};
|
use log::{debug, error, info, warn};
|
||||||
use pipewire::{
|
use pipewire::{
|
||||||
|
context::Context,
|
||||||
|
core::{Core, PW_ID_CORE},
|
||||||
keys,
|
keys,
|
||||||
link::{Link, LinkChangeMask, LinkInfo, LinkListener, LinkState},
|
link::{Link, LinkChangeMask, LinkInfoRef, LinkListener, LinkState},
|
||||||
node::{Node, NodeInfo, NodeListener},
|
main_loop::MainLoop,
|
||||||
port::{Port, PortChangeMask, PortInfo, PortListener},
|
node::{Node, NodeInfoRef, NodeListener},
|
||||||
prelude::*,
|
port::{Port, PortChangeMask, PortInfoRef, PortListener},
|
||||||
properties,
|
properties::properties,
|
||||||
registry::{GlobalObject, Registry},
|
registry::{GlobalObject, Registry},
|
||||||
spa::{
|
spa::{
|
||||||
param::{ParamInfoFlags, ParamType},
|
param::{ParamInfoFlags, ParamType},
|
||||||
ForeignDict, SpaResult,
|
utils::dict::DictRef,
|
||||||
|
utils::result::SpaResult,
|
||||||
},
|
},
|
||||||
types::ObjectType,
|
types::ObjectType,
|
||||||
Context, Core, MainLoop,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::{GtkMessage, MediaType, NodeType, PipewireMessage};
|
use crate::{GtkMessage, MediaType, NodeType, PipewireMessage};
|
||||||
@@ -64,7 +66,7 @@ pub(super) fn thread_main(
|
|||||||
gtk_sender: glib::Sender<PipewireMessage>,
|
gtk_sender: glib::Sender<PipewireMessage>,
|
||||||
mut pw_receiver: pipewire::channel::Receiver<GtkMessage>,
|
mut pw_receiver: pipewire::channel::Receiver<GtkMessage>,
|
||||||
) {
|
) {
|
||||||
let mainloop = MainLoop::new().expect("Failed to create mainloop");
|
let mainloop = MainLoop::new(None).expect("Failed to create mainloop");
|
||||||
let context = Rc::new(Context::new(&mainloop).expect("Failed to create context"));
|
let context = Rc::new(Context::new(&mainloop).expect("Failed to create context"));
|
||||||
let is_stopped = Rc::new(Cell::new(false));
|
let is_stopped = Rc::new(Cell::new(false));
|
||||||
let mut is_connecting = false;
|
let mut is_connecting = false;
|
||||||
@@ -86,13 +88,15 @@ pub(super) fn thread_main(
|
|||||||
// If connection is failed, try to connect again in 200ms
|
// If connection is failed, try to connect again in 200ms
|
||||||
let interval = Some(Duration::from_millis(200));
|
let interval = Some(Duration::from_millis(200));
|
||||||
|
|
||||||
let timer = mainloop.add_timer(clone!(@strong mainloop => move |_| {
|
let timer = mainloop
|
||||||
|
.loop_()
|
||||||
|
.add_timer(clone!(@strong mainloop => move |_| {
|
||||||
mainloop.quit();
|
mainloop.quit();
|
||||||
}));
|
}));
|
||||||
|
|
||||||
timer.update_timer(interval, None).into_result().unwrap();
|
timer.update_timer(interval, None).into_result().unwrap();
|
||||||
|
|
||||||
let receiver = pw_receiver.attach(&mainloop, {
|
let receiver = pw_receiver.attach(mainloop.loop_(), {
|
||||||
clone!(@strong mainloop, @strong is_stopped => move |msg|
|
clone!(@strong mainloop, @strong is_stopped => move |msg|
|
||||||
if let GtkMessage::Terminate = msg {
|
if let GtkMessage::Terminate = msg {
|
||||||
// main thread requested stop
|
// main thread requested stop
|
||||||
@@ -122,7 +126,7 @@ pub(super) fn thread_main(
|
|||||||
let proxies = Rc::new(RefCell::new(HashMap::new()));
|
let proxies = Rc::new(RefCell::new(HashMap::new()));
|
||||||
let state = Rc::new(RefCell::new(State::new()));
|
let state = Rc::new(RefCell::new(State::new()));
|
||||||
|
|
||||||
let receiver = pw_receiver.attach(&mainloop, {
|
let receiver = pw_receiver.attach(mainloop.loop_(), {
|
||||||
clone!(@strong mainloop, @weak core, @weak registry, @strong state, @strong is_stopped => move |msg| match msg {
|
clone!(@strong mainloop, @weak core, @weak registry, @strong state, @strong is_stopped => move |msg| match msg {
|
||||||
GtkMessage::ToggleLink { port_from, port_to } => toggle_link(port_from, port_to, &core, ®istry, &state),
|
GtkMessage::ToggleLink { port_from, port_to } => toggle_link(port_from, port_to, &core, ®istry, &state),
|
||||||
GtkMessage::Terminate => {
|
GtkMessage::Terminate => {
|
||||||
@@ -136,7 +140,7 @@ pub(super) fn thread_main(
|
|||||||
let gtk_sender = gtk_sender.clone();
|
let gtk_sender = gtk_sender.clone();
|
||||||
let _listener = core.add_listener_local()
|
let _listener = core.add_listener_local()
|
||||||
.error(clone!(@strong mainloop, @strong gtk_sender, @strong is_stopped => move |id, _seq, res, message| {
|
.error(clone!(@strong mainloop, @strong gtk_sender, @strong is_stopped => move |id, _seq, res, message| {
|
||||||
if id != pipewire::PW_ID_CORE {
|
if id != PW_ID_CORE {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,7 +191,7 @@ pub(super) fn thread_main(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Get the nicest possible name for the node, using a fallback chain of possible name attributes
|
/// Get the nicest possible name for the node, using a fallback chain of possible name attributes
|
||||||
fn get_node_name(props: &ForeignDict) -> &str {
|
fn get_node_name(props: &DictRef) -> &str {
|
||||||
props
|
props
|
||||||
.get(&keys::NODE_DESCRIPTION)
|
.get(&keys::NODE_DESCRIPTION)
|
||||||
.or_else(|| props.get(&keys::NODE_NICK))
|
.or_else(|| props.get(&keys::NODE_NICK))
|
||||||
@@ -197,7 +201,7 @@ fn get_node_name(props: &ForeignDict) -> &str {
|
|||||||
|
|
||||||
/// Handle a new node being added
|
/// Handle a new node being added
|
||||||
fn handle_node(
|
fn handle_node(
|
||||||
node: &GlobalObject<ForeignDict>,
|
node: &GlobalObject<&DictRef>,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
registry: &Rc<Registry>,
|
registry: &Rc<Registry>,
|
||||||
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
||||||
@@ -258,7 +262,7 @@ fn handle_node(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_node_info(
|
fn handle_node_info(
|
||||||
info: &NodeInfo,
|
info: &NodeInfoRef,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
||||||
) {
|
) {
|
||||||
@@ -287,7 +291,7 @@ fn handle_node_info(
|
|||||||
|
|
||||||
/// Handle a new port being added
|
/// Handle a new port being added
|
||||||
fn handle_port(
|
fn handle_port(
|
||||||
port: &GlobalObject<ForeignDict>,
|
port: &GlobalObject<&DictRef>,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
registry: &Rc<Registry>,
|
registry: &Rc<Registry>,
|
||||||
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
||||||
@@ -319,7 +323,7 @@ fn handle_port(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_port_info(
|
fn handle_port_info(
|
||||||
info: &PortInfo,
|
info: &PortInfoRef,
|
||||||
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
||||||
state: &Rc<RefCell<State>>,
|
state: &Rc<RefCell<State>>,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
@@ -393,7 +397,7 @@ fn handle_port_enum_format(
|
|||||||
|
|
||||||
/// Handle a new link being added
|
/// Handle a new link being added
|
||||||
fn handle_link(
|
fn handle_link(
|
||||||
link: &GlobalObject<ForeignDict>,
|
link: &GlobalObject<&DictRef>,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
registry: &Rc<Registry>,
|
registry: &Rc<Registry>,
|
||||||
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
proxies: &Rc<RefCell<HashMap<u32, ProxyItem>>>,
|
||||||
@@ -422,7 +426,7 @@ fn handle_link(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn handle_link_info(
|
fn handle_link_info(
|
||||||
info: &LinkInfo,
|
info: &LinkInfoRef,
|
||||||
state: &Rc<RefCell<State>>,
|
state: &Rc<RefCell<State>>,
|
||||||
sender: &glib::Sender<PipewireMessage>,
|
sender: &glib::Sender<PipewireMessage>,
|
||||||
) {
|
) {
|
||||||
@@ -495,7 +499,7 @@ fn toggle_link(
|
|||||||
.get_node_of_port(port_to)
|
.get_node_of_port(port_to)
|
||||||
.expect("Requested port not in state");
|
.expect("Requested port not in state");
|
||||||
|
|
||||||
if let Err(e) = core.create_object::<Link, _>(
|
if let Err(e) = core.create_object::<Link>(
|
||||||
"link-factory",
|
"link-factory",
|
||||||
&properties! {
|
&properties! {
|
||||||
"link.output.node" => node_from.to_string(),
|
"link.output.node" => node_from.to_string(),
|
||||||
@@ -510,7 +514,7 @@ fn toggle_link(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_link_media_type(link_info: &LinkInfo) -> MediaType {
|
fn get_link_media_type(link_info: &LinkInfoRef) -> MediaType {
|
||||||
let media_type = link_info
|
let media_type = link_info
|
||||||
.format()
|
.format()
|
||||||
.and_then(|format| pipewire::spa::param::format_utils::parse_format(format).ok())
|
.and_then(|format| pipewire::spa::param::format_utils::parse_format(format).ok())
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ mod imp {
|
|||||||
use adw::gtk::gdk::{self};
|
use adw::gtk::gdk::{self};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use pipewire::spa::format::MediaType;
|
use pipewire::spa::param::format::MediaType;
|
||||||
use pipewire::spa::Direction;
|
use pipewire::spa::utils::Direction;
|
||||||
|
|
||||||
pub struct Colors {
|
pub struct Colors {
|
||||||
audio: gdk::RGBA,
|
audio: gdk::RGBA,
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use adw::{glib, prelude::*, subclass::prelude::*};
|
use adw::{glib, prelude::*, subclass::prelude::*};
|
||||||
use pipewire::spa::format::MediaType;
|
use pipewire::spa::param::format::MediaType;
|
||||||
|
|
||||||
use super::Port;
|
use super::Port;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-only
|
// SPDX-License-Identifier: GPL-3.0-only
|
||||||
|
|
||||||
use adw::{glib, gtk, prelude::*, subclass::prelude::*};
|
use adw::{glib, gtk, prelude::*, subclass::prelude::*};
|
||||||
use pipewire::spa::Direction;
|
use pipewire::spa::utils::Direction;
|
||||||
|
|
||||||
use super::Port;
|
use super::Port;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ use adw::{
|
|||||||
prelude::*,
|
prelude::*,
|
||||||
subclass::prelude::*,
|
subclass::prelude::*,
|
||||||
};
|
};
|
||||||
use pipewire::spa::Direction;
|
use pipewire::spa::utils::Direction;
|
||||||
|
|
||||||
use super::PortHandle;
|
use super::PortHandle;
|
||||||
|
|
||||||
@@ -31,7 +31,7 @@ mod imp {
|
|||||||
use std::cell::Cell;
|
use std::cell::Cell;
|
||||||
|
|
||||||
use once_cell::{sync::Lazy, unsync::OnceCell};
|
use once_cell::{sync::Lazy, unsync::OnceCell};
|
||||||
use pipewire::spa::{format::MediaType, Direction};
|
use pipewire::spa::{param::format::MediaType, utils::Direction};
|
||||||
|
|
||||||
/// Graphical representation of a pipewire port.
|
/// Graphical representation of a pipewire port.
|
||||||
#[derive(gtk::CompositeTemplate, glib::Properties)]
|
#[derive(gtk::CompositeTemplate, glib::Properties)]
|
||||||
|
|||||||
Reference in New Issue
Block a user