mirror of
https://github.com/Redot-Engine/redot-engine.git
synced 2025-12-06 07:17:42 -05:00
Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@@ -168,7 +168,6 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon,
|
||||
const AudioTimeStamp *inTimeStamp,
|
||||
UInt32 inBusNumber, UInt32 inNumberFrames,
|
||||
AudioBufferList *ioData) {
|
||||
|
||||
AudioDriverCoreAudio *ad = (AudioDriverCoreAudio *)inRefCon;
|
||||
|
||||
if (!ad->active || !ad->try_lock()) {
|
||||
@@ -182,18 +181,15 @@ OSStatus AudioDriverCoreAudio::output_callback(void *inRefCon,
|
||||
ad->start_counting_ticks();
|
||||
|
||||
for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) {
|
||||
|
||||
AudioBuffer *abuf = &ioData->mBuffers[i];
|
||||
unsigned int frames_left = inNumberFrames;
|
||||
int16_t *out = (int16_t *)abuf->mData;
|
||||
|
||||
while (frames_left) {
|
||||
|
||||
unsigned int frames = MIN(frames_left, ad->buffer_frames);
|
||||
ad->audio_server_process(frames, ad->samples_in.ptrw());
|
||||
|
||||
for (unsigned int j = 0; j < frames * ad->channels; j++) {
|
||||
|
||||
out[j] = ad->samples_in[j] >> 16;
|
||||
}
|
||||
|
||||
@@ -213,7 +209,6 @@ OSStatus AudioDriverCoreAudio::input_callback(void *inRefCon,
|
||||
const AudioTimeStamp *inTimeStamp,
|
||||
UInt32 inBusNumber, UInt32 inNumberFrames,
|
||||
AudioBufferList *ioData) {
|
||||
|
||||
AudioDriverCoreAudio *ad = (AudioDriverCoreAudio *)inRefCon;
|
||||
if (!ad->active) {
|
||||
return 0;
|
||||
@@ -475,7 +470,6 @@ void AudioDriverCoreAudio::capture_finish() {
|
||||
}
|
||||
|
||||
Error AudioDriverCoreAudio::capture_start() {
|
||||
|
||||
input_buffer_init(buffer_frames);
|
||||
|
||||
OSStatus result = AudioOutputUnitStart(input_unit);
|
||||
@@ -487,7 +481,6 @@ Error AudioDriverCoreAudio::capture_start() {
|
||||
}
|
||||
|
||||
Error AudioDriverCoreAudio::capture_stop() {
|
||||
|
||||
if (input_unit) {
|
||||
OSStatus result = AudioOutputUnitStop(input_unit);
|
||||
if (result != noErr) {
|
||||
@@ -501,7 +494,6 @@ Error AudioDriverCoreAudio::capture_stop() {
|
||||
#ifdef OSX_ENABLED
|
||||
|
||||
Array AudioDriverCoreAudio::_get_device_list(bool capture) {
|
||||
|
||||
Array list;
|
||||
|
||||
list.push_back("Default");
|
||||
@@ -558,7 +550,6 @@ Array AudioDriverCoreAudio::_get_device_list(bool capture) {
|
||||
}
|
||||
|
||||
void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
|
||||
|
||||
AudioDeviceID deviceId;
|
||||
bool found = false;
|
||||
if (device != "Default") {
|
||||
@@ -639,17 +630,14 @@ void AudioDriverCoreAudio::_set_device(const String &device, bool capture) {
|
||||
}
|
||||
|
||||
Array AudioDriverCoreAudio::get_device_list() {
|
||||
|
||||
return _get_device_list();
|
||||
}
|
||||
|
||||
String AudioDriverCoreAudio::get_device() {
|
||||
|
||||
return device_name;
|
||||
}
|
||||
|
||||
void AudioDriverCoreAudio::set_device(String device) {
|
||||
|
||||
device_name = device;
|
||||
if (active) {
|
||||
_set_device(device_name);
|
||||
@@ -657,7 +645,6 @@ void AudioDriverCoreAudio::set_device(String device) {
|
||||
}
|
||||
|
||||
void AudioDriverCoreAudio::capture_set_device(const String &p_name) {
|
||||
|
||||
capture_device_name = p_name;
|
||||
if (active) {
|
||||
_set_device(capture_device_name, true);
|
||||
@@ -665,12 +652,10 @@ void AudioDriverCoreAudio::capture_set_device(const String &p_name) {
|
||||
}
|
||||
|
||||
Array AudioDriverCoreAudio::capture_get_device_list() {
|
||||
|
||||
return _get_device_list(true);
|
||||
}
|
||||
|
||||
String AudioDriverCoreAudio::capture_get_device() {
|
||||
|
||||
return capture_device_name;
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,6 @@
|
||||
#endif
|
||||
|
||||
class AudioDriverCoreAudio : public AudioDriver {
|
||||
|
||||
AudioComponentInstance audio_unit = nullptr;
|
||||
AudioComponentInstance input_unit = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user