1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

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>
This commit is contained in:
Emmanouil Papadeas
2023-02-08 17:40:15 +02:00
committed by Rémi Verschelde
parent d69809cab6
commit c36460060e
22 changed files with 227 additions and 215 deletions

View File

@@ -80,10 +80,6 @@ void AudioDriverOpenSL::_buffer_callbacks(
ad->_buffer_callback(queueItf);
}
const char *AudioDriverOpenSL::get_name() const {
return "Android";
}
Error AudioDriverOpenSL::init() {
SLresult res;
SLEngineOption EngineOption[] = {
@@ -204,7 +200,7 @@ void AudioDriverOpenSL::_record_buffer_callbacks(SLAndroidSimpleBufferQueueItf q
ad->_record_buffer_callback(queueItf);
}
Error AudioDriverOpenSL::capture_init_device() {
Error AudioDriverOpenSL::init_input_device() {
SLDataLocator_IODevice loc_dev = {
SL_DATALOCATOR_IODEVICE,
SL_IODEVICE_AUDIOINPUT,
@@ -271,15 +267,15 @@ Error AudioDriverOpenSL::capture_init_device() {
return OK;
}
Error AudioDriverOpenSL::capture_start() {
Error AudioDriverOpenSL::input_start() {
if (OS::get_singleton()->request_permission("RECORD_AUDIO")) {
return capture_init_device();
return init_input_device();
}
return OK;
}
Error AudioDriverOpenSL::capture_stop() {
Error AudioDriverOpenSL::input_stop() {
SLuint32 state;
SLresult res = (*recordItf)->GetRecordState(recordItf, &state);
ERR_FAIL_COND_V(res != SL_RESULT_SUCCESS, ERR_CANT_OPEN);