From c36460060ea434158c2069d696880cbaf4431123 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas Date: Wed, 8 Feb 2023 17:40:15 +0200 Subject: Further refactoring to AudioDriver implementations after #69120. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rename all instances of `capture_start()` and `capture_end()` to their new names. Fixes #72892. - More internal renames to match what was started in #69120. - Use `override` consistently so that such refactoring bugs can be caught. - Harmonize the order of definition of the overridden virtual methods in each audio driver. - Harmonize prototype for `set_output_device` and `set_input_device`. Co-authored-by: RĂ©mi Verschelde --- drivers/xaudio2/audio_driver_xaudio2.cpp | 4 ---- drivers/xaudio2/audio_driver_xaudio2.h | 23 +++++++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) (limited to 'drivers/xaudio2') diff --git a/drivers/xaudio2/audio_driver_xaudio2.cpp b/drivers/xaudio2/audio_driver_xaudio2.cpp index cd1b29e17d..44ce01d4d7 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.cpp +++ b/drivers/xaudio2/audio_driver_xaudio2.cpp @@ -33,10 +33,6 @@ #include "core/config/project_settings.h" #include "core/os/os.h" -const char *AudioDriverXAudio2::get_name() const { - return "XAudio2"; -} - Error AudioDriverXAudio2::init() { active.clear(); exit_thread.clear(); diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h index df5ef52e88..c659b6ffdc 100644 --- a/drivers/xaudio2/audio_driver_xaudio2.h +++ b/drivers/xaudio2/audio_driver_xaudio2.h @@ -91,16 +91,19 @@ class AudioDriverXAudio2 : public AudioDriver { XAudio2DriverVoiceCallback voice_callback; public: - const char *get_name() const; - - virtual Error init(); - virtual void start(); - virtual int get_mix_rate() const; - virtual SpeakerMode get_speaker_mode() const; - virtual float get_latency(); - virtual void lock(); - virtual void unlock(); - virtual void finish(); + virtual const char *get_name() const override { + return "XAudio2"; + } + + virtual Error init() override; + virtual void start() override; + virtual int get_mix_rate() const override; + virtual SpeakerMode get_speaker_mode() const override; + virtual float get_latency() override; + + virtual void lock() override; + virtual void unlock() override; + virtual void finish() override; AudioDriverXAudio2(); ~AudioDriverXAudio2() {} -- cgit v1.2.3