commented code
This commit is contained in:
parent
ffdd458fbb
commit
08da9f7857
|
@ -114,12 +114,6 @@ impl Default for Mixer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// impl Mixer {
|
|
||||||
// fn mix(&self, sample: DacSample) -> [f32; 2] {
|
|
||||||
// sample.mixed(self.vol_left, self.vol_right)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
struct DacSample {
|
struct DacSample {
|
||||||
one: f32,
|
one: f32,
|
||||||
|
@ -155,15 +149,12 @@ pub struct Apu {
|
||||||
mixer: Mixer,
|
mixer: Mixer,
|
||||||
div_apu: u8,
|
div_apu: u8,
|
||||||
buffer: Vec<DacSample>,
|
buffer: Vec<DacSample>,
|
||||||
// converter: Samplerate,
|
|
||||||
device: Device,
|
device: Device,
|
||||||
config: StreamConfig,
|
config: StreamConfig,
|
||||||
stream: Option<Stream>,
|
stream: Option<Stream>,
|
||||||
send_buffer: Option<Sender<Vec<[f32; 2]>>>,
|
send_buffer: Option<Sender<Vec<[f32; 2]>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// const TARGET_SAMPLERATE: u32 = 192000;
|
|
||||||
|
|
||||||
impl Default for Apu {
|
impl Default for Apu {
|
||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
let host = cpal::default_host();
|
let host = cpal::default_host();
|
||||||
|
@ -181,16 +172,6 @@ impl Default for Apu {
|
||||||
.with_max_sample_rate()
|
.with_max_sample_rate()
|
||||||
.config();
|
.config();
|
||||||
|
|
||||||
// config.buffer_size = BufferSize::Fixed(2048 * 2);
|
|
||||||
|
|
||||||
// let converter = Samplerate::new(
|
|
||||||
// ConverterType::Linear,
|
|
||||||
// TARGET_SAMPLERATE,
|
|
||||||
// config.sample_rate.0,
|
|
||||||
// 2,
|
|
||||||
// )
|
|
||||||
// .unwrap();
|
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
mem: [0x0; MEM_SIZE],
|
mem: [0x0; MEM_SIZE],
|
||||||
apu_enable: true,
|
apu_enable: true,
|
||||||
|
@ -199,7 +180,6 @@ impl Default for Apu {
|
||||||
mixer: Mixer::default(),
|
mixer: Mixer::default(),
|
||||||
div_apu: 0,
|
div_apu: 0,
|
||||||
buffer: vec![],
|
buffer: vec![],
|
||||||
// converter,
|
|
||||||
device,
|
device,
|
||||||
config,
|
config,
|
||||||
stream: None,
|
stream: None,
|
||||||
|
|
Loading…
Reference in a new issue