summaryrefslogtreecommitdiff
path: root/drivers/alsa/audio_driver_alsa.h
diff options
context:
space:
mode:
authorEmmanouil Papadeas <manoschool@yahoo.gr>2023-02-08 17:40:15 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-02-09 11:02:00 +0100
commitc36460060ea434158c2069d696880cbaf4431123 (patch)
tree79e045ef1939b8daad696cc0a074778f9c61ae53 /drivers/alsa/audio_driver_alsa.h
parentd69809cab603cae9f525768337affe5e12e454a8 (diff)
Further refactoring to AudioDriver implementations after #69120.
- 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 <rverschelde@gmail.com>
Diffstat (limited to 'drivers/alsa/audio_driver_alsa.h')
-rw-r--r--drivers/alsa/audio_driver_alsa.h36
1 files changed, 19 insertions, 17 deletions
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<int32_t> samples_in;
Vector<int16_t> 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() {}