mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-06 19:56:42 +01:00
wip: loading lv2 gui with suil and gtk3
This commit is contained in:
parent
ef619c595a
commit
c0b1217e60
6 changed files with 516 additions and 30 deletions
|
|
@ -1,13 +1,14 @@
|
|||
[package]
|
||||
name = "suil"
|
||||
name = "suil-rs"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
gtk = "0.18.1"
|
||||
livi = "0.7.4"
|
||||
|
||||
[build-dependencies]
|
||||
bindgen = "0.69.4"
|
||||
|
||||
[dev-dependencies]
|
||||
winit = { version = "0.30.4", features = [ "x11" ] }
|
||||
livi = "0.7.4"
|
||||
|
|
|
|||
|
|
@ -60,20 +60,20 @@ impl Host {
|
|||
ui_type_uri.into_raw(),
|
||||
ui_bundle_path.into_raw(),
|
||||
ui_binary_path.into_raw(),
|
||||
features.as_ptr()
|
||||
std::ptr::null_mut(),
|
||||
)
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
||||
unsafe extern "C" fn write (
|
||||
_: *mut c_void, _: u32, _: u32, _: u32, _: *const c_void
|
||||
_controller: *mut c_void, _: u32, _: u32, _: u32, _: *const c_void
|
||||
) {
|
||||
panic!("write")
|
||||
}
|
||||
|
||||
unsafe extern "C" fn index (
|
||||
_: *mut c_void, _: *const i8
|
||||
_controller: *mut c_void, _: *const i8
|
||||
) -> u32 {
|
||||
panic!("index");
|
||||
0
|
||||
|
|
|
|||
|
|
@ -3,26 +3,43 @@ use std::sync::Arc;
|
|||
|
||||
#[test]
|
||||
fn test_lv2_ui () {
|
||||
let host = Host::new();
|
||||
let mut plugin = plugin::LV2Plugin::new("file:///home/user/.lv2/Odin2.lv2").unwrap();
|
||||
for ui in plugin.plugin.raw().uis().unwrap().iter() {
|
||||
println!("{:?}", ui.uri());
|
||||
println!("{:?}", ui.classes());
|
||||
}
|
||||
let mut features = [];
|
||||
std::mem::forget(features);
|
||||
let instance = Arc::new(host.instance(
|
||||
&mut plugin.instance.raw(),
|
||||
"http://lv2plug.in/ns/extensions/ui#Gtk3UI",
|
||||
"https://thewavewarden.com/odin2",
|
||||
"https://thewavewarden.com/odin2#ParentUI",
|
||||
"http://lv2plug.in/ns/extensions/ui#X11UI",
|
||||
"/home/user/.lv2/Odin2.lv2/Odin2.so",
|
||||
"/home/user/.lv2/Odin2.lv2/Odin2.so",
|
||||
&features,
|
||||
).unwrap());
|
||||
println!("{:?}", instance.get_widget());
|
||||
self::ui::UI::run(&instance).join();
|
||||
gtk::init().unwrap();
|
||||
//use gtk::prelude::{ApplicationExt, ApplicationExtManual};
|
||||
//let app = gtk::Application::builder().application_id("lol.tek").build();
|
||||
//app.connect_activate(move |app| {
|
||||
let host = Host::new();
|
||||
//let mut plugin = plugin::LV2Plugin::new("file:///home/user/.lv2/Odin2.lv2").unwrap();
|
||||
let mut plugin = plugin::LV2Plugin::new("file:///home/user/.lv2/Helm.lv2").unwrap();
|
||||
for ui in plugin.plugin.raw().uis().unwrap().iter() {
|
||||
println!("{:?}", ui.uri());
|
||||
println!("{:?}", ui.classes());
|
||||
}
|
||||
//let instance = Arc::new(host.instance(
|
||||
//&mut plugin,
|
||||
//"http://lv2plug.in/ns/extensions/ui#Gtk3UI",
|
||||
//"https://thewavewarden.com/odin2",
|
||||
//"https://thewavewarden.com/odin2#ParentUI",
|
||||
//"http://lv2plug.in/ns/extensions/ui#X11UI",
|
||||
//"/home/user/.lv2/Odin2.lv2/Odin2.so",
|
||||
//"/home/user/.lv2/Odin2.lv2/Odin2.so",
|
||||
//&features,
|
||||
//).unwrap());
|
||||
let instance = Arc::new(host.instance(
|
||||
&mut plugin,
|
||||
"http://lv2plug.in/ns/extensions/ui#Gtk3UI",
|
||||
"http://tytel.org/helm",
|
||||
"http://tytel.org/helm#ParentUI",
|
||||
"http://lv2plug.in/ns/extensions/ui#X11UI",
|
||||
"/home/user/.lv2/Odin2.lv2/helm.so",
|
||||
"/home/user/.lv2/Odin2.lv2/helm.so",
|
||||
&features,
|
||||
).unwrap());
|
||||
//println!("{:?}", instance.get_widget());
|
||||
//});
|
||||
//app.run();
|
||||
//self::ui::UI::run(&instance).join();
|
||||
}
|
||||
|
||||
mod ui {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue