Removing lookahead concept

This commit is contained in:
2026-02-04 20:01:17 +01:00
parent 3bb1fa6e51
commit 467c504071
11 changed files with 5 additions and 76 deletions

View File

@@ -1,7 +1,7 @@
use arc_swap::ArcSwap;
use crossbeam_channel::Sender;
use crossterm::event::{Event, KeyCode, KeyEvent, KeyEventKind, KeyModifiers};
use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU32, Ordering};
use std::sync::atomic::{AtomicBool, AtomicI64, Ordering};
use std::sync::Arc;
use std::time::{Duration, Instant};
@@ -28,7 +28,6 @@ pub struct InputContext<'a> {
pub audio_tx: &'a ArcSwap<Sender<AudioCommand>>,
pub seq_cmd_tx: &'a Sender<SeqCommand>,
pub nudge_us: &'a Arc<AtomicI64>,
pub lookahead_ms: &'a Arc<AtomicU32>,
}
impl<'a> InputContext<'a> {
@@ -1330,14 +1329,6 @@ fn handle_engine_page(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
ctx.nudge_us
.store((prev - 1000).max(-100_000), Ordering::Relaxed);
}
SettingKind::Lookahead => {
ctx.dispatch(AppCommand::AdjustAudioSetting {
setting: SettingKind::Lookahead,
delta: -1,
});
ctx.lookahead_ms
.store(ctx.app.audio.config.lookahead_ms, Ordering::Relaxed);
}
}
ctx.app.save_settings(ctx.link);
}
@@ -1366,14 +1357,6 @@ fn handle_engine_page(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
ctx.nudge_us
.store((prev + 1000).min(100_000), Ordering::Relaxed);
}
SettingKind::Lookahead => {
ctx.dispatch(AppCommand::AdjustAudioSetting {
setting: SettingKind::Lookahead,
delta: 1,
});
ctx.lookahead_ms
.store(ctx.app.audio.config.lookahead_ms, Ordering::Relaxed);
}
}
ctx.app.save_settings(ctx.link);
}