diff --git a/.clang-format b/.clang-format index 89d5ac7734..36a70ef86b 100644 --- a/.clang-format +++ b/.clang-format @@ -50,3 +50,6 @@ SpaceAfterTemplateKeyword: false SpaceBeforeParens: NonEmptyParentheses SpacesInConditionalStatement: true SpacesInParentheses: true +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: true diff --git a/.github/workflows/coding-style-check.yml b/.github/workflows/coding-style-check.yml index d04775f26d..e1b5751c00 100644 --- a/.github/workflows/coding-style-check.yml +++ b/.github/workflows/coding-style-check.yml @@ -18,4 +18,4 @@ jobs: - uses: DoozyX/clang-format-lint-action@2a28e3a8d9553f244243f7e1ff94f6685dff87be with: clangFormatVersion: 10 - extensions: 'cpp,h' + extensions: 'cpp,h,mm' diff --git a/ios/sound.mm b/ios/sound.mm index 7e2b443359..1467cb5772 100644 --- a/ios/sound.mm +++ b/ios/sound.mm @@ -42,14 +42,14 @@ [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:&audioSessionError]; [[AVAudioSession sharedInstance] requestRecordPermission:^( BOOL granted ) { - if ( granted ) - { - // ok - } - else - { - // TODO - alert user - } + if ( granted ) + { + // ok + } + else + { + // TODO - alert user + } }]; [[AVAudioSession sharedInstance] setMode:AVAudioSessionModeMeasurement error:&audioSessionError]; } @@ -226,18 +226,18 @@ And because Jamulus uses the same buffer to store input and output data (input i if ( !isInitialized ) { - [[NSNotificationCenter defaultCenter] addObserverForName:AVAudioSessionRouteChangeNotification - object:nil - queue:nil - usingBlock:^( NSNotification* notification ) { - UInt8 reason = - [[notification.userInfo valueForKey:AVAudioSessionRouteChangeReasonKey] intValue]; - if ( reason == AVAudioSessionRouteChangeReasonNewDeviceAvailable or - reason == AVAudioSessionRouteChangeReasonOldDeviceUnavailable ) - { - emit ReinitRequest ( RS_RELOAD_RESTART_AND_INIT ); // reload the available devices frame - } - }]; + [[NSNotificationCenter defaultCenter] + addObserverForName:AVAudioSessionRouteChangeNotification + object:nil + queue:nil + usingBlock:^( NSNotification* notification ) { + UInt8 reason = [[notification.userInfo valueForKey:AVAudioSessionRouteChangeReasonKey] intValue]; + if ( reason == AVAudioSessionRouteChangeReasonNewDeviceAvailable or + reason == AVAudioSessionRouteChangeReasonOldDeviceUnavailable ) + { + emit ReinitRequest ( RS_RELOAD_RESTART_AND_INIT ); // reload the available devices frame + } + }]; } isInitialized = true; diff --git a/mac/activity.mm b/mac/activity.mm index 5212437cad..013e92e726 100644 --- a/mac/activity.mm +++ b/mac/activity.mm @@ -31,23 +31,23 @@ id activityId; }; -CActivity::CActivity() : pActivity(new CActivityId()) {} +CActivity::CActivity() : pActivity ( new CActivityId() ) {} -CActivity::~CActivity() -{ - delete pActivity; -} +CActivity::~CActivity() { delete pActivity; } void CActivity::BeginActivity() { - NSActivityOptions options = NSActivityBackground | NSActivityIdleDisplaySleepDisabled | NSActivityIdleSystemSleepDisabled | NSActivityLatencyCritical; + NSActivityOptions options = + NSActivityBackground | NSActivityIdleDisplaySleepDisabled | NSActivityIdleSystemSleepDisabled | NSActivityLatencyCritical; - pActivity->activityId = [[NSProcessInfo processInfo] beginActivityWithOptions: options reason:@"Jamulus provides low latency audio processing and should not be inturrupted by system throttling."]; + pActivity->activityId = [[NSProcessInfo processInfo] + beginActivityWithOptions:options + reason:@"Jamulus provides low latency audio processing and should not be inturrupted by system throttling."]; } void CActivity::EndActivity() { - [[NSProcessInfo processInfo] endActivity: pActivity->activityId]; + [[NSProcessInfo processInfo] endActivity:pActivity->activityId]; pActivity->activityId = nil; }