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/alsa/audio_driver_alsa.h | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'drivers/alsa/audio_driver_alsa.h') diff --git a/drivers/alsa/audio_driver_alsa.h b/drivers/alsa/audio_driver_alsa.h index 6e9cf4dba9..821ba1d145 100644 --- a/drivers/alsa/audio_driver_alsa.h +++ b/drivers/alsa/audio_driver_alsa.h @@ -46,14 +46,14 @@ class AudioDriverALSA : public AudioDriver { snd_pcm_t *pcm_handle = nullptr; - String device_name = "Default"; - String new_device = "Default"; + String output_device_name = "Default"; + String new_output_device = "Default"; Vector samples_in; Vector samples_out; - Error init_device(); - void finish_device(); + Error init_output_device(); + void finish_output_device(); static void thread_func(void *p_udata); @@ -69,20 +69,22 @@ class AudioDriverALSA : public AudioDriver { SafeFlag exit_thread; public: - const char *get_name() const { + virtual const char *get_name() const override { return "ALSA"; - }; - - virtual Error init(); - virtual void start(); - virtual int get_mix_rate() const; - virtual SpeakerMode get_speaker_mode() const; - virtual PackedStringArray get_device_list(); - virtual String get_device(); - virtual void set_device(String device); - virtual void lock(); - virtual void unlock(); - virtual void finish(); + } + + virtual Error init() override; + virtual void start() override; + virtual int get_mix_rate() const override; + virtual SpeakerMode get_speaker_mode() const override; + + virtual void lock() override; + virtual void unlock() override; + virtual void finish() override; + + virtual PackedStringArray get_output_device_list() override; + virtual String get_output_device() override; + virtual void set_output_device(const String &p_name) override; AudioDriverALSA() {} ~AudioDriverALSA() {} -- cgit v1.2.3