mirror of
https://gitlab.freedesktop.org/pipewire/helvum
synced 2026-03-15 19:46:10 +08:00
Compare commits
27 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
958fa15230 | ||
|
|
e9753dd078 | ||
|
|
dfb1b754c7 | ||
|
|
497da8b953 | ||
|
|
da5da90352 | ||
|
|
a8bfd8383e | ||
|
|
7ef8677c4c | ||
|
|
487dc3b2d3 | ||
|
|
2ee7bca68a | ||
|
|
494d3a383f | ||
|
|
b719e0d2ec | ||
|
|
f64a936dd9 | ||
|
|
179665778d | ||
|
|
be9339472e | ||
|
|
e29ffdeea8 | ||
|
|
add1a96b75 | ||
|
|
9445e173f9 | ||
|
|
58794fe123 | ||
|
|
8d6fbe2997 | ||
|
|
b0bf5e5281 | ||
|
|
edc4064009 | ||
|
|
58cdcd859b | ||
|
|
7977481689 | ||
|
|
f09fd596c8 | ||
|
|
1247b29bae | ||
|
|
74ffb06b40 | ||
|
|
81467154d9 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
/.flatpak-builder
|
||||
/.vscode
|
||||
/target
|
||||
|
||||
356
Cargo.lock
generated
356
Cargo.lock
generated
@@ -1,10 +1,12 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aho-corasick"
|
||||
version = "0.7.18"
|
||||
version = "0.7.15"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
||||
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
]
|
||||
@@ -20,9 +22,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "anyhow"
|
||||
version = "1.0.40"
|
||||
version = "1.0.44"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b"
|
||||
checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
@@ -49,15 +51,15 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
|
||||
|
||||
[[package]]
|
||||
name = "bindgen"
|
||||
version = "0.58.1"
|
||||
version = "0.59.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0f8523b410d7187a43085e7e064416ea32ded16bd0a4e6fc025e21616d01258f"
|
||||
checksum = "453c49e5950bb0eb63bb3df640e31618846c89d5b7faa54040d76e98e0134375"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cexpr",
|
||||
"clang-sys",
|
||||
"clap",
|
||||
"env_logger",
|
||||
"env_logger 0.8.4",
|
||||
"lazy_static",
|
||||
"lazycell",
|
||||
"log",
|
||||
@@ -72,9 +74,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "bitflags"
|
||||
version = "1.2.1"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
|
||||
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
||||
|
||||
[[package]]
|
||||
name = "bitvec"
|
||||
@@ -90,8 +92,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cairo-rs"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
version = "0.14.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9164355c892b026d6257e696dde5f3cb39beb3718297f0f161b562fe2ee3ab86"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-sys-rs",
|
||||
@@ -103,33 +106,43 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "cairo-sys-rs"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d7c9c3928781e8a017ece15eace05230f04b647457d170d2d9641c94a444ff80"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cc"
|
||||
version = "1.0.68"
|
||||
version = "1.0.70"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787"
|
||||
checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0"
|
||||
|
||||
[[package]]
|
||||
name = "cexpr"
|
||||
version = "0.4.0"
|
||||
version = "0.5.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27"
|
||||
checksum = "db507a7679252d2276ed0dd8113c6875ec56d3089f9225b2b42c30cc1f8e5c89"
|
||||
dependencies = [
|
||||
"nom 5.1.2",
|
||||
"nom",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-expr"
|
||||
version = "0.7.4"
|
||||
version = "0.8.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30aa9e2ffbb838c6b451db14f3cd8e63ed622bf859f9956bc93845a10fafc26a"
|
||||
checksum = "b412e83326147c2bb881f8b40edfbf9905b9b8abaebd0e47ca190ba62fda8f0e"
|
||||
dependencies = [
|
||||
"smallvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cfg-expr"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "edae0b9625d1fce32f7d64b71784d9b1bf8469ec1a9c417e44aaf16a9cbd7571"
|
||||
dependencies = [
|
||||
"smallvec",
|
||||
]
|
||||
@@ -148,9 +161,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "clang-sys"
|
||||
version = "1.2.0"
|
||||
version = "1.2.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "853eda514c284c2287f4bf20ae614f8781f40a81d32ecda6e91449304dfe077c"
|
||||
checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee"
|
||||
dependencies = [
|
||||
"glob",
|
||||
"libc",
|
||||
@@ -186,9 +199,22 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.8.3"
|
||||
version = "0.8.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17392a012ea30ef05a610aa97dfb49496e71c9f676b27879922ea5bdf60d9d3f"
|
||||
checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"humantime",
|
||||
"log",
|
||||
"regex",
|
||||
"termcolor",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "env_logger"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
|
||||
dependencies = [
|
||||
"atty",
|
||||
"humantime",
|
||||
@@ -210,11 +236,11 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "errno-dragonfly"
|
||||
version = "0.1.1"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "14ca354e36190500e1e1fb267c647932382b54053c50b14970856c0b00a35067"
|
||||
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||
dependencies = [
|
||||
"gcc",
|
||||
"cc",
|
||||
"libc",
|
||||
]
|
||||
|
||||
@@ -236,24 +262,24 @@ checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7"
|
||||
|
||||
[[package]]
|
||||
name = "futures-channel"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e682a68b29a882df0545c143dc3646daefe80ba479bcdede94d5a703de2871e2"
|
||||
checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "futures-core"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1"
|
||||
checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d"
|
||||
|
||||
[[package]]
|
||||
name = "futures-executor"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "badaa6a909fac9e7236d0620a2f57f7664640c56575b71a7552fbd68deafab79"
|
||||
checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c"
|
||||
dependencies = [
|
||||
"futures-core",
|
||||
"futures-task",
|
||||
@@ -262,21 +288,21 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "futures-io"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1"
|
||||
checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377"
|
||||
|
||||
[[package]]
|
||||
name = "futures-task"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae"
|
||||
checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99"
|
||||
|
||||
[[package]]
|
||||
name = "futures-util"
|
||||
version = "0.3.15"
|
||||
version = "0.3.17"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967"
|
||||
checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481"
|
||||
dependencies = [
|
||||
"autocfg",
|
||||
"futures-core",
|
||||
@@ -286,16 +312,11 @@ dependencies = [
|
||||
"slab",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gcc"
|
||||
version = "0.3.55"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2"
|
||||
|
||||
[[package]]
|
||||
name = "gdk-pixbuf"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "534192cb8f01daeb8fab2c8d4baa8f9aae5b7a39130525779f5c2608e235b10f"
|
||||
dependencies = [
|
||||
"gdk-pixbuf-sys",
|
||||
"gio",
|
||||
@@ -306,19 +327,21 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gdk-pixbuf-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f097c0704201fbc8f69c1762dc58c6947c8bb188b8ed0bc7e65259f1894fe590"
|
||||
dependencies = [
|
||||
"gio-sys",
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gdk4"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4c0f7f98ad25b81ac9462f74a091b0e4c0983ed1e74d19a38230c772b4dcef81"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
@@ -332,8 +355,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gdk4-sys"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "262a79666b42e1884577f11a050439a964b95dec55343ac6ace7930e1415fa18"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
@@ -343,13 +367,14 @@ dependencies = [
|
||||
"graphene-sys",
|
||||
"libc",
|
||||
"pango-sys",
|
||||
"system-deps",
|
||||
"system-deps 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gio"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
version = "0.14.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f3a29d8062af72045518271a2cd98b4e1617ce43f5b4223ad0fb9a0eff8f718c"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"futures-channel",
|
||||
@@ -365,19 +390,21 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "gio-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c0a41df66e57fcc287c4bcf74fc26b884f31901ea9792ec75607289b456f48fa"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "glib"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
version = "0.14.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d4a930b7208e6e0ab839eea5f65ac2b82109f729621430d47fe905e2e09d33f4"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"futures-channel",
|
||||
@@ -394,8 +421,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "glib-macros"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
version = "0.14.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2aad66361f66796bfc73f530c51ef123970eb895ffba991a234fcf7bea89e518"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck",
|
||||
@@ -409,10 +437,11 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "glib-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1c1d60554a212445e2a858e42a0e48cece1bd57b311a19a9468f70376cf554ae"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -424,17 +453,19 @@ checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
||||
[[package]]
|
||||
name = "gobject-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa92cae29759dae34ab5921d73fff5ad54b3d794ab842c117e36cafc7994c3f5"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "graphene-rs"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f1460a39f06e491e6112f27e71e51435c833ba370723224dd1743dfd1f201f19"
|
||||
dependencies = [
|
||||
"glib",
|
||||
"graphene-sys",
|
||||
@@ -444,18 +475,20 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "graphene-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7d23fb7a9547e5f072a7e0cd49cd648fedeb786d122b106217511980cbb8962"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"libc",
|
||||
"pkg-config",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gsk4"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "20b71f2e2cc699c2e0fbfa22899eeaffd84f9c1dc01e9263deac8664eec22dc0"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
@@ -469,8 +502,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gsk4-sys"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "30468aff80e4faadf22f9ba164ea17511a69a9995d7a13827a13424ef47b2472"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk4-sys",
|
||||
@@ -479,13 +513,14 @@ dependencies = [
|
||||
"graphene-sys",
|
||||
"libc",
|
||||
"pango-sys",
|
||||
"system-deps",
|
||||
"system-deps 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gtk4"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "906f9308d15789d96a736881582181d710ae0937197119df459f3d2b46ef6776"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cairo-rs",
|
||||
@@ -506,8 +541,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gtk4-macros"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4d0d008cdf23214c697482415dd20f666bdf3cc9f5e803b017223c17c5b59a6e"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"heck",
|
||||
@@ -521,8 +557,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "gtk4-sys"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk4-rs/#ff9e0b861ccf59d4ced5ea67bdd004f138419cb7"
|
||||
version = "0.3.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d06be0a6322aa77dd372f726e97efbcbb192d9a824a414a8874f238effd7747c"
|
||||
dependencies = [
|
||||
"cairo-sys-rs",
|
||||
"gdk-pixbuf-sys",
|
||||
@@ -534,7 +571,7 @@ dependencies = [
|
||||
"gsk4-sys",
|
||||
"libc",
|
||||
"pango-sys",
|
||||
"system-deps",
|
||||
"system-deps 4.0.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -548,9 +585,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "helvum"
|
||||
version = "0.2.1"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"env_logger 0.9.0",
|
||||
"gtk4",
|
||||
"log",
|
||||
"once_cell",
|
||||
@@ -559,9 +596,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "hermit-abi"
|
||||
version = "0.1.18"
|
||||
version = "0.1.19"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
|
||||
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
|
||||
dependencies = [
|
||||
"libc",
|
||||
]
|
||||
@@ -574,9 +611,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
||||
|
||||
[[package]]
|
||||
name = "itertools"
|
||||
version = "0.10.0"
|
||||
version = "0.10.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319"
|
||||
checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
|
||||
dependencies = [
|
||||
"either",
|
||||
]
|
||||
@@ -608,9 +645,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.95"
|
||||
version = "0.2.103"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "789da6d93f1b866ffe175afc5322a4d76c038605a1c3319bb57b06967ca98a36"
|
||||
checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6"
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
@@ -624,8 +661,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libspa"
|
||||
version = "0.3.0"
|
||||
source = "git+https://gitlab.freedesktop.org/pipewire/pipewire-rs?branch=main#62ce08ed59e711c2a438bb06fe60d956ececfb07"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aeb373e8b03740369c5fe48a557c6408b6898982d57e17940de144375d472743"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
@@ -633,17 +671,18 @@ dependencies = [
|
||||
"errno",
|
||||
"libc",
|
||||
"libspa-sys",
|
||||
"nom 6.1.2",
|
||||
"system-deps",
|
||||
"nom",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libspa-sys"
|
||||
version = "0.3.0"
|
||||
source = "git+https://gitlab.freedesktop.org/pipewire/pipewire-rs?branch=main#62ce08ed59e711c2a438bb06fe60d956ececfb07"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d301a2fc2fed0a97c13836408a4d98f419af0c2695ecf74e634a214c17beefa6"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -657,9 +696,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "memchr"
|
||||
version = "2.4.0"
|
||||
version = "2.3.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
|
||||
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525"
|
||||
|
||||
[[package]]
|
||||
name = "memoffset"
|
||||
@@ -685,19 +724,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "5.1.2"
|
||||
version = "6.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af"
|
||||
dependencies = [
|
||||
"memchr",
|
||||
"version_check",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "nom"
|
||||
version = "6.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2"
|
||||
checksum = "9c5c51b9083a3c620fa67a2a635d1ce7d95b897e957d6b28ff9a5da960a103a6"
|
||||
dependencies = [
|
||||
"bitvec",
|
||||
"funty",
|
||||
@@ -708,14 +737,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "once_cell"
|
||||
version = "1.7.2"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3"
|
||||
checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
|
||||
|
||||
[[package]]
|
||||
name = "pango"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
version = "0.14.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e1fc88307d9797976ea62722ff2ec5de3fae279c6e20100ed3f49ca1a4bf3f96"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"glib",
|
||||
@@ -727,12 +757,13 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "pango-sys"
|
||||
version = "0.14.0"
|
||||
source = "git+https://github.com/gtk-rs/gtk-rs-core#a6815e75a8803c71b8e7cf7d35bf322376e934d6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2367099ca5e761546ba1d501955079f097caa186bb53ce0f718dca99ac1942fe"
|
||||
dependencies = [
|
||||
"glib-sys",
|
||||
"gobject-sys",
|
||||
"libc",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -752,9 +783,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pin-project-lite"
|
||||
version = "0.2.6"
|
||||
version = "0.2.7"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"
|
||||
checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443"
|
||||
|
||||
[[package]]
|
||||
name = "pin-utils"
|
||||
@@ -764,8 +795,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
|
||||
|
||||
[[package]]
|
||||
name = "pipewire"
|
||||
version = "0.3.0"
|
||||
source = "git+https://gitlab.freedesktop.org/pipewire/pipewire-rs?branch=main#62ce08ed59e711c2a438bb06fe60d956ececfb07"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5de050d879e7b8d9313429ec314b88b26fe48ba29a6ecc3bc8289d3673fee6c8"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bitflags",
|
||||
@@ -781,25 +813,26 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "pipewire-sys"
|
||||
version = "0.3.0"
|
||||
source = "git+https://gitlab.freedesktop.org/pipewire/pipewire-rs?branch=main#62ce08ed59e711c2a438bb06fe60d956ececfb07"
|
||||
version = "0.4.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9b4aa5ef9f3afef7dbb335106f69bd6bb541259e8796c693810cde20db1eb949"
|
||||
dependencies = [
|
||||
"bindgen",
|
||||
"libspa-sys",
|
||||
"system-deps",
|
||||
"system-deps 3.2.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pkg-config"
|
||||
version = "0.3.19"
|
||||
version = "0.3.20"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c"
|
||||
checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "41fdbd1df62156fbc5945f4762632564d7d038153091c3fcf1067f6aef7cff92"
|
||||
checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
|
||||
dependencies = [
|
||||
"thiserror",
|
||||
"toml",
|
||||
@@ -831,9 +864,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.27"
|
||||
version = "1.0.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"
|
||||
checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d"
|
||||
dependencies = [
|
||||
"unicode-xid",
|
||||
]
|
||||
@@ -855,9 +888,9 @@ checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8"
|
||||
|
||||
[[package]]
|
||||
name = "regex"
|
||||
version = "1.5.4"
|
||||
version = "1.4.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
||||
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759"
|
||||
dependencies = [
|
||||
"aho-corasick",
|
||||
"memchr",
|
||||
@@ -911,15 +944,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.126"
|
||||
version = "1.0.130"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03"
|
||||
checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
|
||||
|
||||
[[package]]
|
||||
name = "shlex"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "42a568c8f2cd051a4d283bd6eb0343ac214c1b0f1ac19f93e1175b2dee38c73d"
|
||||
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
||||
|
||||
[[package]]
|
||||
name = "signal"
|
||||
@@ -933,15 +966,15 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.3"
|
||||
version = "0.4.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
|
||||
checksum = "c307a32c1c5c437f38c7fd45d753050587732ba8628319fbdf12a7e289ccc590"
|
||||
|
||||
[[package]]
|
||||
name = "smallvec"
|
||||
version = "1.6.1"
|
||||
version = "1.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e"
|
||||
checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
|
||||
|
||||
[[package]]
|
||||
name = "static_assertions"
|
||||
@@ -957,15 +990,15 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
||||
|
||||
[[package]]
|
||||
name = "strum"
|
||||
version = "0.20.0"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c"
|
||||
checksum = "aaf86bbcfd1fa9670b7a129f64fc0c9fcbbfe4f1bc4210e9e98fe71ffc12cde2"
|
||||
|
||||
[[package]]
|
||||
name = "strum_macros"
|
||||
version = "0.20.1"
|
||||
version = "0.21.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149"
|
||||
checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec"
|
||||
dependencies = [
|
||||
"heck",
|
||||
"proc-macro2",
|
||||
@@ -975,9 +1008,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "1.0.72"
|
||||
version = "1.0.77"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
|
||||
checksum = "5239bc68e0fef57495900cfea4e8dc75596d9a319d7e16b1e0a440d24e6fe0a0"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -986,12 +1019,12 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "system-deps"
|
||||
version = "3.1.1"
|
||||
version = "3.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "c248107ad7bc1ac07066a4d003cae9e9a7bc2e27d3418f7a9cdcdc8699dbea70"
|
||||
checksum = "480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"cfg-expr",
|
||||
"cfg-expr 0.8.1",
|
||||
"heck",
|
||||
"itertools",
|
||||
"pkg-config",
|
||||
@@ -1002,6 +1035,19 @@ dependencies = [
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "system-deps"
|
||||
version = "4.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6c1889ab44c2a423ba9ba4d64cd04989b25c0280ca7ade813f05368418722a04"
|
||||
dependencies = [
|
||||
"cfg-expr 0.9.0",
|
||||
"heck",
|
||||
"pkg-config",
|
||||
"toml",
|
||||
"version-compare",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tap"
|
||||
version = "1.0.1"
|
||||
@@ -1028,18 +1074,18 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "thiserror"
|
||||
version = "1.0.25"
|
||||
version = "1.0.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6"
|
||||
checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88"
|
||||
dependencies = [
|
||||
"thiserror-impl",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "thiserror-impl"
|
||||
version = "1.0.25"
|
||||
version = "1.0.29"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d"
|
||||
checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
@@ -1063,15 +1109,15 @@ checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.7.1"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796"
|
||||
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.8"
|
||||
version = "0.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
|
||||
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-xid"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "helvum"
|
||||
version = "0.2.1"
|
||||
version = "0.3.1"
|
||||
authors = ["Tom A. Wagner <tom.a.wagner@protonmail.com>"]
|
||||
edition = "2018"
|
||||
license = "GPL-3.0-only"
|
||||
@@ -13,10 +13,10 @@ categories = ["gui", "multimedia"]
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
gtk = { git = "https://github.com/gtk-rs/gtk4-rs/", package = "gtk4" }
|
||||
pipewire = { git = "https://gitlab.freedesktop.org/pipewire/pipewire-rs", branch = "main" }
|
||||
pipewire = "0.4"
|
||||
gtk = { version = "0.3", package = "gtk4" }
|
||||
|
||||
log = "0.4.11"
|
||||
env_logger = "0.8.2"
|
||||
env_logger = "0.9.0"
|
||||
|
||||
once_cell = "1.7.2"
|
||||
|
||||
46
README.md
46
README.md
@@ -1,6 +1,9 @@
|
||||
Helvum is a GTK-based patchbay for pipewire, inspired by the JACK tool [catia](https://kx.studio/Applications:Catia).
|
||||
|
||||

|
||||

|
||||
|
||||
[](https://repology.org/project/helvum/versions)
|
||||
|
||||
|
||||
# Features planned
|
||||
|
||||
@@ -9,22 +12,45 @@ Helvum is a GTK-based patchbay for pipewire, inspired by the JACK tool [catia](h
|
||||
|
||||
More suggestions are welcome!
|
||||
|
||||
# Distribution packages
|
||||
|
||||
- ArchLinux:
|
||||
- [aur/helvum](https://aur.archlinux.org/packages/helvum)
|
||||
- [aur/helvum-git](https://aur.archlinux.org/packages/helvum-git)
|
||||
|
||||
# Building
|
||||
|
||||
## Via flatpak (recommended)
|
||||
The recommended way to build is using flatpak, which will take care of all dependencies and avoid any problems that may come from different system configurations.
|
||||
|
||||
First, install the required flatpak platform and SDK, if you dont have them already:
|
||||
```shell
|
||||
$ flatpak install org.gnome.{Platform,Sdk}//40 org.freedesktop.Sdk.Extension.rust-stable//20.08
|
||||
```
|
||||
|
||||
To compile and install as a flatpak, run
|
||||
```shell
|
||||
$ flatpak-builder --install flatpak-build/ build-aux/org.freedesktop.ryuukyu.Helvum.json
|
||||
```
|
||||
|
||||
You can then run the app via
|
||||
```shell
|
||||
$ flatpak run org.freedesktop.ryuukyu.Helvum
|
||||
```
|
||||
|
||||
## Manually
|
||||
For compilation, you will need:
|
||||
|
||||
- Meson
|
||||
- An up-to-date rust toolchain
|
||||
- `libclang-3.7` or higher
|
||||
- `gtk-4.0` and `pipewire-0.3` development headers
|
||||
|
||||
To compile, run
|
||||
To compile and install, run
|
||||
|
||||
$ cargo build --release
|
||||
```shell
|
||||
$ meson setup build && cd build
|
||||
$ meson compile
|
||||
$ meson install
|
||||
```
|
||||
|
||||
in the repository root.
|
||||
The resulting binary will be at `target/release/helvum`.
|
||||
This will install the compiled project files into `/usr/local`.
|
||||
|
||||
# License
|
||||
Helvum is distributed under the terms of the GPL3 license.
|
||||
See LICENSE for more information.
|
||||
|
||||
20
build-aux/cargo.sh
Normal file
20
build-aux/cargo.sh
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
|
||||
export MESON_BUILD_ROOT="$1"
|
||||
export MESON_SOURCE_ROOT="$2"
|
||||
export CARGO_TARGET_DIR="$MESON_BUILD_ROOT"/target
|
||||
export CARGO_HOME="$MESON_BUILD_ROOT"/cargo-home
|
||||
|
||||
if [[ $4 = "development" ]]
|
||||
then
|
||||
echo "DEBUG MODE"
|
||||
cargo build --manifest-path \
|
||||
"$MESON_SOURCE_ROOT"/Cargo.toml && \
|
||||
cp "$CARGO_TARGET_DIR"/debug/$5 $3
|
||||
else
|
||||
echo "RELEASE MODE"
|
||||
cargo build --manifest-path \
|
||||
"$MESON_SOURCE_ROOT"/Cargo.toml --release && \
|
||||
cp "$CARGO_TARGET_DIR"/release/$5 $3
|
||||
fi
|
||||
|
||||
12
build-aux/meson_post_install.py
Normal file
12
build-aux/meson_post_install.py
Normal file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from os import environ, path
|
||||
from subprocess import call
|
||||
|
||||
if not environ.get('DESTDIR', ''):
|
||||
PREFIX = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
|
||||
DATA_DIR = path.join(PREFIX, 'share')
|
||||
print('Updating icon cache...')
|
||||
call(['gtk-update-icon-cache', '-qtf', path.join(DATA_DIR, 'icons/hicolor')])
|
||||
print("Updating desktop database...")
|
||||
call(["update-desktop-database", path.join(DATA_DIR, 'applications')])
|
||||
38
build-aux/org.freedesktop.ryuukyu.Helvum.json
Normal file
38
build-aux/org.freedesktop.ryuukyu.Helvum.json
Normal file
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"app-id": "org.freedesktop.ryuukyu.Helvum",
|
||||
"runtime": "org.gnome.Platform",
|
||||
"runtime-version": "40",
|
||||
"sdk": "org.gnome.Sdk",
|
||||
"sdk-extensions": [
|
||||
"org.freedesktop.Sdk.Extension.rust-stable"
|
||||
],
|
||||
"command": "helvum",
|
||||
"finish-args": [
|
||||
"--socket=fallback-x11",
|
||||
"--socket=wayland",
|
||||
"--device=dri",
|
||||
"--share=ipc",
|
||||
"--filesystem=xdg-run/pipewire-0"
|
||||
],
|
||||
"build-options": {
|
||||
"append-path": "/usr/lib/sdk/rust-stable/bin",
|
||||
"build-args": [
|
||||
"--share=network"
|
||||
]
|
||||
},
|
||||
"modules": [
|
||||
{
|
||||
"name": "Helvum",
|
||||
"buildsystem": "meson",
|
||||
"sources": [
|
||||
{
|
||||
"type": "dir",
|
||||
"path": "../"
|
||||
}
|
||||
],
|
||||
"config-opts": [
|
||||
"-Dprofile=development"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
data/icons/meson.build
Normal file
9
data/icons/meson.build
Normal file
@@ -0,0 +1,9 @@
|
||||
install_data(
|
||||
'@0@.svg'.format(base_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'scalable' / 'apps'
|
||||
)
|
||||
|
||||
install_data(
|
||||
'@0@-symbolic.svg'.format(base_id),
|
||||
install_dir: iconsdir / 'hicolor' / 'symbolic' / 'apps',
|
||||
)
|
||||
8
data/icons/org.freedesktop.ryuukyu.Helvum-symbolic.svg
Normal file
8
data/icons/org.freedesktop.ryuukyu.Helvum-symbolic.svg
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="16px" viewBox="0 0 16 16" width="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m 3.5 2.5 h 9 c 1.378906 0 2.5 1.121094 2.5 2.5 v 5 c 0 1.378906 -1.121094 2.5 -2.5 2.5 h -9 c -1.378906 0 -2.5 -1.121094 -2.5 -2.5 v -5 c 0 -1.378906 1.121094 -2.5 2.5 -2.5 z m 0 0" fill="#241f31" fill-rule="evenodd"/>
|
||||
<g fill="none" stroke="#8a8891">
|
||||
<path d="m 11 7.5 h -6"/>
|
||||
<path d="m 5 7.5 c 0 -4.15625 -1.382812 -10.855469 -3.90625 -13.25" stroke-linecap="round" stroke-linejoin="bevel" stroke-width="4"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 589 B |
3366
data/icons/org.freedesktop.ryuukyu.Helvum.Source.svg
Normal file
3366
data/icons/org.freedesktop.ryuukyu.Helvum.Source.svg
Normal file
File diff suppressed because it is too large
Load Diff
|
After Width: | Height: | Size: 187 KiB |
56
data/icons/org.freedesktop.ryuukyu.Helvum.svg
Normal file
56
data/icons/org.freedesktop.ryuukyu.Helvum.svg
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg height="128px" viewBox="0 0 128 128" width="128px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<linearGradient id="a" gradientUnits="userSpaceOnUse">
|
||||
<stop offset="0" stop-color="#9a9996"/>
|
||||
<stop offset="0.5" stop-color="#c0bfbc"/>
|
||||
<stop offset="1" stop-color="#deddda"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="b" x1="26.263471" x2="26.263586" xlink:href="#a" y1="24.848538" y2="37.1125"/>
|
||||
<linearGradient id="c" gradientUnits="userSpaceOnUse" x1="7.39555839647" x2="120.60350567947" y1="82.86737386462" y2="82.86737386462">
|
||||
<stop offset="0" stop-color="#5e5c64"/>
|
||||
<stop offset="0.0384615" stop-color="#77767b"/>
|
||||
<stop offset="0.0768555" stop-color="#5e5c64"/>
|
||||
<stop offset="0.923077" stop-color="#5e5c64"/>
|
||||
<stop offset="0.961538" stop-color="#77767b"/>
|
||||
<stop offset="1" stop-color="#5e5c64"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="d" gradientTransform="matrix(2.571428 0 0 2.454545 22.856596 -228.048061)" x1="16" x2="16" xlink:href="#a" y1="121.582512" y2="127.082512"/>
|
||||
<linearGradient id="e" gradientTransform="matrix(2.571428 0 0 2.454545 22.856596 -253.563246)" x1="16" x2="16" xlink:href="#a" y1="121.582512" y2="127.082512"/>
|
||||
<linearGradient id="f" gradientTransform="matrix(2.571428 0 0 2.454545 60.592569 -253.563246)" x1="16" x2="16" xlink:href="#a" y1="121.582512" y2="127.082512"/>
|
||||
<linearGradient id="g" gradientTransform="matrix(2.571428 0 0 2.454545 60.592569 -228.048061)" x1="16" x2="16" xlink:href="#a" y1="121.582512" y2="127.082512"/>
|
||||
<linearGradient id="h" gradientTransform="matrix(2.358499 0 0 2.251294 -11.472502 -204.652927)" gradientUnits="userSpaceOnUse" x1="12.5" x2="19.5" y1="113.832512" y2="113.832512">
|
||||
<stop offset="0" stop-color="#c0bfbc"/>
|
||||
<stop offset="0.5" stop-color="#9a9996"/>
|
||||
<stop offset="1" stop-color="#c0bfbc"/>
|
||||
</linearGradient>
|
||||
<linearGradient id="i" gradientTransform="matrix(2.571428 0 0 2.454545 -14.879853 -228.048061)" x1="16" x2="16" xlink:href="#a" y1="121.582512" y2="127.082512"/>
|
||||
<path d="m 34.519531 30.980469 c 0 3.386719 -3.695312 6.132812 -8.257812 6.132812 c -4.558594 0 -8.253907 -2.746093 -8.253907 -6.132812 s 3.695313 -6.132813 8.253907 -6.132813 c 4.5625 0 8.257812 2.746094 8.257812 6.132813 z m 0 0" fill="url(#b)" fill-rule="evenodd"/>
|
||||
<path d="m 120.601562 82.867188 v 18.867187 c 0 5.226563 -4.207031 9.433594 -9.433593 9.433594 h -94.339844 c -5.226563 0 -9.433594 -4.207031 -9.433594 -9.433594 v -18.867187 z m 0 0" fill="url(#c)" fill-rule="evenodd"/>
|
||||
<path d="m 16.828125 35.699219 c -5.226563 0 -9.433594 4.207031 -9.433594 9.433593 v 37.734376 c 0 5.226562 4.207031 9.433593 9.433594 9.433593 h 94.339844 c 5.226562 0 9.4375 -4.207031 9.4375 -9.433593 v -37.734376 c 0 -5.226562 -4.210938 -9.433593 -9.4375 -9.433593 h -76.648438 v 2.355469 h -16.511719 v -2.355469 z m 0 0" fill="#77767b" fill-rule="evenodd"/>
|
||||
<path d="m 93.480469 76.378906 l -30.660157 -24.761718" fill="none" stroke="#77767b" stroke-linecap="square" stroke-width="3.74412"/>
|
||||
<path d="m 64 58.691406 v 10.613282" fill="none" stroke="#999999" stroke-width="1.5"/>
|
||||
<g fill-rule="evenodd">
|
||||
<path d="m 75 77.132812 c 0 4.554688 -4.925781 8.25 -11 8.25 s -11 -3.695312 -11 -8.25 c 0 -4.558593 4.925781 -8.25 11 -8.25 s 11 3.691407 11 8.25 z m 0 0" fill="#e01b24"/>
|
||||
<path d="m 73 77.132812 c 0 3.726563 -4.03125 6.75 -9 6.75 c -4.972656 0 -9 -3.023437 -9 -6.75 c 0 -3.730468 4.027344 -6.75 9 -6.75 c 4.96875 0 9 3.019532 9 6.75 z m 0 0" fill="url(#d)"/>
|
||||
<path d="m 71 77.132812 c 0 2.898438 -3.132812 5.25 -7 5.25 s -7 -2.351562 -7 -5.25 c 0 -2.902343 3.132812 -5.25 7 -5.25 s 7 2.347657 7 5.25 z m 0 0" fill="#3d3846"/>
|
||||
<path d="m 75 51.617188 c 0 4.554687 -4.925781 8.25 -11 8.25 s -11 -3.695313 -11 -8.25 c 0 -4.558594 4.925781 -8.25 11 -8.25 s 11 3.691406 11 8.25 z m 0 0" fill="#1c71d8"/>
|
||||
<path d="m 73 51.617188 c 0 3.726562 -4.03125 6.75 -9 6.75 c -4.972656 0 -9 -3.023438 -9 -6.75 c 0 -3.730469 4.027344 -6.75 9 -6.75 c 4.96875 0 9 3.019531 9 6.75 z m 0 0" fill="url(#e)"/>
|
||||
<path d="m 71 51.617188 c 0 2.898437 -3.132812 5.25 -7 5.25 s -7 -2.351563 -7 -5.25 c 0 -2.898438 3.132812 -5.25 7 -5.25 s 7 2.351562 7 5.25 z m 0 0" fill="#3d3846"/>
|
||||
<path d="m 112.734375 51.617188 c 0 4.554687 -4.921875 8.25 -11 8.25 c -6.074219 0 -11 -3.695313 -11 -8.25 c 0 -4.558594 4.925781 -8.25 11 -8.25 c 6.078125 0 11 3.691406 11 8.25 z m 0 0" fill="#1c71d8"/>
|
||||
<path d="m 110.734375 51.617188 c 0 3.726562 -4.027344 6.75 -9 6.75 c -4.96875 0 -9 -3.023438 -9 -6.75 c 0 -3.730469 4.03125 -6.75 9 -6.75 c 4.972656 0 9 3.019531 9 6.75 z m 0 0" fill="url(#f)"/>
|
||||
<path d="m 108.734375 51.617188 c 0 2.898437 -3.132813 5.25 -7 5.25 c -3.863281 0 -7 -2.351563 -7 -5.25 c 0 -2.898438 3.136719 -5.25 7 -5.25 c 3.867187 0 7 2.351562 7 5.25 z m 0 0" fill="#3d3846"/>
|
||||
</g>
|
||||
<path d="m 101.734375 58.691406 v 10.613282" fill="none" stroke="#999999" stroke-width="1.5"/>
|
||||
<path d="m 112.734375 77.132812 c 0 4.554688 -4.921875 8.25 -11 8.25 c -6.074219 0 -11 -3.695312 -11 -8.25 c 0 -4.558593 4.925781 -8.25 11 -8.25 c 6.078125 0 11 3.691407 11 8.25 z m 0 0" fill="#e01b24" fill-rule="evenodd"/>
|
||||
<path d="m 110.734375 77.132812 c 0 3.726563 -4.027344 6.75 -9 6.75 c -4.96875 0 -9 -3.023437 -9 -6.75 c 0 -3.730468 4.03125 -6.75 9 -6.75 c 4.972656 0 9 3.019532 9 6.75 z m 0 0" fill="url(#g)" fill-rule="evenodd"/>
|
||||
<path d="m 108.734375 77.132812 c 0 2.898438 -3.132813 5.25 -7 5.25 c -3.863281 0 -7 -2.351562 -7 -5.25 c 0 -2.902343 3.136719 -5.25 7 -5.25 c 3.867187 0 7 2.347657 7 5.25 z m 0 0" fill="#3d3846" fill-rule="evenodd"/>
|
||||
<path d="m 26.261719 69.339844 v -10.648438" fill="none" stroke="#999999" stroke-width="1.5"/>
|
||||
<path d="m 37.261719 52.515625 c 0 4.238281 -4.921875 7.671875 -11 7.671875 c -6.074219 0 -11 -3.433594 -11 -7.671875 c 0 -4.234375 4.925781 -7.671875 11 -7.671875 c 6.078125 0 11 3.4375 11 7.671875 z m 0 0" fill="#1c71d8" fill-rule="evenodd"/>
|
||||
<path d="m 18.007812 30.980469 v 20.636719 c 0.003907 3.417968 3.699219 6.191406 8.253907 6.191406 c 4.554687 0 8.25 -2.765625 8.253906 -6.183594 c 0 0 0 -0.003906 0 -0.007812 v -20.636719 c -1.308594 2.597656 -4.589844 6.132812 -8.253906 6.132812 c -3.660157 0 -6.941407 -3.535156 -8.253907 -6.132812 z m 0 0" fill="url(#h)" fill-rule="evenodd"/>
|
||||
<path d="m 37.261719 77.132812 c 0 4.554688 -4.921875 8.25 -11 8.25 c -6.074219 0 -11 -3.695312 -11 -8.25 c 0 -4.558593 4.925781 -8.25 11 -8.25 c 6.078125 0 11 3.691407 11 8.25 z m 0 0" fill="#e01b24" fill-rule="evenodd"/>
|
||||
<path d="m 35.261719 77.132812 c 0 3.726563 -4.027344 6.75 -9 6.75 c -4.96875 0 -9 -3.023437 -9 -6.75 c 0 -3.730468 4.03125 -6.75 9 -6.75 c 4.972656 0 9 3.019532 9 6.75 z m 0 0" fill="url(#i)" fill-rule="evenodd"/>
|
||||
<path d="m 33.261719 77.132812 c 0 2.898438 -3.132813 5.25 -7 5.25 c -3.863281 0 -7 -2.351562 -7 -5.25 c 0 -2.902343 3.136719 -5.25 7 -5.25 c 3.867187 0 7 2.347657 7 5.25 z m 0 0" fill="#3d3846" fill-rule="evenodd"/>
|
||||
<path d="m 34.519531 30.980469 c 0 3.386719 -3.695312 6.132812 -8.257812 6.132812 c -4.558594 0 -8.253907 -2.746093 -8.253907 -6.132812 s 3.695313 -6.132813 8.253907 -6.132813 c 4.5625 0 8.257812 2.746094 8.257812 6.132813 z m 0 0" fill="#c0bfbc" fill-rule="evenodd"/>
|
||||
<path d="m 30.980469 30.980469 c 0 1.953125 -2.113281 3.539062 -4.71875 3.539062 c -2.601563 0 -4.714844 -1.585937 -4.714844 -3.539062 s 2.113281 -3.539063 4.714844 -3.539063 c 2.605469 0 4.71875 1.585938 4.71875 3.539063 z m 0 0" fill="#1a5fb4" fill-rule="evenodd"/>
|
||||
<path d="m 26.261719 30.980469 c 0 -7.074219 0.628906 -18.371094 -10.285157 -21.847657 c -11.828124 -3.765624 -33.882812 3 -33.882812 3" fill="none" stroke="#1a5fb4" stroke-width="9.434"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.7 KiB |
24
data/meson.build
Normal file
24
data/meson.build
Normal file
@@ -0,0 +1,24 @@
|
||||
subdir('icons')
|
||||
|
||||
desktop_conf = configuration_data()
|
||||
desktop_conf.set('icon', base_id)
|
||||
desktop_file = configure_file(
|
||||
input: '@0@.desktop.in'.format(base_id),
|
||||
output: '@BASENAME@',
|
||||
configuration: desktop_conf
|
||||
)
|
||||
|
||||
if desktop_file_validate.found()
|
||||
test(
|
||||
'validate-desktop',
|
||||
desktop_file_validate,
|
||||
args: [
|
||||
desktop_file
|
||||
],
|
||||
)
|
||||
endif
|
||||
|
||||
install_data(
|
||||
desktop_file,
|
||||
install_dir: datadir / 'applications'
|
||||
)
|
||||
9
data/org.freedesktop.ryuukyu.Helvum.desktop.in
Normal file
9
data/org.freedesktop.ryuukyu.Helvum.desktop.in
Normal file
@@ -0,0 +1,9 @@
|
||||
[Desktop Entry]
|
||||
Name=Helvum
|
||||
GenericName=Patchbay
|
||||
Comment=A patchbay for pipewire
|
||||
Type=Application
|
||||
Exec=helvum
|
||||
Terminal=false
|
||||
Categories=AudioVideo;Audio;Video;Midi;Settings;GNOME;GTK;
|
||||
Icon=@icon@
|
||||
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
38
meson.build
Normal file
38
meson.build
Normal file
@@ -0,0 +1,38 @@
|
||||
project(
|
||||
'helvum',
|
||||
'rust',
|
||||
version: '0.3.1',
|
||||
license: 'GPL-3.0',
|
||||
meson_version: '>=0.50.0'
|
||||
)
|
||||
|
||||
base_id = 'org.freedesktop.ryuukyu.Helvum'
|
||||
|
||||
dependency('glib-2.0', version: '>= 2.48')
|
||||
dependency('gtk4', version: '>= 4.0.0')
|
||||
dependency('libpipewire-0.3')
|
||||
|
||||
rust_version = meson.get_compiler('rust').version()
|
||||
min_rust_version = '1.54.0'
|
||||
if rust_version < min_rust_version
|
||||
error('Rust version too old: Required version is ' + min_rust_version + ' but actual version is ' + rust_version)
|
||||
endif
|
||||
|
||||
desktop_file_validate = find_program('desktop-file-validate', required: false)
|
||||
cargo = find_program('cargo', required: true)
|
||||
cargo_script = find_program('build-aux/cargo.sh')
|
||||
|
||||
prefix = get_option('prefix')
|
||||
bindir = prefix / get_option('bindir')
|
||||
datadir = prefix / get_option('datadir')
|
||||
iconsdir = datadir / 'icons'
|
||||
|
||||
cargo_sources = files(
|
||||
'Cargo.toml',
|
||||
'Cargo.lock',
|
||||
)
|
||||
|
||||
subdir('src')
|
||||
subdir('data')
|
||||
|
||||
meson.add_install_script('build-aux/meson_post_install.py')
|
||||
11
meson_options.txt
Normal file
11
meson_options.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
option(
|
||||
'profile',
|
||||
type: 'combo',
|
||||
choices: [
|
||||
'default',
|
||||
'development'
|
||||
],
|
||||
value: 'default',
|
||||
description: 'The build profile for Helvum. One of "default" or "development".'
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@ use pipewire::{channel::Sender, spa::Direction};
|
||||
|
||||
use crate::{
|
||||
view::{self},
|
||||
GtkMessage, MediaType, PipewireLink, PipewireMessage,
|
||||
GtkMessage, MediaType, NodeType, PipewireLink, PipewireMessage,
|
||||
};
|
||||
|
||||
static STYLE: &str = include_str!("style.css");
|
||||
@@ -83,7 +83,7 @@ impl Application {
|
||||
pw_sender: Sender<GtkMessage>,
|
||||
) -> Self {
|
||||
let app: Application =
|
||||
glib::Object::new(&[("application-id", &"org.freedesktop.ryuukyu.helvum")])
|
||||
glib::Object::new(&[("application-id", &"org.freedesktop.ryuukyu.Helvum")])
|
||||
.expect("Failed to create new Application");
|
||||
|
||||
let imp = imp::Application::from_instance(&app);
|
||||
@@ -108,9 +108,10 @@ impl Application {
|
||||
@weak app => @default-return Continue(true),
|
||||
move |msg| {
|
||||
match msg {
|
||||
PipewireMessage::NodeAdded{ id, name } => app.add_node(id,name),
|
||||
PipewireMessage::PortAdded{ id, node_id, name, direction, media_type} => app.add_port(id,name,node_id,direction,media_type),
|
||||
PipewireMessage::LinkAdded{ id, node_from, port_from, node_to, port_to} => app.add_link(id,node_from,port_from,node_to,port_to),
|
||||
PipewireMessage::NodeAdded{ id, name, node_type } => app.add_node(id, name.as_str(), node_type),
|
||||
PipewireMessage::PortAdded{ id, node_id, name, direction, media_type } => app.add_port(id, name.as_str(), node_id, direction, media_type),
|
||||
PipewireMessage::LinkAdded{ id, node_from, port_from, node_to, port_to, active} => app.add_link(id, node_from, port_from, node_to, port_to, active),
|
||||
PipewireMessage::LinkStateChanged { id, active } => app.link_state_changed(id, active), // TODO
|
||||
PipewireMessage::NodeRemoved { id } => app.remove_node(id),
|
||||
PipewireMessage::PortRemoved { id, node_id } => app.remove_port(id, node_id),
|
||||
PipewireMessage::LinkRemoved { id } => app.remove_link(id)
|
||||
@@ -124,19 +125,21 @@ impl Application {
|
||||
}
|
||||
|
||||
/// Add a new node to the view.
|
||||
pub fn add_node(&self, id: u32, name: String) {
|
||||
fn add_node(&self, id: u32, name: &str, node_type: Option<NodeType>) {
|
||||
info!("Adding node to graph: id {}", id);
|
||||
|
||||
imp::Application::from_instance(self)
|
||||
.graphview
|
||||
.add_node(id, view::Node::new(name.as_str()));
|
||||
imp::Application::from_instance(self).graphview.add_node(
|
||||
id,
|
||||
view::Node::new(name),
|
||||
node_type,
|
||||
);
|
||||
}
|
||||
|
||||
/// Add a new port to the view.
|
||||
pub fn add_port(
|
||||
fn add_port(
|
||||
&self,
|
||||
id: u32,
|
||||
name: String,
|
||||
name: &str,
|
||||
node_id: u32,
|
||||
direction: Direction,
|
||||
media_type: Option<MediaType>,
|
||||
@@ -145,7 +148,7 @@ impl Application {
|
||||
|
||||
let imp = imp::Application::from_instance(self);
|
||||
|
||||
let port = view::Port::new(id, name.as_str(), direction, media_type);
|
||||
let port = view::Port::new(id, name, direction, media_type);
|
||||
|
||||
// Create or delete a link if the widget emits the "port-toggled" signal.
|
||||
if let Err(e) = port.connect_local(
|
||||
@@ -168,7 +171,15 @@ impl Application {
|
||||
}
|
||||
|
||||
/// Add a new link to the view.
|
||||
pub fn add_link(&self, id: u32, node_from: u32, port_from: u32, node_to: u32, port_to: u32) {
|
||||
fn add_link(
|
||||
&self,
|
||||
id: u32,
|
||||
node_from: u32,
|
||||
port_from: u32,
|
||||
node_to: u32,
|
||||
port_to: u32,
|
||||
active: bool,
|
||||
) {
|
||||
info!("Adding link to graph: id {}", id);
|
||||
|
||||
// FIXME: Links should be colored depending on the data they carry (video, audio, midi) like ports are.
|
||||
@@ -182,9 +193,22 @@ impl Application {
|
||||
node_to,
|
||||
port_to,
|
||||
},
|
||||
active,
|
||||
);
|
||||
}
|
||||
|
||||
fn link_state_changed(&self, id: u32, active: bool) {
|
||||
info!(
|
||||
"Link state changed: Link (id={}) is now {}",
|
||||
id,
|
||||
if active { "active" } else { "inactive" }
|
||||
);
|
||||
|
||||
imp::Application::from_instance(self)
|
||||
.graphview
|
||||
.set_link_state(id, active);
|
||||
}
|
||||
|
||||
// Toggle a link between the two specified ports on the remote pipewire server.
|
||||
fn toggle_link(&self, port_from: u32, port_to: u32) {
|
||||
let imp = imp::Application::from_instance(self);
|
||||
|
||||
12
src/main.rs
12
src/main.rs
@@ -23,6 +23,7 @@ enum PipewireMessage {
|
||||
NodeAdded {
|
||||
id: u32,
|
||||
name: String,
|
||||
node_type: Option<NodeType>,
|
||||
},
|
||||
PortAdded {
|
||||
id: u32,
|
||||
@@ -37,6 +38,11 @@ enum PipewireMessage {
|
||||
port_from: u32,
|
||||
node_to: u32,
|
||||
port_to: u32,
|
||||
active: bool,
|
||||
},
|
||||
LinkStateChanged {
|
||||
id: u32,
|
||||
active: bool,
|
||||
},
|
||||
NodeRemoved {
|
||||
id: u32,
|
||||
@@ -50,6 +56,12 @@ enum PipewireMessage {
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum NodeType {
|
||||
Input,
|
||||
Output,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub enum MediaType {
|
||||
Audio,
|
||||
|
||||
31
src/meson.build
Normal file
31
src/meson.build
Normal file
@@ -0,0 +1,31 @@
|
||||
rust_sources = files(
|
||||
'application.rs',
|
||||
'main.rs',
|
||||
'pipewire_connection.rs',
|
||||
'pipewire_connection/state.rs',
|
||||
'view/graph_view.rs',
|
||||
'view/mod.rs',
|
||||
'view/node.rs',
|
||||
'view/port.rs',
|
||||
)
|
||||
|
||||
custom_target(
|
||||
'cargo-build',
|
||||
build_by_default: true,
|
||||
input: [
|
||||
cargo_sources,
|
||||
rust_sources
|
||||
],
|
||||
output: meson.project_name(),
|
||||
console: true,
|
||||
install: true,
|
||||
install_dir: bindir,
|
||||
command: [
|
||||
cargo_script,
|
||||
meson.build_root(),
|
||||
meson.source_root(),
|
||||
'@OUTPUT@',
|
||||
get_option('profile'),
|
||||
meson.project_name(),
|
||||
],
|
||||
)
|
||||
@@ -5,7 +5,7 @@ use std::{cell::RefCell, collections::HashMap, rc::Rc};
|
||||
use gtk::glib::{self, clone};
|
||||
use log::{debug, info, warn};
|
||||
use pipewire::{
|
||||
link::{Link, LinkListener},
|
||||
link::{Link, LinkChangeMask, LinkListener, LinkState},
|
||||
prelude::*,
|
||||
properties,
|
||||
registry::{GlobalObject, Registry},
|
||||
@@ -14,7 +14,7 @@ use pipewire::{
|
||||
Context, Core, MainLoop,
|
||||
};
|
||||
|
||||
use crate::{GtkMessage, MediaType, PipewireMessage};
|
||||
use crate::{GtkMessage, MediaType, NodeType, PipewireMessage};
|
||||
use state::{Item, State};
|
||||
|
||||
enum ProxyItem {
|
||||
@@ -100,20 +100,38 @@ fn handle_node(
|
||||
);
|
||||
|
||||
// FIXME: Instead of checking these props, the "EnumFormat" parameter should be checked instead.
|
||||
let media_type = props
|
||||
.get("media.class")
|
||||
.map(|class| {
|
||||
if class.contains("Audio") {
|
||||
Some(MediaType::Audio)
|
||||
} else if class.contains("Video") {
|
||||
Some(MediaType::Video)
|
||||
} else if class.contains("Midi") {
|
||||
Some(MediaType::Midi)
|
||||
} else {
|
||||
let media_type = props.get("media.class").and_then(|class| {
|
||||
if class.contains("Audio") {
|
||||
Some(MediaType::Audio)
|
||||
} else if class.contains("Video") {
|
||||
Some(MediaType::Video)
|
||||
} else if class.contains("Midi") {
|
||||
Some(MediaType::Midi)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
|
||||
let media_class = |class: &str| {
|
||||
if class.contains("Sink") || class.contains("Input") {
|
||||
Some(NodeType::Input)
|
||||
} else if class.contains("Source") || class.contains("Output") {
|
||||
Some(NodeType::Output)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
};
|
||||
|
||||
let node_type = props
|
||||
.get("media.category")
|
||||
.and_then(|class| {
|
||||
if class.contains("Duplex") {
|
||||
None
|
||||
} else {
|
||||
props.get("media.class").and_then(media_class)
|
||||
}
|
||||
})
|
||||
.flatten();
|
||||
.or_else(|| props.get("media.class").and_then(media_class));
|
||||
|
||||
state.borrow_mut().insert(
|
||||
node.id,
|
||||
@@ -124,7 +142,11 @@ fn handle_node(
|
||||
);
|
||||
|
||||
sender
|
||||
.send(PipewireMessage::NodeAdded { id: node.id, name })
|
||||
.send(PipewireMessage::NodeAdded {
|
||||
id: node.id,
|
||||
name,
|
||||
node_type,
|
||||
})
|
||||
.expect("Failed to send message");
|
||||
}
|
||||
|
||||
@@ -196,7 +218,13 @@ fn handle_link(
|
||||
let mut state = state.borrow_mut();
|
||||
if let Some(Item::Link { .. }) = state.get(id) {
|
||||
// Info was an update - figure out if we should notify the gtk thread
|
||||
// TODO
|
||||
if info.change_mask().contains(LinkChangeMask::STATE) {
|
||||
sender.send(PipewireMessage::LinkStateChanged {
|
||||
id,
|
||||
active: matches!(info.state(), LinkState::Active)
|
||||
}).expect("Failed to send message");
|
||||
}
|
||||
// TODO -- check other values that might have changed
|
||||
} else {
|
||||
// First time we get info. We can now notify the gtk thread of a new link.
|
||||
let node_from = info.output_node_id();
|
||||
@@ -213,7 +241,8 @@ fn handle_link(
|
||||
node_from,
|
||||
port_from,
|
||||
node_to,
|
||||
port_to
|
||||
port_to,
|
||||
active: matches!(info.state(), LinkState::Active)
|
||||
}).expect(
|
||||
"Failed to send message"
|
||||
);
|
||||
|
||||
@@ -34,7 +34,7 @@ pub(super) struct State {
|
||||
impl State {
|
||||
/// Create a new, empty state.
|
||||
pub fn new() -> Self {
|
||||
Default::default()
|
||||
Self::default()
|
||||
}
|
||||
|
||||
/// Add a new item under the specified id.
|
||||
|
||||
@@ -6,8 +6,11 @@ use gtk::{
|
||||
prelude::*,
|
||||
subclass::prelude::*,
|
||||
};
|
||||
use log::{error, warn};
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::{cmp::Ordering, collections::HashMap};
|
||||
|
||||
use crate::NodeType;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
@@ -19,7 +22,8 @@ mod imp {
|
||||
#[derive(Default)]
|
||||
pub struct GraphView {
|
||||
pub(super) nodes: RefCell<HashMap<u32, Node>>,
|
||||
pub(super) links: RefCell<HashMap<u32, crate::PipewireLink>>,
|
||||
/// Stores the link and whether it is currently active.
|
||||
pub(super) links: RefCell<HashMap<u32, (crate::PipewireLink, bool)>>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
@@ -43,27 +47,32 @@ mod imp {
|
||||
|
||||
drag_controller.connect_drag_begin(
|
||||
clone!(@strong drag_state => move |drag_controller, x, y| {
|
||||
let mut drag_state = drag_state.borrow_mut();
|
||||
let widget = drag_controller
|
||||
.widget()
|
||||
.expect("drag-begin event has no widget")
|
||||
.dynamic_cast::<Self::Type>()
|
||||
.expect("drag-begin event is not on the GraphView");
|
||||
// pick() should at least return the widget itself.
|
||||
let target = widget.pick(x, y, gtk::PickFlags::DEFAULT).expect("drag-begin pick() did not return a widget");
|
||||
*drag_state = if target.ancestor(Port::static_type()).is_some() {
|
||||
// The user targeted a port, so the dragging should be handled by the Port
|
||||
// component instead of here.
|
||||
None
|
||||
} else if let Some(target) = target.ancestor(Node::static_type()) {
|
||||
// The user targeted a Node without targeting a specific Port.
|
||||
// Drag the Node around the screen.
|
||||
let (x, y) = widget.get_node_position(&target);
|
||||
Some((target, x, y))
|
||||
} else {
|
||||
None
|
||||
let mut drag_state = drag_state.borrow_mut();
|
||||
let widget = drag_controller
|
||||
.widget()
|
||||
.expect("drag-begin event has no widget")
|
||||
.dynamic_cast::<Self::Type>()
|
||||
.expect("drag-begin event is not on the GraphView");
|
||||
// pick() should at least return the widget itself.
|
||||
let target = widget.pick(x, y, gtk::PickFlags::DEFAULT).expect("drag-begin pick() did not return a widget");
|
||||
*drag_state = if target.ancestor(Port::static_type()).is_some() {
|
||||
// The user targeted a port, so the dragging should be handled by the Port
|
||||
// component instead of here.
|
||||
None
|
||||
} else if let Some(target) = target.ancestor(Node::static_type()) {
|
||||
// The user targeted a Node without targeting a specific Port.
|
||||
// Drag the Node around the screen.
|
||||
if let Some((x, y)) = widget.get_node_position(&target) {
|
||||
Some((target, x, y))
|
||||
} else {
|
||||
error!("Failed to obtain position of dragged node, drag aborted.");
|
||||
None
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}
|
||||
}));
|
||||
));
|
||||
drag_controller.connect_drag_update(
|
||||
clone!(@strong drag_state => move |drag_controller, x, y| {
|
||||
let widget = drag_controller
|
||||
@@ -96,7 +105,7 @@ mod imp {
|
||||
|
||||
let alloc = widget.allocation();
|
||||
|
||||
let cr = snapshot
|
||||
let background_cr = snapshot
|
||||
.append_cairo(&graphene::Rect::new(
|
||||
0.0,
|
||||
0.0,
|
||||
@@ -107,51 +116,79 @@ mod imp {
|
||||
|
||||
// Try to replace the background color with a darker one from the theme.
|
||||
if let Some(rgba) = widget.style_context().lookup_color("text_view_bg") {
|
||||
cr.set_source_rgb(rgba.red.into(), rgba.green.into(), rgba.blue.into());
|
||||
if let Err(e) = cr.paint() {
|
||||
background_cr.set_source_rgb(rgba.red.into(), rgba.green.into(), rgba.blue.into());
|
||||
if let Err(e) = background_cr.paint() {
|
||||
warn!("Failed to paint graphview background: {}", e);
|
||||
};
|
||||
} // TODO: else log colour not found
|
||||
|
||||
// Draw a nice grid on the background.
|
||||
cr.set_source_rgb(0.18, 0.18, 0.18);
|
||||
cr.set_line_width(0.2); // TODO: Set to 1px
|
||||
background_cr.set_source_rgb(0.18, 0.18, 0.18);
|
||||
background_cr.set_line_width(0.2); // TODO: Set to 1px
|
||||
let mut y = 0.0;
|
||||
while y < alloc.height.into() {
|
||||
cr.move_to(0.0, y);
|
||||
cr.line_to(alloc.width as f64, y);
|
||||
background_cr.move_to(0.0, y);
|
||||
background_cr.line_to(alloc.width.into(), y);
|
||||
y += 20.0; // TODO: Change to em;
|
||||
}
|
||||
let mut x = 0.0;
|
||||
while x < alloc.width as f64 {
|
||||
cr.move_to(x, 0.0);
|
||||
cr.line_to(x, alloc.height as f64);
|
||||
while x < alloc.width.into() {
|
||||
background_cr.move_to(x, 0.0);
|
||||
background_cr.line_to(x, alloc.height.into());
|
||||
x += 20.0; // TODO: Change to em;
|
||||
}
|
||||
if let Err(e) = cr.stroke() {
|
||||
if let Err(e) = background_cr.stroke() {
|
||||
warn!("Failed to draw graphview grid: {}", e);
|
||||
};
|
||||
|
||||
// Draw all links
|
||||
cr.set_line_width(2.0);
|
||||
cr.set_source_rgb(0.0, 0.0, 0.0);
|
||||
for link in self.links.borrow().values() {
|
||||
if let Some((from_x, from_y, to_x, to_y)) = self.get_link_coordinates(link) {
|
||||
cr.move_to(from_x, from_y);
|
||||
cr.curve_to(from_x + 75.0, from_y, to_x - 75.0, to_y, to_x, to_y);
|
||||
if let Err(e) = cr.stroke() {
|
||||
warn!("Failed to draw graphview links: {}", e);
|
||||
};
|
||||
} else {
|
||||
log::warn!("Could not get allocation of ports of link: {:?}", link);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw all children
|
||||
self.nodes
|
||||
.borrow()
|
||||
.values()
|
||||
.for_each(|node| self.instance().snapshot_child(node, snapshot));
|
||||
|
||||
// Draw all links
|
||||
let link_cr = snapshot
|
||||
.append_cairo(&graphene::Rect::new(
|
||||
0.0,
|
||||
0.0,
|
||||
alloc.width as f32,
|
||||
alloc.height as f32,
|
||||
))
|
||||
.expect("Failed to get cairo context");
|
||||
link_cr.set_line_width(2.0);
|
||||
link_cr.set_source_rgb(0.0, 0.0, 0.0);
|
||||
for (link, active) in self.links.borrow().values() {
|
||||
if let Some((from_x, from_y, to_x, to_y)) = self.get_link_coordinates(link) {
|
||||
link_cr.move_to(from_x, from_y);
|
||||
|
||||
// Use dashed line for inactive links, full line otherwise.
|
||||
if *active {
|
||||
link_cr.set_dash(&[], 0.0);
|
||||
} else {
|
||||
link_cr.set_dash(&[10.0, 5.0], 0.0);
|
||||
}
|
||||
|
||||
// Place curve control offset by half the x distance between the two points.
|
||||
// This makes the curve scale well for varying distances between the two ports,
|
||||
// especially when the output port is farther right than the input port.
|
||||
let half_x_dist = f64::abs(from_x - to_x) / 2.0;
|
||||
link_cr.curve_to(
|
||||
from_x + half_x_dist,
|
||||
from_y,
|
||||
to_x - half_x_dist,
|
||||
to_y,
|
||||
to_x,
|
||||
to_y,
|
||||
);
|
||||
|
||||
if let Err(e) = link_cr.stroke() {
|
||||
warn!("Failed to draw graphview links: {}", e);
|
||||
};
|
||||
} else {
|
||||
warn!("Could not get allocation of ports of link: {:?}", link);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +196,7 @@ mod imp {
|
||||
/// Get coordinates for the drawn link to start at and to end at.
|
||||
///
|
||||
/// # Returns
|
||||
/// Some((from_x, from_y, to_x, to_y)) if all objects the links refers to exist as widgets.
|
||||
/// `Some((from_x, from_y, to_x, to_y))` if all objects the links refers to exist as widgets.
|
||||
fn get_link_coordinates(&self, link: &crate::PipewireLink) -> Option<(f64, f64, f64, f64)> {
|
||||
let nodes = self.nodes.borrow();
|
||||
|
||||
@@ -194,7 +231,7 @@ mod imp {
|
||||
tx += tnx;
|
||||
ty += tny + (th / 2);
|
||||
|
||||
Some((fx as f64, fy as f64, tx as f64, ty as f64))
|
||||
Some((fx.into(), fy.into(), tx.into(), ty.into()))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,14 +246,37 @@ impl GraphView {
|
||||
glib::Object::new(&[]).expect("Failed to create GraphView")
|
||||
}
|
||||
|
||||
pub fn add_node(&self, id: u32, node: Node) {
|
||||
pub fn add_node(&self, id: u32, node: Node, node_type: Option<NodeType>) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
node.set_parent(self);
|
||||
|
||||
// Place widgets in colums of 4, growing down, then right.
|
||||
// TODO: Make a better positioning algorithm.
|
||||
let x = (private.nodes.borrow().len() / 4) as f32 * 400.0; // This relies on integer division rounding down.
|
||||
let y = private.nodes.borrow().len() as f32 % 4.0 * 100.0;
|
||||
// Place widgets in colums of 3, growing down
|
||||
let x = if let Some(node_type) = node_type {
|
||||
match node_type {
|
||||
NodeType::Output => 20.0,
|
||||
NodeType::Input => 820.0,
|
||||
}
|
||||
} else {
|
||||
420.0
|
||||
};
|
||||
|
||||
let y = private
|
||||
.nodes
|
||||
.borrow()
|
||||
.values()
|
||||
.filter_map(|node| {
|
||||
// Map nodes to locations, discard nodes without location
|
||||
self.get_node_position(&node.clone().upcast())
|
||||
})
|
||||
.filter(|(x2, _)| {
|
||||
// Only look for other nodes that have a similar x coordinate
|
||||
(x - x2).abs() < 50.0
|
||||
})
|
||||
.max_by(|y1, y2| {
|
||||
// Get max in column
|
||||
y1.partial_cmp(y2).unwrap_or(Ordering::Equal)
|
||||
})
|
||||
.map_or(20_f32, |(_x, y)| y + 100.0);
|
||||
|
||||
self.move_node(&node.clone().upcast(), x, y);
|
||||
|
||||
@@ -228,6 +288,8 @@ impl GraphView {
|
||||
let mut nodes = private.nodes.borrow_mut();
|
||||
if let Some(node) = nodes.remove(&id) {
|
||||
node.unparent();
|
||||
} else {
|
||||
warn!("Tried to remove non-existant node (id={}) from graph", id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,11 +299,9 @@ impl GraphView {
|
||||
if let Some(node) = private.nodes.borrow_mut().get_mut(&node_id) {
|
||||
node.add_port(port_id, port);
|
||||
} else {
|
||||
// FIXME: Log this instead
|
||||
log::error!(
|
||||
error!(
|
||||
"Node with id {} not found when trying to add port with id {} to graph",
|
||||
node_id,
|
||||
port_id
|
||||
node_id, port_id
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -254,16 +314,22 @@ impl GraphView {
|
||||
}
|
||||
}
|
||||
|
||||
/// Add a link to the graph.
|
||||
///
|
||||
/// `add_link` takes three arguments: `link_id` is the id of the link as assigned by the pipewire server,
|
||||
/// `from` and `to` are the id's of the ingoing and outgoing port, respectively.
|
||||
pub fn add_link(&self, link_id: u32, link: crate::PipewireLink) {
|
||||
pub fn add_link(&self, link_id: u32, link: crate::PipewireLink, active: bool) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
private.links.borrow_mut().insert(link_id, link);
|
||||
private.links.borrow_mut().insert(link_id, (link, active));
|
||||
self.queue_draw();
|
||||
}
|
||||
|
||||
pub fn set_link_state(&self, link_id: u32, active: bool) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
if let Some((_, state)) = private.links.borrow_mut().get_mut(&link_id) {
|
||||
*state = active;
|
||||
self.queue_draw();
|
||||
} else {
|
||||
warn!("Link state changed on unknown link (id={})", link_id);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn remove_link(&self, id: u32) {
|
||||
let private = imp::GraphView::from_instance(self);
|
||||
let mut links = private.links.borrow_mut();
|
||||
@@ -272,7 +338,10 @@ impl GraphView {
|
||||
self.queue_draw();
|
||||
}
|
||||
|
||||
pub(super) fn get_node_position(&self, node: >k::Widget) -> (f32, f32) {
|
||||
/// Get the position of the specified node inside the graphview.
|
||||
///
|
||||
/// Returns `None` if the node is not in the graphview.
|
||||
pub(super) fn get_node_position(&self, node: >k::Widget) -> Option<(f32, f32)> {
|
||||
let layout_manager = self
|
||||
.layout_manager()
|
||||
.expect("Failed to get layout manager")
|
||||
@@ -280,12 +349,13 @@ impl GraphView {
|
||||
.expect("Failed to cast to FixedLayout");
|
||||
|
||||
let node = layout_manager
|
||||
.layout_child(node)
|
||||
.expect("Could not get layout child")
|
||||
.layout_child(node)?
|
||||
.dynamic_cast::<gtk::FixedLayoutChild>()
|
||||
.expect("Could not cast to FixedLayoutChild");
|
||||
let transform = node.transform().unwrap_or_default();
|
||||
transform.to_translate()
|
||||
let transform = node
|
||||
.transform()
|
||||
.expect("Failed to obtain transform from layout child");
|
||||
Some(transform.to_translate())
|
||||
}
|
||||
|
||||
pub(super) fn move_node(&self, node: >k::Widget, x: f32, y: f32) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use gtk::{glib, prelude::*, subclass::prelude::*};
|
||||
use pipewire::spa::Direction;
|
||||
|
||||
use std::{collections::HashMap, rc::Rc};
|
||||
use std::collections::HashMap;
|
||||
|
||||
mod imp {
|
||||
use super::*;
|
||||
@@ -11,9 +11,9 @@ mod imp {
|
||||
pub struct Node {
|
||||
pub(super) grid: gtk::Grid,
|
||||
pub(super) label: gtk::Label,
|
||||
pub(super) ports: RefCell<HashMap<u32, Rc<crate::view::port::Port>>>,
|
||||
pub(super) num_ports_in: Cell<u32>,
|
||||
pub(super) num_ports_out: Cell<u32>,
|
||||
pub(super) ports: RefCell<HashMap<u32, crate::view::port::Port>>,
|
||||
pub(super) num_ports_in: Cell<i32>,
|
||||
pub(super) num_ports_out: Cell<i32>,
|
||||
}
|
||||
|
||||
#[glib::object_subclass]
|
||||
@@ -81,21 +81,21 @@ impl Node {
|
||||
Direction::Input => {
|
||||
private
|
||||
.grid
|
||||
.attach(&port, 0, private.num_ports_in.get() as i32 + 1, 1, 1);
|
||||
.attach(&port, 0, private.num_ports_in.get() + 1, 1, 1);
|
||||
private.num_ports_in.set(private.num_ports_in.get() + 1);
|
||||
}
|
||||
Direction::Output => {
|
||||
private
|
||||
.grid
|
||||
.attach(&port, 1, private.num_ports_out.get() as i32 + 1, 1, 1);
|
||||
.attach(&port, 1, private.num_ports_out.get() + 1, 1, 1);
|
||||
private.num_ports_out.set(private.num_ports_out.get() + 1);
|
||||
}
|
||||
}
|
||||
|
||||
private.ports.borrow_mut().insert(id, Rc::new(port));
|
||||
private.ports.borrow_mut().insert(id, port);
|
||||
}
|
||||
|
||||
pub fn get_port(&self, id: u32) -> Option<Rc<super::port::Port>> {
|
||||
pub fn get_port(&self, id: u32) -> Option<super::port::Port> {
|
||||
let private = imp::Node::from_instance(self);
|
||||
private.ports.borrow_mut().get(&id).cloned()
|
||||
}
|
||||
|
||||
138
src/view/port.rs
138
src/view/port.rs
@@ -1,14 +1,26 @@
|
||||
use gtk::{
|
||||
gdk,
|
||||
glib::{self, subclass::Signal},
|
||||
glib::{self, clone, subclass::Signal},
|
||||
prelude::*,
|
||||
subclass::prelude::*,
|
||||
};
|
||||
use log::warn;
|
||||
use log::{trace, warn};
|
||||
use pipewire::spa::Direction;
|
||||
|
||||
use crate::MediaType;
|
||||
|
||||
/// A helper struct for linking a output port to an input port.
|
||||
/// It carries the output ports id.
|
||||
#[derive(Clone, Debug, glib::GBoxed)]
|
||||
#[gboxed(type_name = "HelvumForwardLink")]
|
||||
struct ForwardLink(u32);
|
||||
|
||||
/// A helper struct for linking an input to an output port.
|
||||
/// It carries the input ports id.
|
||||
#[derive(Clone, Debug, glib::GBoxed)]
|
||||
#[gboxed(type_name = "HelvumReversedLink")]
|
||||
struct ReversedLink(u32);
|
||||
|
||||
mod imp {
|
||||
use once_cell::{sync::Lazy, unsync::OnceCell};
|
||||
use pipewire::spa::Direction;
|
||||
@@ -18,6 +30,7 @@ mod imp {
|
||||
/// Graphical representation of a pipewire port.
|
||||
#[derive(Default)]
|
||||
pub struct Port {
|
||||
pub(super) label: OnceCell<gtk::Label>,
|
||||
pub(super) id: OnceCell<u32>,
|
||||
pub(super) direction: OnceCell<Direction>,
|
||||
}
|
||||
@@ -26,10 +39,23 @@ mod imp {
|
||||
impl ObjectSubclass for Port {
|
||||
const NAME: &'static str = "Port";
|
||||
type Type = super::Port;
|
||||
type ParentType = gtk::Button;
|
||||
type ParentType = gtk::Widget;
|
||||
|
||||
fn class_init(klass: &mut Self::Class) {
|
||||
klass.set_layout_manager_type::<gtk::BinLayout>();
|
||||
|
||||
// Make it look like a GTK button.
|
||||
klass.set_css_name("button");
|
||||
}
|
||||
}
|
||||
|
||||
impl ObjectImpl for Port {
|
||||
fn dispose(&self, _obj: &Self::Type) {
|
||||
if let Some(label) = self.label.get() {
|
||||
label.unparent()
|
||||
}
|
||||
}
|
||||
|
||||
fn signals() -> &'static [Signal] {
|
||||
static SIGNALS: Lazy<Vec<Signal>> = Lazy::new(|| {
|
||||
vec![Signal::builder(
|
||||
@@ -46,18 +72,18 @@ mod imp {
|
||||
}
|
||||
}
|
||||
impl WidgetImpl for Port {}
|
||||
impl ButtonImpl for Port {}
|
||||
}
|
||||
|
||||
glib::wrapper! {
|
||||
pub struct Port(ObjectSubclass<imp::Port>)
|
||||
@extends gtk::Button, gtk::Widget;
|
||||
@extends gtk::Widget;
|
||||
}
|
||||
|
||||
impl Port {
|
||||
pub fn new(id: u32, name: &str, direction: Direction, media_type: Option<MediaType>) -> Self {
|
||||
// Create the widget and initialize needed fields
|
||||
let res: Self = glib::Object::new(&[]).expect("Failed to create Port");
|
||||
|
||||
let private = imp::Port::from_instance(&res);
|
||||
private.id.set(id).expect("Port id already set");
|
||||
private
|
||||
@@ -65,47 +91,85 @@ impl Port {
|
||||
.set(direction)
|
||||
.expect("Port direction already set");
|
||||
|
||||
res.set_child(Some(>k::Label::new(Some(name))));
|
||||
let label = gtk::Label::new(Some(name));
|
||||
label.set_parent(&res);
|
||||
private
|
||||
.label
|
||||
.set(label)
|
||||
.expect("Port label was already set");
|
||||
|
||||
// Add either a drag source or drop target controller depending on direction,
|
||||
// they will be responsible for link creation by dragging an output port onto an input port.
|
||||
//
|
||||
// FIXME: The type used for dragging is simply a u32.
|
||||
// This means that anything that provides a u32 could be dragged onto a input port,
|
||||
// leading to that port trying to create a link to an invalid output port.
|
||||
// We should use a newtype instead of a plain u32.
|
||||
// Additionally, this does not protect against e.g. dropping an outgoing audio port on an ingoing video port.
|
||||
// Add a drag source and drop target controller with the type depending on direction,
|
||||
// they will be responsible for link creation by dragging an output port onto an input port or the other way around.
|
||||
|
||||
// FIXME: We should protect against different media types, e.g. it should not be possible to drop a video port on an audio port.
|
||||
|
||||
// The port will simply provide its pipewire id to the drag target.
|
||||
let drag_src = gtk::DragSourceBuilder::new()
|
||||
.content(&gdk::ContentProvider::for_value(&match direction {
|
||||
Direction::Input => ReversedLink(id).to_value(),
|
||||
Direction::Output => ForwardLink(id).to_value(),
|
||||
}))
|
||||
.build();
|
||||
drag_src.connect_drag_begin(move |_, _| {
|
||||
trace!("Drag started from port {}", id);
|
||||
});
|
||||
drag_src.connect_drag_cancel(move |_, _, _| {
|
||||
trace!("Drag from port {} was cancelled", id);
|
||||
false
|
||||
});
|
||||
res.add_controller(&drag_src);
|
||||
|
||||
// The drop target will accept either a `ForwardLink` or `ReversedLink` depending in its own direction,
|
||||
// and use it to emit its `port-toggled` signal.
|
||||
let drop_target = gtk::DropTarget::new(
|
||||
match direction {
|
||||
Direction::Input => ForwardLink::static_type(),
|
||||
Direction::Output => ReversedLink::static_type(),
|
||||
},
|
||||
gdk::DragAction::COPY,
|
||||
);
|
||||
match direction {
|
||||
Direction::Input => {
|
||||
let drop_target = gtk::DropTarget::new(u32::static_type(), gdk::DragAction::COPY);
|
||||
let this = res.clone();
|
||||
drop_target.connect_drop(move |drop_target, val, _, _| {
|
||||
if let Ok(source_id) = val.get::<u32>() {
|
||||
// Get the callback registered in the widget and call it
|
||||
drop_target
|
||||
.widget()
|
||||
.expect("Drop target has no widget")
|
||||
.emit_by_name("port-toggled", &[&source_id, &this.id()])
|
||||
.expect("Failed to send signal");
|
||||
} else {
|
||||
warn!("Invalid type dropped on ingoing port");
|
||||
}
|
||||
drop_target.connect_drop(
|
||||
clone!(@weak res as this => @default-panic, move |drop_target, val, _, _| {
|
||||
if let Ok(ForwardLink(source_id)) = val.get::<ForwardLink>() {
|
||||
// Get the callback registered in the widget and call it
|
||||
drop_target
|
||||
.widget()
|
||||
.expect("Drop target has no widget")
|
||||
.emit_by_name("port-toggled", &[&source_id, &this.id()])
|
||||
.expect("Failed to send signal");
|
||||
} else {
|
||||
warn!("Invalid type dropped on ingoing port");
|
||||
}
|
||||
|
||||
true
|
||||
});
|
||||
res.add_controller(&drop_target);
|
||||
true
|
||||
}),
|
||||
);
|
||||
}
|
||||
Direction::Output => {
|
||||
// The port will simply provide its pipewire id to the drag target.
|
||||
let drag_src = gtk::DragSourceBuilder::new()
|
||||
.content(&gdk::ContentProvider::for_value(&(id.to_value())))
|
||||
.build();
|
||||
res.add_controller(&drag_src);
|
||||
drop_target.connect_drop(
|
||||
clone!(@weak res as this => @default-panic, move |drop_target, val, _, _| {
|
||||
if let Ok(ReversedLink(target_id)) = val.get::<ReversedLink>() {
|
||||
// Get the callback registered in the widget and call it
|
||||
drop_target
|
||||
.widget()
|
||||
.expect("Drop target has no widget")
|
||||
.emit_by_name("port-toggled", &[&this.id(), &target_id])
|
||||
.expect("Failed to send signal");
|
||||
} else {
|
||||
warn!("Invalid type dropped on outgoing port");
|
||||
}
|
||||
|
||||
// Display a grab cursor when the mouse is over the port so the user knows it can be dragged to another port.
|
||||
res.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
||||
true
|
||||
}),
|
||||
);
|
||||
}
|
||||
}
|
||||
res.add_controller(&drop_target);
|
||||
|
||||
// Display a grab cursor when the mouse is over the port so the user knows it can be dragged to another port.
|
||||
res.set_cursor(gtk::gdk::Cursor::from_name("grab", None).as_ref());
|
||||
|
||||
// Color the port according to its media type.
|
||||
match media_type {
|
||||
|
||||
Reference in New Issue
Block a user