From 1f816f1765a05582de95033b057b46a1d6f27338 Mon Sep 17 00:00:00 2001 From: Haze Weathers Date: Wed, 17 Sep 2025 01:20:35 -0600 Subject: [PATCH] dfpworm gui start --- Cargo.lock | 683 +++++++++++++++++++++++++++++++++- Cargo.toml | 2 +- plugins/dfpworm/Cargo.toml | 2 +- plugins/dfpworm/src/editor.rs | 131 +++++++ plugins/dfpworm/src/lib.rs | 15 +- 5 files changed, 809 insertions(+), 24 deletions(-) create mode 100644 plugins/dfpworm/src/editor.rs diff --git a/Cargo.lock b/Cargo.lock index d0b46c7..0a8a0f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,22 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "ab_glyph" +version = "0.2.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e074464580a518d16a7126262fffaaa47af89d4099d4cb403f8ed938ba12ee7d" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "366ffbaa4442f4684d91e2cd7c5ea7c4ed8add41959a31447066e279e432b618" + [[package]] name = "accesskit" version = "0.11.2" @@ -146,6 +162,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "170433209e817da6aae2c51aa0dd443009a613425dd041ebfb2492d1c4c11a25" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "arrayvec" version = "0.7.6" @@ -415,6 +440,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "baseview" +version = "0.1.0" +source = "git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25#1d9806d5bd92275d0d8142d9c9c90198757b9b25" +dependencies = [ + "cocoa", + "core-foundation", + "keyboard-types", + "nix 0.22.3", + "objc", + "raw-window-handle 0.4.3", + "uuid", + "winapi", + "x11", + "xcb 0.9.0", + "xcb-util", +] + [[package]] name = "baseview" version = "0.1.0" @@ -425,11 +468,11 @@ dependencies = [ "keyboard-types", "nix 0.22.3", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "uuid", "winapi", "x11", - "xcb", + "xcb 0.9.0", "xcb-util", ] @@ -445,6 +488,10 @@ version = "2.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2261d10cca569e4643e526d8dc2e62e433cc8aba21ab764233731f8d369bf394" +[[package]] +name = "blep" +version = "0.1.0" + [[package]] name = "block" version = "0.1.6" @@ -678,6 +725,20 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "copypasta" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" +dependencies = [ + "clipboard-win", + "objc", + "objc-foundation", + "objc_id", + "smithay-clipboard", + "x11-clipboard 0.5.3", +] + [[package]] name = "copypasta" version = "0.8.2" @@ -688,7 +749,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "x11-clipboard", + "x11-clipboard 0.7.1", ] [[package]] @@ -861,6 +922,12 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "cty" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" + [[package]] name = "deranged" version = "0.5.3" @@ -900,7 +967,7 @@ version = "0.1.0" dependencies = [ "atomic_float 1.1.0", "nih_plug", - "nih_plug_vizia", + "nih_plug_iced", ] [[package]] @@ -930,6 +997,21 @@ dependencies = [ "syn 2.0.106", ] +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + [[package]] name = "dtoa" version = "1.0.10" @@ -945,6 +1027,12 @@ dependencies = [ "dtoa", ] +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + [[package]] name = "enumflags2" version = "0.7.12" @@ -982,6 +1070,15 @@ dependencies = [ "windows-sys 0.61.0", ] +[[package]] +name = "euclid" +version = "0.22.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9cdb4b747e485a12abb0e6566612956c7a1bafa3bdb8d682c5b6d403589e48" +dependencies = [ + "num-traits", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -1053,7 +1150,7 @@ dependencies = [ "bitflags 2.9.4", "fnv", "generational-arena", - "glow", + "glow 0.12.3", "image", "imgref", "lru", @@ -1137,7 +1234,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af8d8cbea8f21307d7e84bca254772981296f058a1d36b461bf4d83a7499fc9e" dependencies = [ "log", - "memmap2", + "memmap2 0.6.2", "slotmap", "tinyvec", "ttf-parser 0.19.2", @@ -1158,12 +1255,49 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "futures" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + [[package]] name = "futures-core" version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +[[package]] +name = "futures-executor" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", + "num_cpus", +] + [[package]] name = "futures-io" version = "0.3.31" @@ -1198,6 +1332,17 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "futures-macro" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + [[package]] name = "futures-sink" version = "0.3.31" @@ -1216,8 +1361,10 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ + "futures-channel", "futures-core", "futures-io", + "futures-macro", "futures-sink", "futures-task", "memchr", @@ -1324,6 +1471,27 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "glam" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579160312273c954cc51bd440f059dde741029ac8daf8c84fece76cb77f62c15" +dependencies = [ + "version_check", +] + +[[package]] +name = "glow" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +dependencies = [ + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "glow" version = "0.12.3" @@ -1336,6 +1504,18 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glow_glyph" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f4e62c64947b9a24fe20e2bba9ad819ecb506ef5c8df7ffc4737464c6df9510" +dependencies = [ + "bytemuck", + "glow 0.11.2", + "glyph_brush", + "log", +] + [[package]] name = "glutin" version = "0.30.10" @@ -1353,7 +1533,7 @@ dependencies = [ "libloading", "objc2", "once_cell", - "raw-window-handle", + "raw-window-handle 0.5.2", "windows-sys 0.45.0", "x11-dl", ] @@ -1366,7 +1546,7 @@ checksum = "629a873fc04062830bfe8f97c03773bcd7b371e23bcc465d0a61448cd1588fa4" dependencies = [ "cfg_aliases", "glutin", - "raw-window-handle", + "raw-window-handle 0.5.2", "winit", ] @@ -1399,6 +1579,44 @@ dependencies = [ "gl_generator", ] +[[package]] +name = "glyph_brush" +version = "0.7.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0060f4ed4ef64a5876d9836d7d6c9ed43a463f3ca431682bec1c326064c8c93e" +dependencies = [ + "glyph_brush_draw_cache", + "glyph_brush_layout", + "ordered-float", + "rustc-hash 2.1.1", + "twox-hash 2.1.2", +] + +[[package]] +name = "glyph_brush_draw_cache" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb6c910def52365fef3f439a6b50a4d5c11b28eec4cf6c191f6dfea18e88d7f" +dependencies = [ + "ab_glyph", + "crossbeam-channel", + "crossbeam-deque", + "linked-hash-map", + "rayon", + "rustc-hash 2.1.1", +] + +[[package]] +name = "glyph_brush_layout" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1e288bfd2f6c0313f78bf5aa538356ad481a3bb97e9b7f93220ab0066c5992" +dependencies = [ + "ab_glyph", + "approx", + "xi-unicode", +] + [[package]] name = "goblin" version = "0.6.1" @@ -1467,6 +1685,91 @@ dependencies = [ "cc", ] +[[package]] +name = "iced_baseview" +version = "0.0.3" +source = "git+https://github.com/robbert-vdh/iced_baseview.git?branch=feature%2Fupdate-baseview#df3a852a15cf0e9fcc8d2b32f5718e56780beaf3" +dependencies = [ + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25)", + "copypasta 0.7.1", + "iced_core", + "iced_futures", + "iced_glow", + "iced_graphics", + "iced_native", + "keyboard-types", + "raw-window-handle 0.4.3", +] + +[[package]] +name = "iced_core" +version = "0.4.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "bitflags 1.3.2", + "wasm-timer", +] + +[[package]] +name = "iced_futures" +version = "0.3.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "futures", + "log", + "wasm-bindgen-futures", + "wasm-timer", +] + +[[package]] +name = "iced_glow" +version = "0.2.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "bytemuck", + "euclid", + "glow 0.11.2", + "glow_glyph", + "glyph_brush", + "iced_graphics", + "iced_native", + "log", +] + +[[package]] +name = "iced_graphics" +version = "0.2.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "bytemuck", + "glam", + "iced_native", + "iced_style", + "raw-window-handle 0.4.3", + "thiserror", +] + +[[package]] +name = "iced_native" +version = "0.4.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "iced_core", + "iced_futures", + "iced_style", + "num-traits", + "twox-hash 1.6.3", + "unicode-segmentation", +] + +[[package]] +name = "iced_style" +version = "0.3.0" +source = "git+https://github.com/iced-rs/iced.git?rev=a53fa91e0ddf374bbeb66d5e831b79127ed47a9d#a53fa91e0ddf374bbeb66d5e831b79127ed47a9d" +dependencies = [ + "iced_core", +] + [[package]] name = "image" version = "0.24.9" @@ -1630,6 +1933,12 @@ dependencies = [ "redox_syscall 0.5.17", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.3.8" @@ -1691,6 +2000,15 @@ version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + [[package]] name = "memmap2" version = "0.6.2" @@ -1774,7 +2092,7 @@ dependencies = [ "jni-sys", "ndk-sys", "num_enum 0.5.11", - "raw-window-handle", + "raw-window-handle 0.5.2", "thiserror", ] @@ -1828,8 +2146,8 @@ dependencies = [ "nih_log", "nih_plug_derive", "objc", - "parking_lot", - "raw-window-handle", + "parking_lot 0.12.4", + "raw-window-handle 0.5.2", "serde", "serde_json", "vst3-sys", @@ -1852,12 +2170,27 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "nih_plug_iced" +version = "0.0.0" +source = "git+https://github.com/robbert-vdh/nih-plug.git#28b149ec4d62757d0b448809148a0c3ca6e09a95" +dependencies = [ + "atomic_refcell", + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=1d9806d5bd92275d0d8142d9c9c90198757b9b25)", + "crossbeam", + "iced_baseview", + "nih_plug", + "nih_plug_assets", + "raw-window-handle 0.4.3", + "serde", +] + [[package]] name = "nih_plug_vizia" version = "0.0.0" source = "git+https://github.com/robbert-vdh/nih-plug.git#28b149ec4d62757d0b448809148a0c3ca6e09a95" dependencies = [ - "baseview", + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=2c1b1a7b0fef1a29a5150a6a8f6fef6a0cbab8c4)", "crossbeam", "nih_plug", "nih_plug_assets", @@ -1930,6 +2263,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91df4bbde75afed763b708b7eee1e8e7651e02d97f6d5dd763e89367e957b23b" +dependencies = [ + "hermit-abi 0.5.2", + "libc", +] + [[package]] name = "num_enum" version = "0.5.11" @@ -2060,6 +2403,15 @@ dependencies = [ "libredox", ] +[[package]] +name = "ordered-float" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2c1f9f56e534ac6a9b8a4600bdf0f530fb393b5f393e7b4d03489c3cf0c3f01" +dependencies = [ + "num-traits", +] + [[package]] name = "ordered-stream" version = "0.2.0" @@ -2070,12 +2422,32 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "owned_ttf_parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36820e9051aca1014ddc75770aab4d68bc1e9e632f0f5627c4086bc216fb583b" +dependencies = [ + "ttf-parser 0.25.1", +] + [[package]] name = "parking" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" +[[package]] +name = "parking_lot" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +dependencies = [ + "instant", + "lock_api", + "parking_lot_core 0.8.6", +] + [[package]] name = "parking_lot" version = "0.12.4" @@ -2083,7 +2455,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ "lock_api", - "parking_lot_core", + "parking_lot_core 0.9.11", +] + +[[package]] +name = "parking_lot_core" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +dependencies = [ + "cfg-if", + "instant", + "libc", + "redox_syscall 0.2.16", + "smallvec", + "winapi", ] [[package]] @@ -2317,6 +2703,15 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-xml" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.40" @@ -2357,6 +2752,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + [[package]] name = "rand_chacha" version = "0.2.2" @@ -2377,6 +2782,16 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + [[package]] name = "rand_core" version = "0.5.1" @@ -2395,6 +2810,15 @@ dependencies = [ "getrandom 0.2.16", ] +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + [[package]] name = "rand_hc" version = "0.2.0" @@ -2419,12 +2843,41 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7e49bb0bf967717f7bd674458b3d6b0c5f48ec7e3038166026a69fc22223" +[[package]] +name = "raw-window-handle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" +dependencies = [ + "cty", +] + [[package]] name = "raw-window-handle" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "rayon" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "368f01d005bf8fd9b1206fb6fa653e6c4a81ceb1466406b81792d87c5677a58f" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + [[package]] name = "read-fonts" version = "0.22.7" @@ -2435,6 +2888,15 @@ dependencies = [ "font-types", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -2596,6 +3058,12 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -2795,6 +3263,34 @@ version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +[[package]] +name = "smithay-client-toolkit" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" +dependencies = [ + "bitflags 1.3.2", + "dlib", + "lazy_static", + "log", + "memmap2 0.5.10", + "nix 0.24.3", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", +] + +[[package]] +name = "smithay-clipboard" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a345c870a1fae0b1b779085e81b51e614767c239e93503588e54c5b17f4b0e8" +dependencies = [ + "smithay-client-toolkit", + "wayland-client", +] + [[package]] name = "socket2" version = "0.4.10" @@ -3029,6 +3525,31 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49d64318d8311fc2668e48b63969f4343e0a85c4a109aa8460d6672e364b8bd1" +[[package]] +name = "ttf-parser" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2df906b07856748fa3f6e0ad0cbaa047052d4a7dd609e231c4f72cee8c36f31" + +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + +[[package]] +name = "twox-hash" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ea3136b675547379c4bd395ca6b938e5ad3c3d20fad76e7fe85f9e0d011419c" +dependencies = [ + "rand 0.9.2", +] + [[package]] name = "type-map" version = "0.5.1" @@ -3176,10 +3697,10 @@ name = "vizia_baseview" version = "0.1.0" source = "git+https://github.com/robbert-vdh/vizia.git?tag=patched-2024-05-06#e3fab5530cda9cb90f679508d9f058bd62189d36" dependencies = [ - "baseview", + "baseview 0.1.0 (git+https://github.com/RustAudio/baseview.git?rev=2c1b1a7b0fef1a29a5150a6a8f6fef6a0cbab8c4)", "femtovg", "lazy_static", - "raw-window-handle", + "raw-window-handle 0.5.2", "vizia_core", "vizia_id", "vizia_input", @@ -3193,7 +3714,7 @@ dependencies = [ "accesskit", "bitflags 2.9.4", "chrono", - "copypasta", + "copypasta 0.8.2", "cosmic-text", "femtovg", "fluent-bundle", @@ -3282,11 +3803,11 @@ dependencies = [ "accesskit", "accesskit_winit", "console_error_panic_hook", - "copypasta", + "copypasta 0.8.2", "femtovg", "glutin", "glutin-winit", - "raw-window-handle", + "raw-window-handle 0.5.2", "vizia_core", "vizia_id", "vizia_input", @@ -3397,6 +3918,19 @@ dependencies = [ "wasm-bindgen-shared", ] +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ca85039a9b469b38336411d6d6ced91f3fc87109a2a27b0c197663f5144dffe" +dependencies = [ + "cfg-if", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + [[package]] name = "wasm-bindgen-macro" version = "0.2.101" @@ -3429,6 +3963,72 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-timer" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be0ecb0db480561e9a7642b5d3e4187c128914e58aa84330b9493e3eb68c5e7f" +dependencies = [ + "futures", + "js-sys", + "parking_lot 0.11.2", + "pin-utils", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wayland-client" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3b068c05a039c9f755f881dc50f01732214f5685e379829759088967c46715" +dependencies = [ + "bitflags 1.3.2", + "downcast-rs", + "libc", + "nix 0.24.3", + "scoped-tls", + "wayland-commons", + "wayland-scanner", + "wayland-sys", +] + +[[package]] +name = "wayland-commons" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" +dependencies = [ + "nix 0.24.3", + "once_cell", + "smallvec", + "wayland-sys", +] + +[[package]] +name = "wayland-cursor" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" +dependencies = [ + "nix 0.24.3", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b950621f9354b322ee817a23474e479b34be96c2e909c14f7bc0100e9a970bc6" +dependencies = [ + "bitflags 1.3.2", + "wayland-client", + "wayland-commons", + "wayland-scanner", +] + [[package]] name = "wayland-scanner" version = "0.29.5" @@ -3440,6 +4040,17 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "wayland-sys" +version = "0.29.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be12ce1a3c39ec7dba25594b97b42cb3195d54953ddb9d3d95a7c3902bc6e9d4" +dependencies = [ + "dlib", + "lazy_static", + "pkg-config", +] + [[package]] name = "web-sys" version = "0.3.78" @@ -3832,7 +4443,7 @@ dependencies = [ "once_cell", "orbclient", "percent-encoding", - "raw-window-handle", + "raw-window-handle 0.5.2", "redox_syscall 0.3.5", "wasm-bindgen", "wayland-scanner", @@ -3866,6 +4477,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11-clipboard" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" +dependencies = [ + "xcb 0.10.1", +] + [[package]] name = "x11-clipboard" version = "0.7.1" @@ -3919,6 +4539,17 @@ dependencies = [ "x11", ] +[[package]] +name = "xcb" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" +dependencies = [ + "libc", + "log", + "quick-xml", +] + [[package]] name = "xcb-util" version = "0.3.0" @@ -3926,9 +4557,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43893e47f27bf7d81d489feef3a0e34a457e90bc314b7e74ad9bb3980e4c1c48" dependencies = [ "libc", - "xcb", + "xcb 0.9.0", ] +[[package]] +name = "xcursor" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bec9e4a500ca8864c5b47b8b482a73d62e4237670e5b5f1d6b9e3cae50f28f2b" + [[package]] name = "xdg-home" version = "1.3.0" @@ -3939,6 +4576,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "xi-unicode" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" + [[package]] name = "xml-rs" version = "0.8.27" diff --git a/Cargo.toml b/Cargo.toml index 7146d8a..e131829 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "3" members = [ "xtask", "plugins/dfpworm", - "plugins/gain", + "plugins/gain", "plugins/blep", ] [profile.release] diff --git a/plugins/dfpworm/Cargo.toml b/plugins/dfpworm/Cargo.toml index c68e1ca..12be183 100644 --- a/plugins/dfpworm/Cargo.toml +++ b/plugins/dfpworm/Cargo.toml @@ -9,4 +9,4 @@ crate-type = ["cdylib"] [dependencies] atomic_float = "1.1" nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } -nih_plug_vizia = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } +nih_plug_iced = { git = "https://github.com/robbert-vdh/nih-plug.git", version = "0.0.0" } diff --git a/plugins/dfpworm/src/editor.rs b/plugins/dfpworm/src/editor.rs new file mode 100644 index 0000000..dc33210 --- /dev/null +++ b/plugins/dfpworm/src/editor.rs @@ -0,0 +1,131 @@ +use std::sync::Arc; + +use atomic_float::AtomicF32; +use nih_plug::editor::Editor; +use nih_plug::prelude::GuiContext; +use nih_plug_iced::widgets as nih_widgets; +use nih_plug_iced::*; + +use crate::WormParams; + +pub(crate) fn default_state() -> Arc { + IcedState::from_size(200, 215) +} + +pub(crate) fn create( + params: Arc, + editor_state: Arc, +) -> Option> { + create_iced_editor::(editor_state, params) +} + +#[derive(Debug, Clone, Copy)] +enum Message { + // Update a parameter's value. + ParamUpdate(nih_widgets::ParamMessage), +} + +struct WormEditor { + params: Arc, + context: Arc, + + increase_slider_state: nih_widgets::param_slider::State, + decrease_slider_state: nih_widgets::param_slider::State, +} + +impl IcedEditor for WormEditor { + type Executor = executor::Default; + + type Message = Message; + + type InitializationFlags = Arc; + + fn new( + params: Self::InitializationFlags, + context: Arc, + ) -> (Self, Command) { + let editor = WormEditor { + params, + context, + increase_slider_state: Default::default(), + decrease_slider_state: Default::default(), + }; + + (editor, Command::none()) + } + + fn context(&self) -> &dyn nih_plug::prelude::GuiContext { + self.context.as_ref() + } + + fn update( + &mut self, + window: &mut WindowQueue, + message: Self::Message, + ) -> Command { + match message { + Message::ParamUpdate(message) => self.handle_param_message(message), + } + + Command::none() + } + + fn view(&mut self) -> Element<'_, Self::Message> { + Column::new() + .align_items(Alignment::Start) + .push( + Text::new("Dirty Frying Pan Worm") + .font(assets::NOTO_SANS_LIGHT) + .size(40) + .width(Length::Fill) + .height(50.into()) + .horizontal_alignment(alignment::Horizontal::Center) + .vertical_alignment(alignment::Vertical::Top), + ) + .push( + Row::new() + .align_items(Alignment::Fill) + .push( + // Response Increase Parameter + Column::new() + .align_items(Alignment::Start) + .push( + Text::new("Aggression") + .font(assets::NOTO_SANS_THIN) + .width(Length::Fill) + .height(20.into()) + .horizontal_alignment(alignment::Horizontal::Center) + .vertical_alignment(alignment::Vertical::Center), + ) + .push( + nih_widgets::ParamSlider::new( + &mut self.increase_slider_state, + &self.params.response_increase, + ) + .map(Message::ParamUpdate), + ), + ) + .push( + // Response Decrease Parameter + Column::new() + .align_items(Alignment::Start) + .push( + Text::new("Regression") + .font(assets::NOTO_SANS_THIN) + .width(Length::Fill) + .height(20.into()) + .horizontal_alignment(alignment::Horizontal::Center) + .vertical_alignment(alignment::Vertical::Center), + ) + .push( + nih_widgets::ParamSlider::new( + &mut self.decrease_slider_state, + &self.params.response_increase, + ) + .map(Message::ParamUpdate), + ), + ), + ) + .into() + } +} diff --git a/plugins/dfpworm/src/lib.rs b/plugins/dfpworm/src/lib.rs index 8a6a3ae..3d9ccba 100644 --- a/plugins/dfpworm/src/lib.rs +++ b/plugins/dfpworm/src/lib.rs @@ -1,8 +1,10 @@ use std::sync::Arc; use nih_plug::prelude::*; +use nih_plug_iced::IcedState; mod dfpwm; +mod editor; pub struct Worm { params: Arc, @@ -13,10 +15,13 @@ pub struct Worm { #[derive(Params)] struct WormParams { + #[persist = "editor-state"] + editor_state: Arc, + #[id = "response-increase"] - response_increase: FloatParam, + pub response_increase: FloatParam, #[id = "response-decrease"] - response_decrease: FloatParam, + pub response_decrease: FloatParam, } impl Default for Worm { @@ -33,6 +38,8 @@ impl Default for Worm { impl Default for WormParams { fn default() -> Self { Self { + editor_state: editor::default_state(), + response_increase: FloatParam::new( "Response Increase", dfpwm::DEFAULT_RESPONSE_INCREASE, @@ -82,6 +89,10 @@ impl Plugin for Worm { self.params.clone() } + fn editor(&mut self, async_executor: AsyncExecutor) -> Option> { + editor::create(self.params.clone(), self.params.editor_state.clone()) + } + fn initialize( &mut self, audio_io_layout: &AudioIOLayout,