diff options
Diffstat (limited to 'src/devices/sound/uda1344.cpp')
-rw-r--r-- | src/devices/sound/uda1344.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/devices/sound/uda1344.cpp b/src/devices/sound/uda1344.cpp index b8d445ef3b8..3031ea2e75d 100644 --- a/src/devices/sound/uda1344.cpp +++ b/src/devices/sound/uda1344.cpp @@ -88,25 +88,21 @@ void uda1344_device::device_reset() memset(m_bufout, 0, sizeof(uint32_t) * 2); } -void uda1344_device::sound_stream_update(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) +void uda1344_device::sound_stream_update(sound_stream &stream) { - for (int channel = 0; channel < 2 && channel < outputs.size(); channel++) + for (int channel = 0; channel < 2 && channel < stream.output_count(); channel++) { - auto &output = outputs[channel]; uint32_t curout = m_bufout[channel]; uint32_t curin = m_bufin[channel]; // feed as much as we can int sampindex; - for (sampindex = 0; curout != curin && sampindex < output.samples(); sampindex++) + for (sampindex = 0; curout != curin && sampindex < stream.samples(); sampindex++) { - output.put(sampindex, stream_buffer::sample_t(m_buffer[channel][curout]) * m_volume); + stream.put(channel, sampindex, sound_stream::sample_t(m_buffer[channel][curout]) * m_volume); curout = (curout + 1) % BUFFER_SIZE; } - // fill the rest with silence - output.fill(0, sampindex); - // save the new output pointer m_bufout[channel] = curout; } @@ -116,8 +112,8 @@ void uda1344_device::ingest_samples(int16_t left, int16_t right) { const int16_t samples[2] = { left, right }; - const stream_buffer::sample_t sample_scale = 1.0 / 32768.0; - const stream_buffer::sample_t enable_scale = m_dac_enable ? 1.0 : 0.0; + const sound_stream::sample_t sample_scale = 1.0 / 32768.0; + const sound_stream::sample_t enable_scale = m_dac_enable ? 1.0 : 0.0; m_stream->update(); @@ -126,7 +122,7 @@ void uda1344_device::ingest_samples(int16_t left, int16_t right) int maxin = (m_bufout[channel] + BUFFER_SIZE - 1) % BUFFER_SIZE; if (m_bufin[channel] != maxin) { - m_buffer[channel][m_bufin[channel]] = stream_buffer::sample_t(samples[channel]) * sample_scale * enable_scale; + m_buffer[channel][m_bufin[channel]] = sound_stream::sample_t(samples[channel]) * sample_scale * enable_scale; m_bufin[channel] = (m_bufin[channel] + 1) % BUFFER_SIZE; } else |