mirror of
https://github.com/zakk4223/CocoaSplit.git
synced 2026-05-15 14:15:50 -06:00
Rework Desktop capture display enumeration to take into account displays with no serial number (thanks apple)
55 lines
1 KiB
Objective-C
55 lines
1 KiB
Objective-C
//
|
|
// CmdLineDelegate.m
|
|
// CocoaSplit
|
|
//
|
|
// Created by Zakk on 4/8/13.
|
|
// Copyright (c) 2013 Zakk. All rights reserved.
|
|
//
|
|
|
|
#import "CmdLineDelegate.h"
|
|
|
|
@implementation CmdLineDelegate
|
|
|
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
|
{
|
|
|
|
NSUserDefaults *cmdargs = [NSUserDefaults standardUserDefaults];
|
|
BOOL loadSavedSettings = YES;
|
|
|
|
loadSavedSettings = [cmdargs boolForKey:@"loadSettings"];
|
|
|
|
if ([cmdargs objectForKey:@"loadSettings"])
|
|
{
|
|
loadSavedSettings = [cmdargs boolForKey:@"loadSettings"];
|
|
}
|
|
|
|
if (loadSavedSettings == YES)
|
|
{
|
|
[self.captureController loadSettings];
|
|
}
|
|
|
|
|
|
[self.captureController loadCmdlineSettings:cmdargs];
|
|
[[NSProcessInfo processInfo] disableSuddenTermination];
|
|
|
|
[self.captureController startStream];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
-(NSApplicationTerminateReply) applicationShouldTerminate: (NSNotification *)notification
|
|
{
|
|
|
|
|
|
[self.captureController stopStream];
|
|
|
|
return NSTerminateNow;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
@end
|