Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,6 @@ SpaceAfterTemplateKeyword: false
SpaceBeforeParens: NonEmptyParentheses
SpacesInConditionalStatement: true
SpacesInParentheses: true
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
2 changes: 1 addition & 1 deletion .github/workflows/coding-style-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ jobs:
- uses: DoozyX/clang-format-lint-action@2a28e3a8d9553f244243f7e1ff94f6685dff87be
with:
clangFormatVersion: 10
extensions: 'cpp,h'
extensions: 'cpp,h,mm'
40 changes: 20 additions & 20 deletions ios/sound.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down Expand Up @@ -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;
Expand Down
16 changes: 8 additions & 8 deletions mac/activity.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@
id<NSObject> 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;
}