28 lines
586 B
Rust
28 lines
586 B
Rust
use std::thread;
|
|
|
|
use godot::prelude::*;
|
|
|
|
#[derive(GodotClass)]
|
|
#[class(base=Node)]
|
|
/// Node for interacting with Pipewire
|
|
/// Intended to not be spawned manually, as the plugin will create a
|
|
struct Pipewire {
|
|
base: Base<Node>,
|
|
/// Handle for the thread running the pipewire main loop
|
|
thread_handle: Option<thread::Thread>,
|
|
}
|
|
|
|
#[godot_api]
|
|
impl INode for Pipewire {
|
|
fn init(base: Base<Node>) -> Self {
|
|
Self {
|
|
base,
|
|
thread_handle: None,
|
|
}
|
|
}
|
|
}
|
|
|
|
#[godot_api]
|
|
impl Pipewire {
|
|
pub const SINGLETON: &'static str = "Pipewire";
|
|
}
|