add missing enum variants and types

This commit is contained in:
jess 2026-03-30 21:46:58 -07:00
parent c9443d5877
commit d7c54c770b
6 changed files with 58 additions and 1 deletions

View File

@ -41,6 +41,9 @@ pub enum Action {
EditorToggleCycle,
EditorToggleMetronome,
// Quantize
Quantize,
// Editor zoom
ZoomInH,
ZoomOutH,

View File

@ -59,24 +59,30 @@ use crate::waveform::WaveformCache;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Tool {
Pointer,
Pencil,
Eraser,
Scissors,
Glue,
Zoom,
}
impl Tool {
pub const ALL: [Tool; 4] = [
pub const ALL: [Tool; 6] = [
Tool::Pointer,
Tool::Pencil,
Tool::Eraser,
Tool::Scissors,
Tool::Glue,
Tool::Zoom,
];
pub fn hint(&self) -> &'static str {
match self {
Tool::Pointer => "Pointer",
Tool::Pencil => "Pencil",
Tool::Eraser => "Eraser",
Tool::Scissors => "Scissors",
Tool::Glue => "Glue",
Tool::Zoom => "Zoom",
}
}
@ -89,6 +95,7 @@ pub enum BottomPanelMode {
StepSequencer,
ScoreEditor,
ClipLauncher,
Visualizer,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
@ -294,6 +301,8 @@ pub enum Message {
LoadPluginOnTrack(usize, PathBuf),
SetAnalysisFftSize(usize),
SetHilbertFftSize(usize),
SetVisualizerBufferSize(usize),
ShowExportDialog,
ExportFormatSelected(ExportFormat),
@ -474,6 +483,8 @@ impl Editor {
| Message::HideModulePicker
| Message::LoadPluginOnTrack(_, _)
| Message::SetAnalysisFftSize(_)
| Message::SetHilbertFftSize(_)
| Message::SetVisualizerBufferSize(_)
| Message::ExpandModule(_)
| Message::CollapseModule
| Message::SetModuleParam { .. }

View File

@ -49,6 +49,14 @@ impl Editor {
engine.send(EngineCommand::SetHilbertFftSize { size });
}
}
Message::SetHilbertFftSize(size) => {
self.analysis_fft_size = size;
if let Some(ref engine) = self.engine {
engine.send(EngineCommand::SetHilbertFftSize { size });
}
}
Message::SetVisualizerBufferSize(_size) => {
}
Message::ExpandModule(module_id) => {
if self.module_params.expanded == Some(module_id) {
self.module_params.expanded = None;

View File

@ -8,6 +8,14 @@ use iced::widget::{
use iced::{Background, Color, Element, Length, Theme};
use std::collections::HashMap;
pub struct InspectorSections {
pub signal: bool,
pub sends: bool,
pub automation: bool,
pub spatial: bool,
pub analysis: bool,
}
pub fn view<'a>(
selected_track: Option<&'a Track>,
project_config: &'a ProjectConfig,

View File

@ -39,6 +39,32 @@ pub enum Message {
RegionSplit { track_index: usize, region_id: Uuid, split_sample: u64 },
RegionDelete { track_index: usize, region_id: Uuid },
DeselectAll,
RegionDragging { region_id: Uuid, track_index: usize, new_start: MusicalTime, new_start_sample: u64 },
RegionDragEnd { region_id: Uuid, old_track: usize, new_track: usize, old_start: MusicalTime, new_start: MusicalTime, old_start_sample: u64, new_start_sample: u64 },
TempoPointAdded { sample_pos: u64, tempo: f32 },
TempoPointMoved { index: usize, sample_pos: u64, tempo: f32 },
TempoPointRemoved { index: usize },
SetRegionPlaybackRate { track_index: usize, region_id: Uuid, rate: f32 },
SetRegionFade { track_index: usize, region_id: Uuid, fade_in_samples: u64, fade_out_samples: u64 },
SetCycleRange { start_bar: u32, end_bar: u32 },
SetActiveTake { track_index: usize, folder_id: Uuid, take_index: usize },
DeleteTake { track_index: usize, folder_id: Uuid, take_index: usize },
CycleTake { track_index: usize, folder_id: Uuid },
CreateMidiRegion { track_index: usize, start_time: MusicalTime, duration: MusicalTime, start_sample: u64, length_samples: u64 },
AutomationPointAdded { track_index: usize, lane_index: usize, sample_pos: u64, value: f32 },
AutomationPointMoved { track_index: usize, lane_index: usize, point_index: usize, sample_pos: u64, value: f32 },
AutomationPointRemoved { track_index: usize, lane_index: usize, point_index: usize },
AddMarker(MusicalTime),
DeleteMarker(u32),
JumpToMarker(u32),
}
pub fn view<'a>(

View File

@ -14,6 +14,7 @@ pub enum Message {
PanChanged(f32),
Delete,
Select,
FreezeToggled,
}
pub fn view<'a>(track: &'a Track, icons: &'a IconSet, height: f32) -> Element<'a, Message> {