diff options
author | 2020-09-17 00:45:29 -0700 | |
---|---|---|
committer | 2020-09-17 00:46:06 -0700 | |
commit | dc0ede3c90717ed25de0695c555b861f06344f18 (patch) | |
tree | cbc28d80cb2ebe963a3b068148aa78e4ebdaa6ce /src/devices/sound/vgm_visualizer.cpp | |
parent | 4118f19c48ceaa71c1aa6ab8b1a34e8907c98563 (diff) |
sound: Improved view interfaces to match usage patterns
* read/write_stream_views now have an internal index
* get/put/add/fill/copy now implicitly use and advance this index
* new method reset() can (re)set the internal index
* new method done() checks if index is past the end
* new method remaining() indicates how many samples remain
* get_indexed/put_indexed/etc available for random access
* updated all consumers to new interfaces
Diffstat (limited to 'src/devices/sound/vgm_visualizer.cpp')
-rw-r--r-- | src/devices/sound/vgm_visualizer.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/devices/sound/vgm_visualizer.cpp b/src/devices/sound/vgm_visualizer.cpp index c1f438f2b2c..46471760328 100644 --- a/src/devices/sound/vgm_visualizer.cpp +++ b/src/devices/sound/vgm_visualizer.cpp @@ -289,12 +289,12 @@ void vgmviz_device::sound_stream_update(sound_stream &stream, std::vector<read_s device_mixer_interface::sound_stream_update(stream, inputs, outputs); // now consume the outputs - for (int pos = 0; pos < outputs[0].samples(); pos++) + while (!outputs[0].done()) { for (int i = 0; i < outputs.size(); i++) { // Original code took 16-bit sample / 65536.0 instead of 32768.0, so multiply by 0.5 here but is it necessary? - const float sample = outputs[i].get(pos) * 0.5f; + const float sample = outputs[i].get() * 0.5f; m_audio_buf[m_audio_fill_index][i][m_audio_count[m_audio_fill_index]] = sample + 0.5f; } |