fixing linux stuff
This commit is contained in:
@@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file.
|
|||||||
### Added
|
### Added
|
||||||
- Mute/solo for patterns: stage with `m`/`x`, commit with `c`. Solo mutes all other patterns. Clear with `M`/`X`.
|
- Mute/solo for patterns: stage with `m`/`x`, commit with `c`. Solo mutes all other patterns. Clear with `M`/`X`.
|
||||||
- Lookahead scheduling: scripts are pre-evaluated ahead of time and audio commands are scheduled at precise beat positions, improving timing accuracy under CPU load.
|
- Lookahead scheduling: scripts are pre-evaluated ahead of time and audio commands are scheduled at precise beat positions, improving timing accuracy under CPU load.
|
||||||
|
- Realtime thread scheduling (`SCHED_FIFO`) for sequencer thread on Unix systems, improving timing reliability.
|
||||||
|
|
||||||
## [0.0.4] - 2026-02-02
|
## [0.0.4] - 2026-02-02
|
||||||
|
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: surface0,
|
info_bg: surface0,
|
||||||
info_fg: text,
|
info_fg: text,
|
||||||
event_rgb: (225, 215, 240),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(210, 235, 220),
|
playing_bg: Color::Rgb(210, 235, 220),
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: surface0,
|
info_bg: surface0,
|
||||||
info_fg: text,
|
info_fg: text,
|
||||||
event_rgb: (55, 45, 70),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(35, 55, 45),
|
playing_bg: Color::Rgb(35, 55, 45),
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: current_line,
|
info_bg: current_line,
|
||||||
info_fg: foreground,
|
info_fg: foreground,
|
||||||
event_rgb: (70, 55, 85),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(40, 65, 50),
|
playing_bg: Color::Rgb(40, 65, 50),
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: mint,
|
success_fg: mint,
|
||||||
info_bg: bg_light,
|
info_bg: bg_light,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (100, 85, 110),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(65, 95, 85),
|
playing_bg: Color::Rgb(65, 95, 85),
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: bg1,
|
info_bg: bg1,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (70, 55, 45),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(50, 65, 45),
|
playing_bg: Color::Rgb(50, 65, 45),
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: black,
|
success_fg: black,
|
||||||
info_bg: dark_red,
|
info_bg: dark_red,
|
||||||
info_fg: yellow,
|
info_fg: yellow,
|
||||||
event_rgb: (170, 100, 0),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(180, 180, 0),
|
playing_bg: Color::Rgb(180, 180, 0),
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: autumn_green,
|
success_fg: autumn_green,
|
||||||
info_bg: bg_light,
|
info_bg: bg_light,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (50, 50, 60),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(40, 55, 45),
|
playing_bg: Color::Rgb(40, 55, 45),
|
||||||
|
|||||||
@@ -172,7 +172,6 @@ pub struct FlashColors {
|
|||||||
pub success_fg: Color,
|
pub success_fg: Color,
|
||||||
pub info_bg: Color,
|
pub info_bg: Color,
|
||||||
pub info_fg: Color,
|
pub info_fg: Color,
|
||||||
pub event_rgb: (u8, u8, u8),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: bright,
|
success_fg: bright,
|
||||||
info_bg: surface,
|
info_bg: surface,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (40, 40, 40),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(50, 50, 50),
|
playing_bg: Color::Rgb(50, 50, 50),
|
||||||
|
|||||||
@@ -103,7 +103,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: dark,
|
success_fg: dark,
|
||||||
info_bg: surface,
|
info_bg: surface,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (220, 220, 220),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(200, 200, 200),
|
playing_bg: Color::Rgb(200, 200, 200),
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: bg_light,
|
info_bg: bg_light,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (70, 55, 70),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(50, 70, 45),
|
playing_bg: Color::Rgb(50, 70, 45),
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: aurora_green,
|
success_fg: aurora_green,
|
||||||
info_bg: polar_night1,
|
info_bg: polar_night1,
|
||||||
info_fg: snow_storm2,
|
info_fg: snow_storm2,
|
||||||
event_rgb: (60, 55, 75),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(50, 65, 55),
|
playing_bg: Color::Rgb(50, 65, 55),
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: surface,
|
info_bg: surface,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (40, 30, 50),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(15, 45, 25),
|
playing_bg: Color::Rgb(15, 45, 25),
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: foam,
|
success_fg: foam,
|
||||||
info_bg: bg_light,
|
info_bg: bg_light,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (50, 45, 60),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(35, 55, 55),
|
playing_bg: Color::Rgb(35, 55, 55),
|
||||||
|
|||||||
@@ -105,7 +105,6 @@ pub fn theme() -> ThemeColors {
|
|||||||
success_fg: green,
|
success_fg: green,
|
||||||
info_bg: bg_light,
|
info_bg: bg_light,
|
||||||
info_fg: fg,
|
info_fg: fg,
|
||||||
event_rgb: (55, 50, 70),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: Color::Rgb(45, 60, 45),
|
playing_bg: Color::Rgb(45, 60, 45),
|
||||||
|
|||||||
@@ -170,7 +170,6 @@ pub fn rotate_theme(theme: ThemeColors, degrees: f32) -> ThemeColors {
|
|||||||
success_fg: rotate_color(theme.flash.success_fg, degrees),
|
success_fg: rotate_color(theme.flash.success_fg, degrees),
|
||||||
info_bg: rotate_color(theme.flash.info_bg, degrees),
|
info_bg: rotate_color(theme.flash.info_bg, degrees),
|
||||||
info_fg: rotate_color(theme.flash.info_fg, degrees),
|
info_fg: rotate_color(theme.flash.info_fg, degrees),
|
||||||
event_rgb: rotate_tuple(theme.flash.event_rgb, degrees),
|
|
||||||
},
|
},
|
||||||
list: ListColors {
|
list: ListColors {
|
||||||
playing_bg: rotate_color(theme.list.playing_bg, degrees),
|
playing_bg: rotate_color(theme.list.playing_bg, degrees),
|
||||||
|
|||||||
@@ -110,7 +110,6 @@ impl App {
|
|||||||
show_scope: self.audio.config.show_scope,
|
show_scope: self.audio.config.show_scope,
|
||||||
show_spectrum: self.audio.config.show_spectrum,
|
show_spectrum: self.audio.config.show_spectrum,
|
||||||
show_completion: self.ui.show_completion,
|
show_completion: self.ui.show_completion,
|
||||||
flash_brightness: self.ui.flash_brightness,
|
|
||||||
color_scheme: self.ui.color_scheme,
|
color_scheme: self.ui.color_scheme,
|
||||||
layout: self.audio.config.layout,
|
layout: self.audio.config.layout,
|
||||||
hue_rotation: self.ui.hue_rotation,
|
hue_rotation: self.ui.hue_rotation,
|
||||||
@@ -1384,10 +1383,6 @@ impl App {
|
|||||||
.editor
|
.editor
|
||||||
.set_completion_enabled(self.ui.show_completion);
|
.set_completion_enabled(self.ui.show_completion);
|
||||||
}
|
}
|
||||||
AppCommand::AdjustFlashBrightness(delta) => {
|
|
||||||
self.ui.flash_brightness = (self.ui.flash_brightness + delta).clamp(0.0, 1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Live keys
|
// Live keys
|
||||||
AppCommand::ToggleLiveKeysFill => {
|
AppCommand::ToggleLiveKeysFill => {
|
||||||
self.live_keys.flip_fill();
|
self.live_keys.flip_fill();
|
||||||
|
|||||||
@@ -187,7 +187,6 @@ impl CagireDesktop {
|
|||||||
app.audio.config.show_scope = settings.display.show_scope;
|
app.audio.config.show_scope = settings.display.show_scope;
|
||||||
app.audio.config.show_spectrum = settings.display.show_spectrum;
|
app.audio.config.show_spectrum = settings.display.show_spectrum;
|
||||||
app.ui.show_completion = settings.display.show_completion;
|
app.ui.show_completion = settings.display.show_completion;
|
||||||
app.ui.flash_brightness = settings.display.flash_brightness;
|
|
||||||
|
|
||||||
let metrics = Arc::new(EngineMetrics::default());
|
let metrics = Arc::new(EngineMetrics::default());
|
||||||
let scope_buffer = Arc::new(ScopeBuffer::new());
|
let scope_buffer = Arc::new(ScopeBuffer::new());
|
||||||
@@ -419,17 +418,6 @@ impl eframe::App for CagireDesktop {
|
|||||||
self.app.metrics.event_count = seq_snapshot.event_count;
|
self.app.metrics.event_count = seq_snapshot.event_count;
|
||||||
self.app.metrics.dropped_events = seq_snapshot.dropped_events;
|
self.app.metrics.dropped_events = seq_snapshot.dropped_events;
|
||||||
|
|
||||||
self.app.ui.event_flash = (self.app.ui.event_flash - 0.1).max(0.0);
|
|
||||||
let new_events = self
|
|
||||||
.app
|
|
||||||
.metrics
|
|
||||||
.event_count
|
|
||||||
.saturating_sub(self.app.ui.last_event_count);
|
|
||||||
if new_events > 0 {
|
|
||||||
self.app.ui.event_flash = (new_events as f32 * 0.4).min(1.0);
|
|
||||||
}
|
|
||||||
self.app.ui.last_event_count = self.app.metrics.event_count;
|
|
||||||
|
|
||||||
self.app.flush_queued_changes(&sequencer.cmd_tx);
|
self.app.flush_queued_changes(&sequencer.cmd_tx);
|
||||||
self.app.flush_dirty_patterns(&sequencer.cmd_tx);
|
self.app.flush_dirty_patterns(&sequencer.cmd_tx);
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,6 @@ pub enum AppCommand {
|
|||||||
SetHueRotation(f32),
|
SetHueRotation(f32),
|
||||||
ToggleRuntimeHighlight,
|
ToggleRuntimeHighlight,
|
||||||
ToggleCompletion,
|
ToggleCompletion,
|
||||||
AdjustFlashBrightness(f32),
|
|
||||||
|
|
||||||
// Live keys
|
// Live keys
|
||||||
ToggleLiveKeysFill,
|
ToggleLiveKeysFill,
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ use std::sync::atomic::{AtomicI64, AtomicU64};
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::thread::{self, JoinHandle};
|
use std::thread::{self, JoinHandle};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
use thread_priority::{set_current_thread_priority, ThreadPriority};
|
use thread_priority::ThreadPriority;
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
use thread_priority::set_current_thread_priority;
|
||||||
|
|
||||||
use super::LinkState;
|
use super::LinkState;
|
||||||
use crate::model::{
|
use crate::model::{
|
||||||
@@ -1286,7 +1288,25 @@ fn sequencer_loop(
|
|||||||
) {
|
) {
|
||||||
use std::sync::atomic::Ordering;
|
use std::sync::atomic::Ordering;
|
||||||
|
|
||||||
let _ = set_current_thread_priority(ThreadPriority::Max);
|
#[cfg(unix)]
|
||||||
|
{
|
||||||
|
use thread_priority::unix::{
|
||||||
|
set_thread_priority_and_policy, thread_native_id, RealtimeThreadSchedulePolicy,
|
||||||
|
ThreadSchedulePolicy,
|
||||||
|
};
|
||||||
|
|
||||||
|
let policy = ThreadSchedulePolicy::Realtime(RealtimeThreadSchedulePolicy::Fifo);
|
||||||
|
if let Err(e) =
|
||||||
|
set_thread_priority_and_policy(thread_native_id(), ThreadPriority::Max, policy)
|
||||||
|
{
|
||||||
|
eprintln!("Warning: Could not set SCHED_FIFO: {e:?}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(not(unix))]
|
||||||
|
{
|
||||||
|
let _ = set_current_thread_priority(ThreadPriority::Max);
|
||||||
|
}
|
||||||
|
|
||||||
let mut seq_state = SequencerState::new(variables, dict, rng, cc_access);
|
let mut seq_state = SequencerState::new(variables, dict, rng, cc_access);
|
||||||
|
|
||||||
|
|||||||
@@ -1443,10 +1443,6 @@ fn handle_options_page(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
|
|||||||
OptionsFocus::ShowCompletion => {
|
OptionsFocus::ShowCompletion => {
|
||||||
ctx.dispatch(AppCommand::ToggleCompletion);
|
ctx.dispatch(AppCommand::ToggleCompletion);
|
||||||
}
|
}
|
||||||
OptionsFocus::FlashBrightness => {
|
|
||||||
let delta = if key.code == KeyCode::Left { -0.1 } else { 0.1 };
|
|
||||||
ctx.dispatch(AppCommand::AdjustFlashBrightness(delta));
|
|
||||||
}
|
|
||||||
OptionsFocus::LinkEnabled => ctx.link.set_enabled(!ctx.link.is_enabled()),
|
OptionsFocus::LinkEnabled => ctx.link.set_enabled(!ctx.link.is_enabled()),
|
||||||
OptionsFocus::StartStopSync => ctx
|
OptionsFocus::StartStopSync => ctx
|
||||||
.link
|
.link
|
||||||
|
|||||||
11
src/main.rs
11
src/main.rs
@@ -98,7 +98,6 @@ fn main() -> io::Result<()> {
|
|||||||
app.audio.config.show_scope = settings.display.show_scope;
|
app.audio.config.show_scope = settings.display.show_scope;
|
||||||
app.audio.config.show_spectrum = settings.display.show_spectrum;
|
app.audio.config.show_spectrum = settings.display.show_spectrum;
|
||||||
app.ui.show_completion = settings.display.show_completion;
|
app.ui.show_completion = settings.display.show_completion;
|
||||||
app.ui.flash_brightness = settings.display.flash_brightness;
|
|
||||||
app.ui.color_scheme = settings.display.color_scheme;
|
app.ui.color_scheme = settings.display.color_scheme;
|
||||||
app.ui.hue_rotation = settings.display.hue_rotation;
|
app.ui.hue_rotation = settings.display.hue_rotation;
|
||||||
app.audio.config.layout = settings.display.layout;
|
app.audio.config.layout = settings.display.layout;
|
||||||
@@ -327,16 +326,6 @@ fn main() -> io::Result<()> {
|
|||||||
app.metrics.event_count = seq_snapshot.event_count;
|
app.metrics.event_count = seq_snapshot.event_count;
|
||||||
app.metrics.dropped_events = seq_snapshot.dropped_events;
|
app.metrics.dropped_events = seq_snapshot.dropped_events;
|
||||||
|
|
||||||
app.ui.event_flash = (app.ui.event_flash - 0.1).max(0.0);
|
|
||||||
let new_events = app
|
|
||||||
.metrics
|
|
||||||
.event_count
|
|
||||||
.saturating_sub(app.ui.last_event_count);
|
|
||||||
if new_events > 0 {
|
|
||||||
app.ui.event_flash = (new_events as f32 * 0.4).min(1.0);
|
|
||||||
}
|
|
||||||
app.ui.last_event_count = app.metrics.event_count;
|
|
||||||
|
|
||||||
app.flush_queued_changes(&sequencer.cmd_tx);
|
app.flush_queued_changes(&sequencer.cmd_tx);
|
||||||
app.flush_dirty_patterns(&sequencer.cmd_tx);
|
app.flush_dirty_patterns(&sequencer.cmd_tx);
|
||||||
|
|
||||||
|
|||||||
@@ -44,8 +44,6 @@ pub struct DisplaySettings {
|
|||||||
pub show_spectrum: bool,
|
pub show_spectrum: bool,
|
||||||
#[serde(default = "default_true")]
|
#[serde(default = "default_true")]
|
||||||
pub show_completion: bool,
|
pub show_completion: bool,
|
||||||
#[serde(default = "default_flash_brightness")]
|
|
||||||
pub flash_brightness: f32,
|
|
||||||
#[serde(default = "default_font")]
|
#[serde(default = "default_font")]
|
||||||
pub font: String,
|
pub font: String,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
@@ -60,8 +58,6 @@ fn default_font() -> String {
|
|||||||
"8x13".to_string()
|
"8x13".to_string()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn default_flash_brightness() -> f32 { 1.0 }
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
pub struct LinkSettings {
|
pub struct LinkSettings {
|
||||||
pub enabled: bool,
|
pub enabled: bool,
|
||||||
@@ -92,7 +88,6 @@ impl Default for DisplaySettings {
|
|||||||
show_scope: true,
|
show_scope: true,
|
||||||
show_spectrum: true,
|
show_spectrum: true,
|
||||||
show_completion: true,
|
show_completion: true,
|
||||||
flash_brightness: 1.0,
|
|
||||||
font: default_font(),
|
font: default_font(),
|
||||||
color_scheme: ColorScheme::default(),
|
color_scheme: ColorScheme::default(),
|
||||||
layout: MainLayout::default(),
|
layout: MainLayout::default(),
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ pub enum OptionsFocus {
|
|||||||
ShowScope,
|
ShowScope,
|
||||||
ShowSpectrum,
|
ShowSpectrum,
|
||||||
ShowCompletion,
|
ShowCompletion,
|
||||||
FlashBrightness,
|
|
||||||
LinkEnabled,
|
LinkEnabled,
|
||||||
StartStopSync,
|
StartStopSync,
|
||||||
Quantum,
|
Quantum,
|
||||||
@@ -33,7 +32,6 @@ impl CyclicEnum for OptionsFocus {
|
|||||||
Self::ShowScope,
|
Self::ShowScope,
|
||||||
Self::ShowSpectrum,
|
Self::ShowSpectrum,
|
||||||
Self::ShowCompletion,
|
Self::ShowCompletion,
|
||||||
Self::FlashBrightness,
|
|
||||||
Self::LinkEnabled,
|
Self::LinkEnabled,
|
||||||
Self::StartStopSync,
|
Self::StartStopSync,
|
||||||
Self::Quantum,
|
Self::Quantum,
|
||||||
|
|||||||
@@ -46,9 +46,6 @@ pub struct UiState {
|
|||||||
pub runtime_highlight: bool,
|
pub runtime_highlight: bool,
|
||||||
pub show_completion: bool,
|
pub show_completion: bool,
|
||||||
pub minimap_until: Option<Instant>,
|
pub minimap_until: Option<Instant>,
|
||||||
pub last_event_count: usize,
|
|
||||||
pub event_flash: f32,
|
|
||||||
pub flash_brightness: f32,
|
|
||||||
pub color_scheme: ColorScheme,
|
pub color_scheme: ColorScheme,
|
||||||
pub hue_rotation: f32,
|
pub hue_rotation: f32,
|
||||||
}
|
}
|
||||||
@@ -75,9 +72,6 @@ impl Default for UiState {
|
|||||||
runtime_highlight: false,
|
runtime_highlight: false,
|
||||||
show_completion: true,
|
show_completion: true,
|
||||||
minimap_until: None,
|
minimap_until: None,
|
||||||
last_event_count: 0,
|
|
||||||
event_flash: 0.0,
|
|
||||||
flash_brightness: 1.0,
|
|
||||||
color_scheme: ColorScheme::default(),
|
color_scheme: ColorScheme::default(),
|
||||||
hue_rotation: 0.0,
|
hue_rotation: 0.0,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,6 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
|
|||||||
Span::styled(peer_text, Style::new().fg(theme.ui.text_muted)),
|
Span::styled(peer_text, Style::new().fg(theme.ui.text_muted)),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
let flash_str = format!("{:.0}%", app.ui.flash_brightness * 100.0);
|
|
||||||
let quantum_str = format!("{:.0}", link.quantum());
|
let quantum_str = format!("{:.0}", link.quantum());
|
||||||
let tempo_str = format!("{:.1} BPM", link.tempo());
|
let tempo_str = format!("{:.1} BPM", link.tempo());
|
||||||
let beat_str = format!("{:.2}", link.beat());
|
let beat_str = format!("{:.2}", link.beat());
|
||||||
@@ -161,7 +160,6 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
|
|||||||
focus == OptionsFocus::ShowCompletion,
|
focus == OptionsFocus::ShowCompletion,
|
||||||
&theme,
|
&theme,
|
||||||
),
|
),
|
||||||
render_option_line("Flash brightness", &flash_str, focus == OptionsFocus::FlashBrightness, &theme),
|
|
||||||
Line::from(""),
|
Line::from(""),
|
||||||
link_header,
|
link_header,
|
||||||
render_divider(content_width, &theme),
|
render_divider(content_width, &theme),
|
||||||
@@ -215,18 +213,17 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, area: Rect) {
|
|||||||
OptionsFocus::ShowScope => 6,
|
OptionsFocus::ShowScope => 6,
|
||||||
OptionsFocus::ShowSpectrum => 7,
|
OptionsFocus::ShowSpectrum => 7,
|
||||||
OptionsFocus::ShowCompletion => 8,
|
OptionsFocus::ShowCompletion => 8,
|
||||||
OptionsFocus::FlashBrightness => 9,
|
OptionsFocus::LinkEnabled => 12,
|
||||||
OptionsFocus::LinkEnabled => 13,
|
OptionsFocus::StartStopSync => 13,
|
||||||
OptionsFocus::StartStopSync => 14,
|
OptionsFocus::Quantum => 14,
|
||||||
OptionsFocus::Quantum => 15,
|
OptionsFocus::MidiOutput0 => 25,
|
||||||
OptionsFocus::MidiOutput0 => 26,
|
OptionsFocus::MidiOutput1 => 26,
|
||||||
OptionsFocus::MidiOutput1 => 27,
|
OptionsFocus::MidiOutput2 => 27,
|
||||||
OptionsFocus::MidiOutput2 => 28,
|
OptionsFocus::MidiOutput3 => 28,
|
||||||
OptionsFocus::MidiOutput3 => 29,
|
OptionsFocus::MidiInput0 => 32,
|
||||||
OptionsFocus::MidiInput0 => 33,
|
OptionsFocus::MidiInput1 => 33,
|
||||||
OptionsFocus::MidiInput1 => 34,
|
OptionsFocus::MidiInput2 => 34,
|
||||||
OptionsFocus::MidiInput2 => 35,
|
OptionsFocus::MidiInput3 => 35,
|
||||||
OptionsFocus::MidiInput3 => 36,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let scroll_offset = if total_lines <= max_visible {
|
let scroll_offset = if total_lines <= max_visible {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use std::time::Instant;
|
|||||||
use rand::rngs::StdRng;
|
use rand::rngs::StdRng;
|
||||||
use rand::SeedableRng;
|
use rand::SeedableRng;
|
||||||
use ratatui::layout::{Alignment, Constraint, Layout, Rect};
|
use ratatui::layout::{Alignment, Constraint, Layout, Rect};
|
||||||
use ratatui::style::{Color, Modifier, Style};
|
use ratatui::style::{Modifier, Style};
|
||||||
use ratatui::text::{Line, Span};
|
use ratatui::text::{Line, Span};
|
||||||
use ratatui::widgets::{Block, Borders, Cell, Clear, Paragraph, Row, Table};
|
use ratatui::widgets::{Block, Borders, Cell, Clear, Paragraph, Row, Table};
|
||||||
use ratatui::Frame;
|
use ratatui::Frame;
|
||||||
@@ -150,17 +150,7 @@ pub fn render(frame: &mut Frame, app: &App, link: &LinkState, snapshot: &Sequenc
|
|||||||
let term = frame.area();
|
let term = frame.area();
|
||||||
|
|
||||||
let theme = theme::get();
|
let theme = theme::get();
|
||||||
let bg_color = if app.ui.event_flash > 0.0 {
|
let bg_color = theme.ui.bg;
|
||||||
let t = (app.ui.event_flash * app.ui.flash_brightness).min(1.0);
|
|
||||||
let (base_r, base_g, base_b) = theme.ui.bg_rgb;
|
|
||||||
let (tgt_r, tgt_g, tgt_b) = theme.flash.event_rgb;
|
|
||||||
let r = base_r + ((tgt_r as f32 - base_r as f32) * t) as u8;
|
|
||||||
let g = base_g + ((tgt_g as f32 - base_g as f32) * t) as u8;
|
|
||||||
let b = base_b + ((tgt_b as f32 - base_b as f32) * t) as u8;
|
|
||||||
Color::Rgb(r, g, b)
|
|
||||||
} else {
|
|
||||||
theme.ui.bg
|
|
||||||
};
|
|
||||||
|
|
||||||
let blank = " ".repeat(term.width as usize);
|
let blank = " ".repeat(term.width as usize);
|
||||||
let lines: Vec<Line> = (0..term.height).map(|_| Line::raw(&blank)).collect();
|
let lines: Vec<Line> = (0..term.height).map(|_| Line::raw(&blank)).collect();
|
||||||
|
|||||||
Reference in New Issue
Block a user