summaryrefslogtreecommitdiff
path: root/drivers/coreaudio
diff options
context:
space:
mode:
authorMarcelo Fernandez <marcelofg55@gmail.com>2018-07-27 15:09:03 -0300
committerMarcelo Fernandez <marcelofg55@gmail.com>2018-07-27 15:09:03 -0300
commit597301db349c2c0c70af6b411465a5f578765052 (patch)
treeb0962c874bfd78eef0f688b5f7160414b06cdd00 /drivers/coreaudio
parentdd8a0b92e0bbc0e82263061b3947cb93a39f9df1 (diff)
Renamed AudioDriver audio_input_* vars to input_*
Diffstat (limited to 'drivers/coreaudio')
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.cpp25
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.h1
2 files changed, 7 insertions, 19 deletions
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp
index 1344a9075e..e1f47cb8c2 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.cpp
+++ b/drivers/coreaudio/audio_driver_coreaudio.cpp
@@ -174,9 +174,9 @@ Error AudioDriverCoreAudio::init() {
unsigned int buffer_size = buffer_frames * channels;
samples_in.resize(buffer_size);
input_buf.resize(buffer_size);
- audio_input_buffer.resize(buffer_size * 8);
- audio_input_position = 0;
- audio_input_size = 0;
+ input_buffer.resize(buffer_size * 8);
+ input_position = 0;
+ input_size = 0;
if (OS::get_singleton()->is_stdout_verbose()) {
print_line("CoreAudio: detected " + itos(channels) + " channels");
@@ -247,17 +247,6 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon,
return 0;
};
-void AudioDriverCoreAudio::_input_write_sample(int32_t sample) {
-
- audio_input_buffer.write[audio_input_position++] = sample;
- if (audio_input_position >= audio_input_buffer.size()) {
- audio_input_position = 0;
- }
- if (audio_input_size < audio_input_buffer.size()) {
- audio_input_size++;
- }
-}
-
OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
AudioUnitRenderActionFlags *ioActionFlags,
const AudioTimeStamp *inTimeStamp,
@@ -281,11 +270,11 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
if (result == noErr) {
for (int i = 0; i < inNumberFrames * ad->capture_channels; i++) {
int32_t sample = ad->input_buf[i] << 16;
- ad->_input_write_sample(sample);
+ ad->input_buffer_write(sample);
if (ad->capture_channels == 1) {
// In case input device is single channel convert it to Stereo
- ad->_input_write_sample(sample);
+ ad->input_buffer_write(sample);
}
}
} else {
@@ -545,8 +534,8 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
ERR_FAIL_COND(result != noErr);
// Reset audio input to keep synchronisation.
- audio_input_position = 0;
- audio_input_size = 0;
+ input_position = 0;
+ input_size = 0;
}
}
diff --git a/drivers/coreaudio/audio_driver_coreaudio.h b/drivers/coreaudio/audio_driver_coreaudio.h
index 53a3e5e038..d3f7c8d596 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.h
+++ b/drivers/coreaudio/audio_driver_coreaudio.h
@@ -61,7 +61,6 @@ class AudioDriverCoreAudio : public AudioDriver {
#ifdef OSX_ENABLED
Array _get_device_list(bool capture = false);
void _set_device(const String &device, bool capture = false);
- void _input_write_sample(int32_t sample);
static OSStatus input_device_address_cb(AudioObjectID inObjectID,
UInt32 inNumberAddresses, const AudioObjectPropertyAddress *inAddresses,