mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 03:26:10 +08:00
Update dependencies
This commit is contained in:
520
Cargo.lock
generated
520
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ name = "helvum"
|
|||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
authors = ["Tom A. Wagner <tom.a.wagner@protonmail.com>"]
|
authors = ["Tom A. Wagner <tom.a.wagner@protonmail.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.56"
|
rust-version = "1.70"
|
||||||
license = "GPL-3.0-only"
|
license = "GPL-3.0-only"
|
||||||
description = "A GTK patchbay for pipewire"
|
description = "A GTK patchbay for pipewire"
|
||||||
repository = "https://gitlab.freedesktop.org/pipewire/helvum"
|
repository = "https://gitlab.freedesktop.org/pipewire/helvum"
|
||||||
@@ -14,9 +14,9 @@ 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.6"
|
pipewire = "0.7"
|
||||||
gtk = { version = "0.6", package = "gtk4" }
|
gtk = { version = "0.7", package = "gtk4" }
|
||||||
glib = { version = "0.17", features = ["log"] }
|
glib = { version = "0.18", features = ["log"] }
|
||||||
|
|
||||||
log = "0.4.11"
|
log = "0.4.11"
|
||||||
|
|
||||||
|
|||||||
@@ -46,24 +46,13 @@ mod imp {
|
|||||||
type ParentType = glib::Object;
|
type ParentType = glib::Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ObjectImpl for GraphManager {
|
#[glib::derived_properties]
|
||||||
fn properties() -> &'static [glib::ParamSpec] {
|
impl ObjectImpl for GraphManager {}
|
||||||
Self::derived_properties()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
|
|
||||||
Self::derived_property(self, id, pspec)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
|
||||||
Self::derived_set_property(self, id, value, pspec)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl GraphManager {
|
impl GraphManager {
|
||||||
pub fn attach_receiver(&self, receiver: glib::Receiver<crate::PipewireMessage>) {
|
pub fn attach_receiver(&self, receiver: glib::Receiver<crate::PipewireMessage>) {
|
||||||
receiver.attach(None, glib::clone!(
|
receiver.attach(None, glib::clone!(
|
||||||
@weak self as imp => @default-return Continue(true),
|
@weak self as imp => @default-return glib::ControlFlow::Continue,
|
||||||
move |msg| {
|
move |msg| {
|
||||||
match msg {
|
match msg {
|
||||||
PipewireMessage::NodeAdded{ id, name, node_type } => imp.add_node(id, name.as_str(), node_type),
|
PipewireMessage::NodeAdded{ id, name, node_type } => imp.add_node(id, name.as_str(), node_type),
|
||||||
@@ -74,7 +63,7 @@ mod imp {
|
|||||||
PipewireMessage::PortRemoved { id, node_id } => imp.remove_port(id, node_id),
|
PipewireMessage::PortRemoved { id, node_id } => imp.remove_port(id, node_id),
|
||||||
PipewireMessage::LinkRemoved { id } => imp.remove_link(id)
|
PipewireMessage::LinkRemoved { id } => imp.remove_link(id)
|
||||||
};
|
};
|
||||||
Continue(true)
|
glib::ControlFlow::Continue
|
||||||
}
|
}
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ mod graph_manager;
|
|||||||
mod pipewire_connection;
|
mod pipewire_connection;
|
||||||
mod ui;
|
mod ui;
|
||||||
|
|
||||||
use glib::PRIORITY_DEFAULT;
|
|
||||||
use gtk::prelude::*;
|
use gtk::prelude::*;
|
||||||
use pipewire::spa::Direction;
|
use pipewire::spa::Direction;
|
||||||
|
|
||||||
@@ -111,7 +110,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
let _guard = ctx.acquire().unwrap();
|
let _guard = ctx.acquire().unwrap();
|
||||||
|
|
||||||
// Start the pipewire thread with channels in both directions.
|
// Start the pipewire thread with channels in both directions.
|
||||||
let (gtk_sender, gtk_receiver) = glib::MainContext::channel(PRIORITY_DEFAULT);
|
|
||||||
|
let (gtk_sender, gtk_receiver) = glib::MainContext::channel(glib::Priority::DEFAULT);
|
||||||
let (pw_sender, pw_receiver) = pipewire::channel::channel();
|
let (pw_sender, pw_receiver) = pipewire::channel::channel();
|
||||||
let pw_thread =
|
let pw_thread =
|
||||||
std::thread::spawn(move || pipewire_connection::thread_main(gtk_sender, pw_receiver));
|
std::thread::spawn(move || pipewire_connection::thread_main(gtk_sender, pw_receiver));
|
||||||
|
|||||||
@@ -357,7 +357,7 @@ mod imp {
|
|||||||
|
|
||||||
drop.read_value_async(
|
drop.read_value_async(
|
||||||
Port::static_type(),
|
Port::static_type(),
|
||||||
glib::PRIORITY_DEFAULT,
|
glib::Priority::DEFAULT,
|
||||||
Option::<&gio::Cancellable>::None,
|
Option::<&gio::Cancellable>::None,
|
||||||
clone!(@weak self as imp => move|value| {
|
clone!(@weak self as imp => move|value| {
|
||||||
let Ok(value) = value else {
|
let Ok(value) = value else {
|
||||||
@@ -407,9 +407,9 @@ mod imp {
|
|||||||
.unwrap();
|
.unwrap();
|
||||||
widget.set_zoom_factor(widget.zoom_factor() + (0.1 * -delta_y), None);
|
widget.set_zoom_factor(widget.zoom_factor() + (0.1 * -delta_y), None);
|
||||||
|
|
||||||
gtk::Inhibit(true)
|
glib::Propagation::Stop
|
||||||
} else {
|
} else {
|
||||||
gtk::Inhibit(false)
|
glib::Propagation::Proceed
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
self.obj().add_controller(scroll_controller);
|
self.obj().add_controller(scroll_controller);
|
||||||
@@ -576,6 +576,7 @@ mod imp {
|
|||||||
let (output_anchor, input_anchor) = match port.direction() {
|
let (output_anchor, input_anchor) = match port.direction() {
|
||||||
Direction::Output => (&port_anchor, &other_anchor),
|
Direction::Output => (&port_anchor, &other_anchor),
|
||||||
Direction::Input => (&other_anchor, &port_anchor),
|
Direction::Input => (&other_anchor, &port_anchor),
|
||||||
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
self.draw_link(link_cr, output_anchor, input_anchor, false);
|
self.draw_link(link_cr, output_anchor, input_anchor, false);
|
||||||
|
|||||||
@@ -82,24 +82,13 @@ mod imp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[glib::derived_properties]
|
||||||
impl ObjectImpl for Node {
|
impl ObjectImpl for Node {
|
||||||
fn constructed(&self) {
|
fn constructed(&self) {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
self.grid.set_parent(&*self.obj());
|
self.grid.set_parent(&*self.obj());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn properties() -> &'static [glib::ParamSpec] {
|
|
||||||
Self::derived_properties()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
|
|
||||||
Self::derived_property(self, id, pspec)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
|
||||||
Self::derived_set_property(self, id, value, pspec)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn dispose(&self) {
|
fn dispose(&self) {
|
||||||
self.grid.unparent();
|
self.grid.unparent();
|
||||||
}
|
}
|
||||||
@@ -133,6 +122,7 @@ impl Node {
|
|||||||
imp.grid.attach(&port, 1, imp.num_ports_out.get() + 1, 1, 1);
|
imp.grid.attach(&port, 1, imp.num_ports_out.get() + 1, 1, 1);
|
||||||
imp.num_ports_out.set(imp.num_ports_out.get() + 1);
|
imp.num_ports_out.set(imp.num_ports_out.get() + 1);
|
||||||
}
|
}
|
||||||
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|
||||||
imp.ports.borrow_mut().insert(port);
|
imp.ports.borrow_mut().insert(port);
|
||||||
@@ -144,6 +134,7 @@ impl Node {
|
|||||||
match port.direction() {
|
match port.direction() {
|
||||||
Direction::Input => imp.num_ports_in.set(imp.num_ports_in.get() - 1),
|
Direction::Input => imp.num_ports_in.set(imp.num_ports_in.get() - 1),
|
||||||
Direction::Output => imp.num_ports_in.set(imp.num_ports_out.get() - 1),
|
Direction::Output => imp.num_ports_in.set(imp.num_ports_out.get() - 1),
|
||||||
|
_ => unreachable!(),
|
||||||
}
|
}
|
||||||
|
|
||||||
port.unparent();
|
port.unparent();
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ mod imp {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[glib::derived_properties]
|
||||||
impl ObjectImpl for Port {
|
impl ObjectImpl for Port {
|
||||||
fn constructed(&self) {
|
fn constructed(&self) {
|
||||||
self.parent_constructed();
|
self.parent_constructed();
|
||||||
@@ -80,18 +81,6 @@ mod imp {
|
|||||||
self.label.unparent()
|
self.label.unparent()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn properties() -> &'static [glib::ParamSpec] {
|
|
||||||
Self::derived_properties()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn property(&self, id: usize, pspec: &glib::ParamSpec) -> glib::Value {
|
|
||||||
Self::derived_property(self, id, pspec)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn set_property(&self, id: usize, value: &glib::Value, pspec: &glib::ParamSpec) {
|
|
||||||
Self::derived_set_property(self, id, value, pspec)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn signals() -> &'static [Signal] {
|
fn signals() -> &'static [Signal] {
|
||||||
static SIGNALS: Lazy<Vec<Signal>> = Lazy::new(|| {
|
static SIGNALS: Lazy<Vec<Signal>> = Lazy::new(|| {
|
||||||
vec![Signal::builder("port-toggled")
|
vec![Signal::builder("port-toggled")
|
||||||
@@ -182,6 +171,7 @@ mod imp {
|
|||||||
let (output_port, input_port) = match port.direction() {
|
let (output_port, input_port) = match port.direction() {
|
||||||
Direction::Output => (&port, &other_port),
|
Direction::Output => (&port, &other_port),
|
||||||
Direction::Input => (&other_port, &port),
|
Direction::Input => (&other_port, &port),
|
||||||
|
_ => unreachable!(),
|
||||||
};
|
};
|
||||||
|
|
||||||
port.emit_by_name::<()>(
|
port.emit_by_name::<()>(
|
||||||
@@ -229,8 +219,9 @@ impl Port {
|
|||||||
res
|
res
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn direction(&self) -> &Direction {
|
pub fn direction(&self) -> Direction {
|
||||||
self.imp()
|
*self
|
||||||
|
.imp()
|
||||||
.direction
|
.direction
|
||||||
.get()
|
.get()
|
||||||
.expect("Port direction is not set")
|
.expect("Port direction is not set")
|
||||||
@@ -247,6 +238,7 @@ impl Port {
|
|||||||
match self.direction() {
|
match self.direction() {
|
||||||
Direction::Output => self.width() as f32 + padding_right + border_right,
|
Direction::Output => self.width() as f32 + padding_right + border_right,
|
||||||
Direction::Input => 0.0 - padding_left - border_left,
|
Direction::Input => 0.0 - padding_left - border_left,
|
||||||
|
_ => unreachable!(),
|
||||||
},
|
},
|
||||||
self.height() as f32 / 2.0,
|
self.height() as f32 / 2.0,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user