diff options
author | 2025-04-14 11:31:53 +0200 | |
---|---|---|
committer | 2025-04-27 22:23:20 +0200 | |
commit | d0f1c15a0f6df2dd51a754cb46e6175b7079c8f2 (patch) | |
tree | be35c94340442af08c316a8679089ee68e119fac /src/osd/modules/sound/direct_sound.cpp | |
parent | ec636faeba5c5841c5a4a35b7c9dc2f06a00f538 (diff) |
New sound infrastructure.
Should be added soon:
- mute
- speaker/microphone resampling
To be added a little later:
- compression
- reverb
Needs to be added by someone else:
- coreaudio
- direct
- portaudio
- xaudio2
- js
Diffstat (limited to 'src/osd/modules/sound/direct_sound.cpp')
-rw-r--r-- | src/osd/modules/sound/direct_sound.cpp | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/osd/modules/sound/direct_sound.cpp b/src/osd/modules/sound/direct_sound.cpp index 0e89bb1ac0d..dd931988f30 100644 --- a/src/osd/modules/sound/direct_sound.cpp +++ b/src/osd/modules/sound/direct_sound.cpp @@ -120,13 +120,6 @@ public: assert(m_buffer); return m_buffer->Stop(); } - HRESULT set_volume(LONG volume) const - { - assert(m_buffer); - return m_buffer->SetVolume(volume); - } - HRESULT set_min_volume() { return set_volume(DSBVOLUME_MIN); } - HRESULT get_current_positions(DWORD &play_pos, DWORD &write_pos) const { assert(m_buffer); @@ -225,8 +218,7 @@ public: virtual void exit() override; // sound_module - virtual void update_audio_stream(bool is_throttled, int16_t const *buffer, int samples_this_frame) override; - virtual void set_mastervolume(int attenuation) override; + virtual void stream_sink_update(uint32_t, int16_t const *buffer, int samples_this_frame) override; private: HRESULT dsound_init(); @@ -297,11 +289,11 @@ void sound_direct_sound::exit() //============================================================ -// update_audio_stream +// stream_sink_update //============================================================ -void sound_direct_sound::update_audio_stream( - bool is_throttled, +void sound_direct_sound::stream_sink_update( + uint32_t, int16_t const *buffer, int samples_this_frame) { @@ -364,26 +356,6 @@ void sound_direct_sound::update_audio_stream( //============================================================ -// set_mastervolume -//============================================================ - -void sound_direct_sound::set_mastervolume(int attenuation) -{ - // clamp the attenuation to 0-32 range - attenuation = std::clamp(attenuation, -32, 0); - - // set the master volume - if (m_stream_buffer) - { - if (-32 == attenuation) - m_stream_buffer.set_min_volume(); - else - m_stream_buffer.set_volume(100 * attenuation); - } -} - - -//============================================================ // dsound_init //============================================================ |