vst_audio_protocol/
editor.rs1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum ParentWindow {
6 Win32 { hwnd: u64 },
8 X11 { window: u64 },
10}
11
12#[derive(Clone, Debug, PartialEq)]
13pub enum EditorAction {
14 Show,
15 Hide,
16 Focus,
17 Resize { width: u32, height: u32 },
18 Scale(f32),
19 Inspect,
20 Capture,
21}
22#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24#[repr(u8)]
25#[non_exhaustive]
26pub enum EditorScaling {
27 #[default]
30 Auto = 0,
31 Plugin = 1,
33 Stretch = 2,
38 Off = 3,
40}
41#[derive(Clone, Copy, Debug, Eq, PartialEq)]
43#[repr(u8)]
44#[non_exhaustive]
45pub enum EditorPlatform {
46 Win32 = 0,
47 Cocoa = 1,
48 X11 = 2,
49 Wayland = 3,
50}
51#[derive(Clone, Debug, PartialEq)]
52pub struct EditorStatus {
53 pub platform: EditorPlatform,
54 pub scaling: EditorScaling,
55 pub visible: bool,
56 pub embedded: bool,
57 pub width: u32,
60 pub height: u32,
61 pub scale: f32,
62 pub resize_supported: bool,
63 pub scale_supported: bool,
64}
65#[derive(Clone, Debug, Eq, PartialEq)]
66pub struct EditorImage {
67 pub width: u32,
68 pub height: u32,
69 pub rgba: Vec<u8>,
70}
71impl EditorImage {
72 pub fn valid(&self) -> bool {
73 self.width > 0
74 && self.height > 0
75 && self.width <= 2048
76 && self.height <= 2048
77 && self.rgba.len() == self.width as usize * self.height as usize * 4
78 }
79}
80#[derive(Debug)]
81pub enum EditorReply {
82 Status(EditorStatus),
83 Image(EditorImage),
84}