Skip to content

Commit e51605c

Browse files
committed
Update AMP after the process has started
1 parent 9266bfa commit e51605c

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/io/manager.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ impl ProcessorManager {
3838
/// Never blocks; silently drops if the buffer is full.
3939
pub fn set_amp_chain(&self, new_chain: AmplifierChain) {
4040
if let Some(tx) = &self.amp_tx {
41-
let _ = tx.try_send(Box::new(new_chain));
41+
tx.try_send(Box::new(new_chain)).unwrap_or_else(|e| {
42+
eprintln!("Failed to send new amplifier chain: {e}");
43+
});
4244
}
4345
}
4446

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ fn main() -> Result<(), String> {
4242
let mut processor_manager = ProcessorManager::new()?;
4343

4444
let chain = create_mesa_boogie_dual_rectifier(processor_manager.sample_rate());
45-
processor_manager.set_amp_chain(chain);
4645

4746
if recording {
4847
processor_manager.enable_recording("./recordings")?;
4948
}
5049

5150
processor_manager.start()?;
5251

52+
processor_manager.set_amp_chain(chain);
53+
5354
let running = Arc::new(AtomicBool::new(true));
5455
let r = Arc::clone(&running);
5556

src/sim/chain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ pub fn create_mesa_boogie_dual_rectifier(sample_rate: f32) -> AmplifierChain {
210210
);
211211

212212
// Set default channel to clean
213-
chain.set_channel(2);
213+
chain.set_channel(0);
214214

215215
chain
216216
}

0 commit comments

Comments
 (0)