You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-16 14:00:40 +00:00
Bring that Whole New World to the Old Continent too
Applies the clang-format style to the 2.1 branch as done for master in
5dbf1809c6.
This commit is contained in:
@@ -43,9 +43,9 @@ Error AudioDriverOSX::init() {
|
||||
strdesc.mFramesPerPacket = 1;
|
||||
strdesc.mBitsPerChannel = 16;
|
||||
strdesc.mBytesPerFrame =
|
||||
strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
|
||||
strdesc.mBitsPerChannel * strdesc.mChannelsPerFrame / 8;
|
||||
strdesc.mBytesPerPacket =
|
||||
strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
|
||||
strdesc.mBytesPerFrame * strdesc.mFramesPerPacket;
|
||||
|
||||
OSStatus result = noErr;
|
||||
AURenderCallbackStruct callback;
|
||||
@@ -57,7 +57,7 @@ Error AudioDriverOSX::init() {
|
||||
|
||||
zeromem(&desc, sizeof(desc));
|
||||
desc.componentType = kAudioUnitType_Output;
|
||||
desc.componentSubType = 0; /* !!! FIXME: ? */
|
||||
desc.componentSubType = 0; /* !!! FIXME: ? */
|
||||
comp = AudioComponentFindNext(NULL, &desc);
|
||||
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
|
||||
|
||||
@@ -66,16 +66,16 @@ Error AudioDriverOSX::init() {
|
||||
ERR_FAIL_COND_V(comp == NULL, FAILED);
|
||||
|
||||
result = AudioUnitSetProperty(audio_unit,
|
||||
kAudioUnitProperty_StreamFormat,
|
||||
scope, bus, &strdesc, sizeof(strdesc));
|
||||
kAudioUnitProperty_StreamFormat,
|
||||
scope, bus, &strdesc, sizeof(strdesc));
|
||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
||||
zeromem(&callback, sizeof(AURenderCallbackStruct));
|
||||
callback.inputProc = &AudioDriverOSX::output_callback;
|
||||
callback.inputProcRefCon = this;
|
||||
result = AudioUnitSetProperty(audio_unit,
|
||||
kAudioUnitProperty_SetRenderCallback,
|
||||
scope, bus, &callback, sizeof(callback));
|
||||
kAudioUnitProperty_SetRenderCallback,
|
||||
scope, bus, &callback, sizeof(callback));
|
||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
||||
result = AudioUnitInitialize(audio_unit);
|
||||
@@ -92,14 +92,13 @@ Error AudioDriverOSX::init() {
|
||||
};
|
||||
|
||||
OSStatus AudioDriverOSX::output_callback(void *inRefCon,
|
||||
AudioUnitRenderActionFlags * ioActionFlags,
|
||||
const AudioTimeStamp * inTimeStamp,
|
||||
UInt32 inBusNumber, UInt32 inNumberFrames,
|
||||
AudioBufferList * ioData) {
|
||||
|
||||
AudioUnitRenderActionFlags *ioActionFlags,
|
||||
const AudioTimeStamp *inTimeStamp,
|
||||
UInt32 inBusNumber, UInt32 inNumberFrames,
|
||||
AudioBufferList *ioData) {
|
||||
|
||||
AudioBuffer *abuf;
|
||||
AudioDriverOSX* ad = (AudioDriverOSX*)inRefCon;
|
||||
AudioDriverOSX *ad = (AudioDriverOSX *)inRefCon;
|
||||
|
||||
bool mix = true;
|
||||
|
||||
@@ -109,7 +108,6 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon,
|
||||
mix = ad->mutex->try_lock() == OK;
|
||||
};
|
||||
|
||||
|
||||
if (!mix) {
|
||||
for (unsigned int i = 0; i < ioData->mNumberBuffers; i++) {
|
||||
abuf = &ioData->mBuffers[i];
|
||||
@@ -124,7 +122,7 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon,
|
||||
|
||||
abuf = &ioData->mBuffers[i];
|
||||
frames_left = inNumberFrames;
|
||||
int16_t* out = (int16_t*)abuf->mData;
|
||||
int16_t *out = (int16_t *)abuf->mData;
|
||||
|
||||
while (frames_left) {
|
||||
|
||||
@@ -133,9 +131,9 @@ OSStatus AudioDriverOSX::output_callback(void *inRefCon,
|
||||
ad->audio_server_process(frames, ad->samples_in);
|
||||
//ad->unlock();
|
||||
|
||||
for(int i = 0; i < frames * ad->channels; i++) {
|
||||
for (int i = 0; i < frames * ad->channels; i++) {
|
||||
|
||||
out[i] = ad->samples_in[i]>>16;
|
||||
out[i] = ad->samples_in[i] >> 16;
|
||||
}
|
||||
|
||||
frames_left -= frames;
|
||||
@@ -180,10 +178,10 @@ void AudioDriverOSX::finish() {
|
||||
|
||||
AudioDriverOSX::AudioDriverOSX() {
|
||||
|
||||
mutex=Mutex::create();//NULL;
|
||||
mutex = Mutex::create(); //NULL;
|
||||
};
|
||||
|
||||
AudioDriverOSX::~AudioDriverOSX() {
|
||||
AudioDriverOSX::~AudioDriverOSX(){
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user