diff --git a/src/main.rs b/src/main.rs index 6276ab5..4637a66 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,9 +7,9 @@ mod window; mod state; mod option_window; -use std::{collections::HashMap, sync::mpsc::Sender}; +use std::collections::HashMap; -use audio::{AudioMessage, AudioThread}; +use audio::AudioThread; use eframe::{ egui::{self, menu, Button, Ui}, NativeOptions, @@ -25,11 +25,10 @@ use crate::frontpanel::Frontpanel; fn main() -> Result<(), eframe::Error> { env_logger::init(); - let audio_tx = AudioThread::init(); eframe::run_native( "Altair 8800 Emulator", NativeOptions::default(), - Box::new(|cc| Box::new(AltairEmulator::new(cc, audio_tx))), + Box::new(|cc| Box::new(AltairEmulator::new(cc))), ) } @@ -59,7 +58,8 @@ struct AltairEmulator { impl AltairEmulator { - fn new(cc: &eframe::CreationContext<'_>, audio_tx: Sender) -> Self { + fn new(cc: &eframe::CreationContext<'_>) -> Self { + let audio_tx = AudioThread::init(); let options = if cc.storage.unwrap().get_string("options").is_none() { Options::default() } else {