Skip to content

Commit

Permalink
coupler-reflector: rename EditorWindow to PluginWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
micahrj committed Nov 29, 2024
1 parent cc1a609 commit ef908ed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
20 changes: 10 additions & 10 deletions coupler-reflector/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ use reflector::platform::{
WindowOptions,
};

struct EditorState {
struct State {
framebuffer: Vec<u32>,
}

impl EditorState {
fn new() -> EditorState {
EditorState {
impl State {
fn new() -> State {
State {
framebuffer: Vec::new(),
}
}
Expand All @@ -34,14 +34,14 @@ impl EditorState {
}
}

pub struct EditorWindow {
pub struct PluginWindow {
#[allow(unused)]
app: App,
window: Window,
}

impl EditorWindow {
pub fn open(parent: &ParentWindow, size: Size) -> Result<EditorWindow> {
impl PluginWindow {
pub fn open(parent: &ParentWindow, size: Size) -> Result<PluginWindow> {
let app = AppOptions::new().mode(AppMode::Guest).build()?;

let mut options = WindowOptions::new();
Expand All @@ -54,16 +54,16 @@ impl EditorWindow {
};
unsafe { options.raw_parent(raw_parent) };

let mut state = EditorState::new();
let mut state = State::new();
let window = options.open(app.handle(), move |cx, event| state.handle_event(cx, event))?;

window.show();

Ok(EditorWindow { app, window })
Ok(PluginWindow { app, window })
}
}

impl Editor for EditorWindow {
impl Editor for PluginWindow {
fn size(&self) -> Size {
let size = self.window.size();

Expand Down
6 changes: 3 additions & 3 deletions examples/gain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use coupler::format::clap::*;
use coupler::format::vst3::*;
use coupler::{buffers::*, bus::*, editor::*, engine::*, events::*, host::*, params::*, plugin::*};

use coupler_reflector::EditorWindow;
use coupler_reflector::PluginWindow;

#[derive(Params, Serialize, Deserialize, Clone)]
struct GainParams {
Expand All @@ -26,7 +26,7 @@ pub struct Gain {

impl Plugin for Gain {
type Engine = GainEngine;
type Editor = EditorWindow;
type Editor = PluginWindow;

fn info() -> PluginInfo {
PluginInfo {
Expand Down Expand Up @@ -90,7 +90,7 @@ impl Plugin for Gain {
height: 512.0,
};

EditorWindow::open(parent, size).unwrap()
PluginWindow::open(parent, size).unwrap()
}
}

Expand Down

0 comments on commit ef908ed

Please sign in to comment.