diff options
Diffstat (limited to 'drivers/wasapi')
-rw-r--r-- | drivers/wasapi/audio_driver_wasapi.cpp | 16 | ||||
-rw-r--r-- | drivers/wasapi/audio_driver_wasapi.h | 39 |
2 files changed, 29 insertions, 26 deletions
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 42a2b85200..72ec0c19ab 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -634,9 +634,9 @@ String AudioDriverWASAPI::get_output_device() { return name; } -void AudioDriverWASAPI::set_output_device(String output_device) { +void AudioDriverWASAPI::set_output_device(const String &p_name) { lock(); - audio_output.new_device = output_device; + audio_output.new_device = p_name; unlock(); } @@ -964,12 +964,6 @@ Error AudioDriverWASAPI::input_stop() { return FAILED; } -void AudioDriverWASAPI::set_input_device(const String &p_name) { - lock(); - audio_input.new_device = p_name; - unlock(); -} - PackedStringArray AudioDriverWASAPI::get_input_device_list() { return audio_device_get_list(true); } @@ -982,6 +976,12 @@ String AudioDriverWASAPI::get_input_device() { return name; } +void AudioDriverWASAPI::set_input_device(const String &p_name) { + lock(); + audio_input.new_device = p_name; + unlock(); +} + AudioDriverWASAPI::AudioDriverWASAPI() { samples_in.clear(); } diff --git a/drivers/wasapi/audio_driver_wasapi.h b/drivers/wasapi/audio_driver_wasapi.h index bf18ba8c99..367c30607a 100644 --- a/drivers/wasapi/audio_driver_wasapi.h +++ b/drivers/wasapi/audio_driver_wasapi.h @@ -94,27 +94,30 @@ class AudioDriverWASAPI : public AudioDriver { PackedStringArray audio_device_get_list(bool p_input); public: - virtual const char *get_name() const { + virtual const char *get_name() const override { return "WASAPI"; } - virtual Error init(); - virtual void start(); - virtual int get_mix_rate() const; - virtual float get_latency(); - virtual SpeakerMode get_speaker_mode() const; - virtual PackedStringArray get_output_device_list(); - virtual String get_output_device(); - virtual void set_output_device(String output_device); - virtual void lock(); - virtual void unlock(); - virtual void finish(); - - virtual Error input_start(); - virtual Error input_stop(); - virtual PackedStringArray get_input_device_list(); - virtual void set_input_device(const String &p_name); - virtual String get_input_device(); + 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; + + virtual PackedStringArray get_output_device_list() override; + virtual String get_output_device() override; + virtual void set_output_device(const String &p_name) override; + + virtual Error input_start() override; + virtual Error input_stop() override; + + virtual PackedStringArray get_input_device_list() override; + virtual String get_input_device() override; + virtual void set_input_device(const String &p_name) override; AudioDriverWASAPI(); }; |