Wire spiral visualizer GPU pipeline into editor bottom panel
This commit is contained in:
parent
e2dadf1044
commit
e81cb7eb70
|
|
@ -207,6 +207,9 @@ impl Editor {
|
||||||
&mut self.module_params,
|
&mut self.module_params,
|
||||||
&self.routing.module_names,
|
&self.routing.module_names,
|
||||||
);
|
);
|
||||||
|
if let Some(frame) = self.module_gui.take_visualization_frame() {
|
||||||
|
self.visualization_frame = Some(frame);
|
||||||
|
}
|
||||||
if !gui_tasks.is_empty() {
|
if !gui_tasks.is_empty() {
|
||||||
return Task::batch(gui_tasks);
|
return Task::batch(gui_tasks);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,9 @@ impl Editor {
|
||||||
inspector_spatial_open: false,
|
inspector_spatial_open: false,
|
||||||
inspector_analysis_open: false,
|
inspector_analysis_open: false,
|
||||||
show_network_view: false,
|
show_network_view: false,
|
||||||
|
visualization_frame: None,
|
||||||
|
spiral_rotation: 0.0,
|
||||||
|
visualizer_kind: crate::gui::editor::visualizer::VisualizerKind::Spiral,
|
||||||
},
|
},
|
||||||
Task::none(),
|
Task::none(),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -237,6 +237,10 @@ pub struct Editor {
|
||||||
pub inspector_analysis_open: bool,
|
pub inspector_analysis_open: bool,
|
||||||
|
|
||||||
pub show_network_view: bool,
|
pub show_network_view: bool,
|
||||||
|
|
||||||
|
pub(crate) visualization_frame: Option<crate::modules::VisualizationFrame>,
|
||||||
|
pub(crate) spiral_rotation: f32,
|
||||||
|
pub(crate) visualizer_kind: crate::gui::editor::visualizer::VisualizerKind,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use iced::{alignment, Alignment, Background, Color, Element, Length, Theme};
|
||||||
use super::{Editor, Message, ModalState, StatusLevel};
|
use super::{Editor, Message, ModalState, StatusLevel};
|
||||||
use crate::gui::editor::{
|
use crate::gui::editor::{
|
||||||
clip_launcher as clip_launcher_gui, control_bar, editor_pane, inspector, mixer,
|
clip_launcher as clip_launcher_gui, control_bar, editor_pane, inspector, mixer,
|
||||||
new_track_wizard, score, step_seq, timeline, toolbar, track_header,
|
new_track_wizard, score, step_seq, timeline, toolbar, track_header, visualizer,
|
||||||
};
|
};
|
||||||
use crate::gui::theme as ui_theme;
|
use crate::gui::theme as ui_theme;
|
||||||
use crate::track::TRACK_HEIGHT;
|
use crate::track::TRACK_HEIGHT;
|
||||||
|
|
@ -215,10 +215,13 @@ impl Editor {
|
||||||
&self.tracks,
|
&self.tracks,
|
||||||
&self.active_clips,
|
&self.active_clips,
|
||||||
),
|
),
|
||||||
BottomPanelMode::Visualizer => {
|
BottomPanelMode::Visualizer => match self.visualizer_kind {
|
||||||
iced::widget::column![
|
visualizer::VisualizerKind::Spiral => {
|
||||||
iced::widget::text("Visualizer").size(14),
|
visualizer::spiral::view(
|
||||||
].spacing(4).into()
|
self.visualization_frame.as_ref(),
|
||||||
|
self.spiral_rotation,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
container(panel_content)
|
container(panel_content)
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ use std::collections::HashMap;
|
||||||
|
|
||||||
use iced::window;
|
use iced::window;
|
||||||
use iced::{Element, Task};
|
use iced::{Element, Task};
|
||||||
use oxforge::mdk::{ModuleGuiDescriptor, ToGuiMessage};
|
use oxforge::mdk::{ModuleGuiDescriptor, ToGuiMessage, VisualizationFrame};
|
||||||
|
|
||||||
use crate::editor::{Message, ModuleParamState};
|
use crate::editor::{Message, ModuleParamState};
|
||||||
use crate::engine::{EngineCommand, EngineHandle};
|
use crate::engine::{EngineCommand, EngineHandle};
|
||||||
|
|
@ -15,6 +15,7 @@ pub struct ModuleGuiManager {
|
||||||
module_window_manager: ModuleWindowManager,
|
module_window_manager: ModuleWindowManager,
|
||||||
pending_gui_opens: std::collections::HashSet<u32>,
|
pending_gui_opens: std::collections::HashSet<u32>,
|
||||||
pending_bridges: HashMap<u32, FramebufferGuiBridge>,
|
pending_bridges: HashMap<u32, FramebufferGuiBridge>,
|
||||||
|
latest_vis_frame: Option<VisualizationFrame>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ModuleGuiManager {
|
impl ModuleGuiManager {
|
||||||
|
|
@ -25,6 +26,7 @@ impl ModuleGuiManager {
|
||||||
module_window_manager: ModuleWindowManager::new(),
|
module_window_manager: ModuleWindowManager::new(),
|
||||||
pending_gui_opens: std::collections::HashSet::new(),
|
pending_gui_opens: std::collections::HashSet::new(),
|
||||||
pending_bridges: HashMap::new(),
|
pending_bridges: HashMap::new(),
|
||||||
|
latest_vis_frame: None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,6 +102,9 @@ impl ModuleGuiManager {
|
||||||
for (module_id, msg) in engine.poll_gui_messages() {
|
for (module_id, msg) in engine.poll_gui_messages() {
|
||||||
match msg {
|
match msg {
|
||||||
ToGuiMessage::VisualizationData { data } => {
|
ToGuiMessage::VisualizationData { data } => {
|
||||||
|
if let Some(frame) = VisualizationFrame::deserialize(&data) {
|
||||||
|
self.latest_vis_frame = Some(frame);
|
||||||
|
}
|
||||||
self.module_window_manager.receive_visualization(module_id, data);
|
self.module_window_manager.receive_visualization(module_id, data);
|
||||||
}
|
}
|
||||||
ToGuiMessage::Log(_) => {}
|
ToGuiMessage::Log(_) => {}
|
||||||
|
|
@ -224,4 +229,8 @@ impl ModuleGuiManager {
|
||||||
}
|
}
|
||||||
Task::none()
|
Task::none()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn take_visualization_frame(&mut self) -> Option<VisualizationFrame> {
|
||||||
|
self.latest_vis_frame.take()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue