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,
|
||||
&self.routing.module_names,
|
||||
);
|
||||
if let Some(frame) = self.module_gui.take_visualization_frame() {
|
||||
self.visualization_frame = Some(frame);
|
||||
}
|
||||
if !gui_tasks.is_empty() {
|
||||
return Task::batch(gui_tasks);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -251,6 +251,9 @@ impl Editor {
|
|||
inspector_spatial_open: false,
|
||||
inspector_analysis_open: false,
|
||||
show_network_view: false,
|
||||
visualization_frame: None,
|
||||
spiral_rotation: 0.0,
|
||||
visualizer_kind: crate::gui::editor::visualizer::VisualizerKind::Spiral,
|
||||
},
|
||||
Task::none(),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -237,6 +237,10 @@ pub struct Editor {
|
|||
pub inspector_analysis_open: 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)]
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use iced::{alignment, Alignment, Background, Color, Element, Length, Theme};
|
|||
use super::{Editor, Message, ModalState, StatusLevel};
|
||||
use crate::gui::editor::{
|
||||
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::track::TRACK_HEIGHT;
|
||||
|
|
@ -215,10 +215,13 @@ impl Editor {
|
|||
&self.tracks,
|
||||
&self.active_clips,
|
||||
),
|
||||
BottomPanelMode::Visualizer => {
|
||||
iced::widget::column![
|
||||
iced::widget::text("Visualizer").size(14),
|
||||
].spacing(4).into()
|
||||
BottomPanelMode::Visualizer => match self.visualizer_kind {
|
||||
visualizer::VisualizerKind::Spiral => {
|
||||
visualizer::spiral::view(
|
||||
self.visualization_frame.as_ref(),
|
||||
self.spiral_rotation,
|
||||
)
|
||||
}
|
||||
}
|
||||
};
|
||||
container(panel_content)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use std::collections::HashMap;
|
|||
|
||||
use iced::window;
|
||||
use iced::{Element, Task};
|
||||
use oxforge::mdk::{ModuleGuiDescriptor, ToGuiMessage};
|
||||
use oxforge::mdk::{ModuleGuiDescriptor, ToGuiMessage, VisualizationFrame};
|
||||
|
||||
use crate::editor::{Message, ModuleParamState};
|
||||
use crate::engine::{EngineCommand, EngineHandle};
|
||||
|
|
@ -15,6 +15,7 @@ pub struct ModuleGuiManager {
|
|||
module_window_manager: ModuleWindowManager,
|
||||
pending_gui_opens: std::collections::HashSet<u32>,
|
||||
pending_bridges: HashMap<u32, FramebufferGuiBridge>,
|
||||
latest_vis_frame: Option<VisualizationFrame>,
|
||||
}
|
||||
|
||||
impl ModuleGuiManager {
|
||||
|
|
@ -25,6 +26,7 @@ impl ModuleGuiManager {
|
|||
module_window_manager: ModuleWindowManager::new(),
|
||||
pending_gui_opens: std::collections::HashSet::new(),
|
||||
pending_bridges: HashMap::new(),
|
||||
latest_vis_frame: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -100,6 +102,9 @@ impl ModuleGuiManager {
|
|||
for (module_id, msg) in engine.poll_gui_messages() {
|
||||
match msg {
|
||||
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);
|
||||
}
|
||||
ToGuiMessage::Log(_) => {}
|
||||
|
|
@ -224,4 +229,8 @@ impl ModuleGuiManager {
|
|||
}
|
||||
Task::none()
|
||||
}
|
||||
|
||||
pub fn take_visualization_frame(&mut self) -> Option<VisualizationFrame> {
|
||||
self.latest_vis_frame.take()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue