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,
36 Off = 3,
38}
39#[derive(Clone, Copy, Debug, Eq, PartialEq)]
41#[repr(u8)]
42#[non_exhaustive]
43pub enum EditorPlatform {
44 Win32 = 0,
45 Cocoa = 1,
46 X11 = 2,
47 Wayland = 3,
48}
49#[derive(Clone, Debug, PartialEq)]
50pub struct EditorStatus {
51 pub platform: EditorPlatform,
52 pub scaling: EditorScaling,
53 pub visible: bool,
54 pub embedded: bool,
55 pub width: u32,
56 pub height: u32,
57 pub scale: f32,
58 pub resize_supported: bool,
59 pub scale_supported: bool,
60}
61#[derive(Clone, Debug, Eq, PartialEq)]
62pub struct EditorImage {
63 pub width: u32,
64 pub height: u32,
65 pub rgba: Vec<u8>,
66}
67impl EditorImage {
68 pub fn valid(&self) -> bool {
69 self.width > 0
70 && self.height > 0
71 && self.width <= 2048
72 && self.height <= 2048
73 && self.rgba.len() == self.width as usize * self.height as usize * 4
74 }
75}
76#[derive(Debug)]
77pub enum EditorReply {
78 Status(EditorStatus),
79 Image(EditorImage),
80}