diff options
Diffstat (limited to 'src/devices/sound/disc_inp.hxx')
-rw-r--r-- | src/devices/sound/disc_inp.hxx | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/devices/sound/disc_inp.hxx b/src/devices/sound/disc_inp.hxx index 2b39825f9f3..1c6c9a6dba5 100644 --- a/src/devices/sound/disc_inp.hxx +++ b/src/devices/sound/disc_inp.hxx @@ -242,21 +242,17 @@ void DISCRETE_CLASS_FUNC(dss_input_pulse, input_write)(int sub_node, uint8_t dat #define DSS_INPUT_STREAM__GAIN DISCRETE_INPUT(1) #define DSS_INPUT_STREAM__OFFSET DISCRETE_INPUT(2) -void discrete_dss_input_stream_node::stream_generate(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) +void discrete_dss_input_stream_node::stream_generate(sound_stream &stream, std::vector<read_stream_view> const &inputs, std::vector<write_stream_view> &outputs) { - stream_sample_t *ptr = outputs[0]; - int samplenum = samples; - - while (samplenum-- > 0) - *(ptr++) = m_data; + outputs[0].fill(m_data * (1.0 / 32768.0)); } DISCRETE_STEP(dss_input_stream) { /* the context pointer is set to point to the current input stream data in discrete_stream_update */ - if (EXPECTED(m_ptr)) + if (EXPECTED(m_inview)) { - set_output(0, (*m_ptr) * m_gain + m_offset); - m_ptr++; + set_output(0, m_inview->get(m_inview_sample) * 32768.0 * m_gain + m_offset); + m_inview_sample++; } else set_output(0, 0); @@ -264,7 +260,7 @@ DISCRETE_STEP(dss_input_stream) DISCRETE_RESET(dss_input_stream) { - m_ptr = nullptr; + m_inview = nullptr; m_data = 0; } @@ -304,7 +300,7 @@ DISCRETE_START(dss_input_stream) m_stream_in_number = DSS_INPUT_STREAM__STREAM; m_gain = DSS_INPUT_STREAM__GAIN; m_offset = DSS_INPUT_STREAM__OFFSET; - m_ptr = nullptr; + m_inview = nullptr; m_is_buffered = is_buffered(); m_buffer_stream = nullptr; @@ -318,7 +314,7 @@ void DISCRETE_CLASS_NAME(dss_input_stream)::stream_start(void) discrete_sound_device *snd_device = downcast<discrete_sound_device *>(m_device); //assert(DSS_INPUT_STREAM__STREAM < snd_device->m_input_stream_list.count()); - m_buffer_stream = m_device->machine().sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), stream_update_delegate(&discrete_dss_input_stream_node::stream_generate,this)); + m_buffer_stream = m_device->machine().sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), stream_update_delegate(&discrete_dss_input_stream_node::stream_generate,this), STREAM_DEFAULT_FLAGS); snd_device->get_stream()->set_input(m_stream_in_number, m_buffer_stream); } |