Fix: audio engine fixes
This commit is contained in:
@@ -279,8 +279,6 @@ impl Plugin for CagirePlugin {
|
||||
};
|
||||
let lookahead_end = beat + lookahead_beats;
|
||||
|
||||
let engine_time = self.sample_pos as f64 / self.sample_rate as f64;
|
||||
|
||||
// Drain commands from the editor
|
||||
let commands: Vec<SeqCommand> = self.bridge.cmd_rx.try_iter().collect();
|
||||
|
||||
@@ -294,7 +292,8 @@ impl Plugin for CagirePlugin {
|
||||
fill: false,
|
||||
nudge_secs: 0.0,
|
||||
current_time_us: 0,
|
||||
engine_time,
|
||||
audio_sample_pos: self.sample_pos,
|
||||
sr: self.sample_rate as f64,
|
||||
mouse_x: 0.5,
|
||||
mouse_y: 0.5,
|
||||
mouse_down: 0.0,
|
||||
@@ -310,12 +309,12 @@ impl Plugin for CagirePlugin {
|
||||
// Drain audio commands from the editor (preview, hush, load samples, etc.)
|
||||
for audio_cmd in self.bridge.audio_cmd_rx.try_iter() {
|
||||
match audio_cmd {
|
||||
AudioCommand::Evaluate { ref cmd, time } => {
|
||||
let cmd_ref = match time {
|
||||
AudioCommand::Evaluate { ref cmd, tick } => {
|
||||
let cmd_ref = match tick {
|
||||
Some(t) => {
|
||||
self.cmd_buffer.clear();
|
||||
use std::fmt::Write;
|
||||
let _ = write!(&mut self.cmd_buffer, "{cmd}/time/{t:.6}");
|
||||
let _ = write!(&mut self.cmd_buffer, "{cmd}/tick/{t}");
|
||||
self.cmd_buffer.as_str()
|
||||
}
|
||||
None => cmd.as_str(),
|
||||
@@ -419,11 +418,11 @@ impl Plugin for CagirePlugin {
|
||||
}
|
||||
continue;
|
||||
}
|
||||
let cmd_ref = match tsc.time {
|
||||
let cmd_ref = match tsc.tick {
|
||||
Some(t) => {
|
||||
self.cmd_buffer.clear();
|
||||
use std::fmt::Write;
|
||||
let _ = write!(&mut self.cmd_buffer, "{}/time/{t:.6}", tsc.cmd);
|
||||
let _ = write!(&mut self.cmd_buffer, "{}/tick/{t}", tsc.cmd);
|
||||
self.cmd_buffer.as_str()
|
||||
}
|
||||
None => &tsc.cmd,
|
||||
|
||||
Reference in New Issue
Block a user