Fix a bunch of deprecations that came along with deploy target 10.12

When a new audio device connects don't force add every device to the audio engine.
Implement layout delete event in layout capture
Various fixes for some multithread access issues
This commit is contained in:
Zakk 2019-12-07 22:26:28 -05:00
parent 07b26b99ea
commit e71240fc85
38 changed files with 152 additions and 76 deletions

View file

@ -92,21 +92,24 @@
}
}
/*
-(void)layoutDeleted:(NSNotification *)notification
{
NSObject *deletedLayout = [notification object];
if (self.activeVideoDevice && (self.activeVideoDevice.captureDevice == deletedLayout) && _current_renderer)
if (self.activeVideoDevice && (self.activeVideoDevice.captureDevice == deletedLayout) && _current_layout)
{
@synchronized(self)
{
[_current_renderer setValue:nil forKey:@"layout"];
_current_renderer = nil;
if (_out_dest)
{
_out_dest.active = NO;
}
_out_dest = nil;
_current_layout = nil;
self.activeVideoDevice = nil;
}
}
}
*/
+(NSObject<CSCaptureSourceProtocol> *)createSourceFromPasteboardItem:(NSPasteboardItem *)item
{
@ -351,6 +354,7 @@
NSArray *pcmSamples = frameData.pcmAudioSamples[audioTrackkey];
for (id object in pcmSamples)
{
CMSampleBufferRef sampleBuffer = (__bridge CMSampleBufferRef)object;
CSPcmPlayer *pcmPlayer = _pcmPlayers[audioTrackkey];
if (!pcmPlayer)
@ -431,7 +435,5 @@
}
-(void)dealloc
{
}
@end

View file

@ -15,6 +15,7 @@
@property (strong) NSString *injectedAppName;
@property (strong) SBApplication *injectSB;
@property (strong) NSString *lastAppID;
-(void)changeBuffer;

View file

@ -20,6 +20,19 @@
-(void)saveWithCoder:(NSCoder *)aCoder
{
[super saveWithCoder:aCoder];
[aCoder encodeObject:self.lastAppID forKey:@"lastAppID"];
}
-(void)restoreWithCoder:(NSCoder *)aDecoder
{
[super restoreWithCoder:aDecoder];
self.lastAppID = [aDecoder decodeObjectForKey:@"lastAppID"];
}
-(bool) isSyphonInjectInstalled
{
@ -83,6 +96,13 @@
_activeVideoDevice = activeVideoDevice;
[self changeAvailableVideoDevices];
if (!_activeVideoDevice)
{
return;
}
self.lastAppID = _activeVideoDevice.uniqueID;
NSString *appExecutablePath = activeVideoDevice.uniqueID;
NSRunningApplication *injectApp;
@ -123,6 +143,12 @@
NSMutableArray *retArr = [[NSMutableArray alloc] init];
NSString *useUniqueID = self.savedUniqueID;
if (!useUniqueID)
{
useUniqueID = self.lastAppID;
}
for(NSRunningApplication *app in applications)
{
CSAbstractCaptureDevice *newDev;
@ -133,10 +159,10 @@
bool appMatch = NO;
if ([newDev.uniqueID isEqualToString:self.savedUniqueID])
if ([newDev.uniqueID isEqualToString:useUniqueID])
{
appMatch = YES;
} else if ([app.executableURL.lastPathComponent isEqualToString:self.savedUniqueID.lastPathComponent]) {
} else if ([app.executableURL.lastPathComponent isEqualToString:useUniqueID]) {
appMatch = YES;
}
if (!self.activeVideoDevice && appMatch)

View file

@ -57,12 +57,15 @@
-(void)dealloc
{
NSLog(@"DEALLOC AUDIO");
if (_audio_capture_output)
{
[_audio_capture_output setSampleBufferDelegate:nil queue:NULL];
}
if (_capture_session)
{
[_capture_session stopRunning];
for(AVCaptureInput *inp in _capture_session.inputs)
{
[_capture_session removeInput:inp];
@ -73,7 +76,6 @@
[_capture_session removeOutput:outp];
}
[_capture_session stopRunning];
}
_audio_capture_output = nil;
_audio_capture_input = nil;

View file

@ -73,10 +73,15 @@
-(void)attachCaptureSession
{
AVFAudioCapture *newAC = [[AVFAudioCapture alloc] initForAudioEngine:self.captureDevice sampleRate:self.sampleRate];
self.avfCapture = newAC;
newAC.multiInput = self;
[newAC startCaptureSession:nil];
if (!self.avfCapture)
{
AVFAudioCapture *newAC = [[AVFAudioCapture alloc] initForAudioEngine:self.captureDevice sampleRate:self.sampleRate];
self.avfCapture = newAC; //return;
}
self.avfCapture.multiInput = self;
[self.avfCapture startCaptureSession:nil];
}

View file

@ -746,7 +746,7 @@ OSStatus encoderRenderCallback( void *inRefCon, AudioUnitRenderActionFlags *ioAc
AudioObjectAddPropertyListenerBlock(kAudioObjectSystemObject, &inputDeviceAddress, dispatch_get_main_queue(), ^(UInt32 inNumberAddresses, const AudioObjectPropertyAddress * _Nonnull inAddresses) {
CAMultiAudioEngine *strongSelf = weakSelf;
if (strongSelf->_defaultInput)
if (strongSelf && strongSelf->_defaultInput)
{
[strongSelf attachDefaultInput];
}
@ -916,6 +916,7 @@ OSStatus encoderRenderCallback( void *inRefCon, AudioUnitRenderActionFlags *ioAc
}
-(void)handleDeviceConnect:(NSNotification *)notification
{
/*
AVCaptureDevice *newDev = notification.object;
if ([newDev hasMediaType:AVMediaTypeAudio])
@ -937,6 +938,7 @@ OSStatus encoderRenderCallback( void *inRefCon, AudioUnitRenderActionFlags *ioAc
[self attachInput:avplayer];
}
}
*/
}

View file

@ -25,7 +25,7 @@
NSImage *thumb = [[NSImage alloc] initWithSize:NSMakeSize(32, 32)];
NSRect fromRect = NSMakeRect(0, 0, img.size.width, img.size.height);
[thumb lockFocus];
[img drawInRect:NSMakeRect(0, 0, 32, 32) fromRect:fromRect operation:NSCompositeCopy fraction:1.0f];
[img drawInRect:NSMakeRect(0, 0, 32, 32) fromRect:fromRect operation:NSCompositingOperationCopy fraction:1.0f];
[thumb unlockFocus];
self.inputImage = thumb;
}

View file

@ -63,7 +63,7 @@
//fillBox.size.width = fillBox.size.width/2;
NSRectFillUsingOperation(fillBox, NSCompositeSourceOver);
NSRectFillUsingOperation(fillBox, NSCompositingOperationSourceOver);
}
if (myLayout.in_live)
@ -75,7 +75,7 @@
fillBox.size.width = fillBox.size.width/2;
fillBox.origin.x = fillBox.origin.x + fillBox.size.width;
NSRectFillUsingOperation(fillBox, NSCompositeSourceOver);
NSRectFillUsingOperation(fillBox, NSCompositingOperationSourceOver);
}

View file

@ -422,7 +422,6 @@
startTime += 1.0/self.layout.frameRate;
double start_time = [CaptureController.sharedCaptureController mach_time_seconds];
if (![[CaptureController sharedCaptureController] sleepUntil:startTime])
{
NSLog(@"SLEEP UNTIL %f CURRENT TIME %f LAYOUT %@ %@", startTime, [[CaptureController sharedCaptureController] mach_time_seconds], self.layout.name, NSThread.currentThread);
@ -434,15 +433,16 @@
if (!self.recordingActive)
{
for (OutputDestination *outdest in self.outputs)
NSMutableDictionary *useCompressors = self.compressors.copy;
for(id cKey in useCompressors)
{
if (outdest.buffer_draining)
{
drain_cnt++;
}
[outdest writeEncodedData:nil];
id <VideoCompressor> compressor;
compressor = useCompressors[cKey];
drain_cnt += [compressor drainOutputBufferFrame];
}
if (!drain_cnt)
{
return;

View file

@ -33,6 +33,6 @@
myimage = [self.image tintedImageWithColor:NSColor.blackColor];
}
[myimage drawInRect:cellFrame fromRect:NSMakeRect(0, 0, myimage.size.width, myimage.size.height) operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
[myimage drawInRect:cellFrame fromRect:NSMakeRect(0, 0, myimage.size.width, myimage.size.height) operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
}
@end

View file

@ -323,7 +323,7 @@ NSString *const kCSOauth2ClientSecret = @"CSOauth2ClientSecret";
_authWebView = [[WebView alloc] initWithFrame:winFrame frameName:nil groupName:nil];
_authWebView.policyDelegate = self;
_authWindow = [[NSWindow alloc] initWithContentRect:winFrame styleMask:NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask backing:NSBackingStoreBuffered defer:NO];
_authWindow = [[NSWindow alloc] initWithContentRect:winFrame styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO];
[_authWindow center];
[_authWindow setContentView:_authWebView];

View file

@ -189,7 +189,7 @@
if (!_closeButton)
{
_closeButton = [NSWindow standardWindowButton:NSWindowCloseButton forStyleMask:NSClosableWindowMask];
_closeButton = [NSWindow standardWindowButton:NSWindowCloseButton forStyleMask:NSWindowStyleMaskClosable];
[self addSubview:_closeButton];
_closeButton.target = self;
_closeButton.action = @selector(deleteSource);
@ -197,7 +197,7 @@
if (!_autoFitButton)
{
_autoFitButton = [NSWindow standardWindowButton:NSWindowZoomButton forStyleMask:NSClosableWindowMask];
_autoFitButton = [NSWindow standardWindowButton:NSWindowZoomButton forStyleMask:NSWindowStyleMaskClosable];
[self addSubview:_autoFitButton];
_autoFitButton.target = self;
_autoFitButton.action = @selector(autoFitSource);

View file

@ -233,7 +233,6 @@
{
if (ptsStarts[pkt.stream_index] == 0)
{
NSLog(@"PTS START %lld", pkt.pts);
ptsStarts[pkt.stream_index] = pkt.pts;
}

View file

@ -1375,6 +1375,7 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
if (useRecorder)
{
[useRecorder stopRecordingForOutput:output];
[layout clearSourceList];
//output.active = NO;
if (self.mainLayoutRecorder)
{
@ -3139,7 +3140,7 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
//self.mainLayoutRecorder.compressors = self.compressors;
[self.mainLayoutRecorder.compressors setValue:self.compressors[@"InstantRecorder"] forKey:@"InstantRecorder"];
self.mainLayoutRecorder.outputs = self.captureDestinations;
//self.mainLayoutRecorder.outputs = self.captureDestinations;
[self.mainLayoutRecorder startRecordingCommon];
@ -3924,7 +3925,7 @@ NSString *const CSAppearanceSystem = @"CSAppearanceSystem";
[confirmationAlert setInformativeText:infoString];
}
[confirmationAlert setAlertStyle:NSWarningAlertStyle];
[confirmationAlert setAlertStyle:NSAlertStyleWarning];
if ([confirmationAlert runModal] == NSAlertFirstButtonReturn)
{

View file

@ -220,10 +220,13 @@ OSStatus VTCompressionSessionCopySupportedPropertyDictionary(VTCompressionSessio
bool ret = NO;
CFArrayRef encoders = NULL;
NSDictionary *opts = @{@"RevealHiddefnEncoders": @YES, @"RevealHardwareAcceleratedEncoders": @YES};
NSDictionary *opts = @{@"RevealHiddenEncoders": @YES, @"RevealHardwareAcceleratedEncoders": @YES};
VTCopyVideoEncoderList((__bridge CFDictionaryRef _Nullable)(opts), &encoders);
NSLog(@"ENCODERS %@", encoders);
VTCopyVideoEncoderList((__bridge CFDictionaryRef _Nullable)(opts), &encoders);
@ -231,7 +234,6 @@ OSStatus VTCompressionSessionCopySupportedPropertyDictionary(VTCompressionSessio
for (NSDictionary *encode in nsEnc)
{
NSString *cName = [encode objectForKey:(NSString *)kVTVideoEncoderList_CodecName];
if ([cName isEqualToString:@"HEVC"])
{
@ -247,8 +249,6 @@ OSStatus VTCompressionSessionCopySupportedPropertyDictionary(VTCompressionSessio
+(bool)intelQSVAvailable
{
NSMutableDictionary *encoderSpec = [[NSMutableDictionary alloc] init];
encoderSpec[(__bridge NSString *)kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder] = @YES;

View file

@ -193,7 +193,7 @@ void PixelBufferRelease( void *releaseRefCon, const void *baseAddress )
//CVPixelBufferRelease(imageBuffer);
VTCompressionSessionEncodeFrame(_compression_session, frameData.videoFrame, frameData.videoPTS, frameData.videoDuration, frameProperties, (__bridge_retained void *)(frameData), NULL);
if (frameProperties)
@ -253,7 +253,7 @@ void PixelBufferRelease( void *releaseRefCon, const void *baseAddress )
CFMutableDictionaryRef transferProps = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(transferProps, kVTPixelTransferPropertyKey_ScalingMode, kVTScalingMode_Letterbox);
CFDictionarySetValue(transferProps, kVTPixelTransferPropertyKey_DestinationTransferFunction, kCVImageBufferTransferFunction_ITU_R_709_2);
VTSessionSetProperty(_compression_session, kVTCompressionPropertyKey_PixelTransferProperties, transferProps);
CFRelease(transferProps);

View file

@ -42,7 +42,7 @@
{
encoderSpec[(__bridge NSString *)kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder] = @YES;
}
return encoderSpec;
}

View file

@ -128,8 +128,13 @@
{
CVPixelBufferRelease(useFrame);
}
NSDictionary *outputsCopy = nil;
for (id dKey in self.outputs)
@synchronized(self)
{
outputsCopy = self.outputs.copy;
}
for (id dKey in outputsCopy )
{
OutputDestination *dest = self.outputs[dKey];
[dest writeEncodedData:imageBuffer];

View file

@ -43,7 +43,7 @@
-(int) drainOutputBufferFrame;
-(void) reset;
-(BOOL) setupResolution:(CVImageBufferRef)withFrame;
-(id <CSCompressorViewControllerProtocol>)getConfigurationView;

View file

@ -140,6 +140,30 @@
}
-(int) drainOutputBufferFrame
{
int drain_cnt = 0;
if (self.outputs.count > 0)
{
NSDictionary *outputs = self.outputs;
for (id dKey in outputs)
{
OutputDestination *dest = self.outputs[dKey];
if (dest.buffer_draining)
{
drain_cnt++;
[dest writeEncodedData:nil];
}
}
}
return drain_cnt;
}
-(void) removeOutput:(OutputDestination *)destination
{

View file

@ -42,6 +42,7 @@
@property (assign) bool active;
@property (assign) float frameRate;
-(int) drainOutputBufferFrame;
-(void) addOutput:(id)destination;
-(void) removeOutput:(id)destination;
-(bool) hasOutputs;

View file

@ -40,7 +40,7 @@
}
SourceLayout *useLayout = [CaptureController sharedCaptureController].activeLayout;
if ([NSEvent modifierFlags]& NSCommandKeyMask)
if ([NSEvent modifierFlags]& NSEventModifierFlagCommand)
{
useLayout = [CaptureController sharedCaptureController].selectedLayout;
}

View file

@ -20,7 +20,7 @@
}
NSRect contentRect = NSMakeRect(0, 0, self.audioUnitView.frame.size.width, self.audioUnitView.frame.size.height);
if (self = [super initWithContentRect:contentRect styleMask:NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask backing:NSBackingStoreBuffered defer:YES])
if (self = [super initWithContentRect:contentRect styleMask:NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable|NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:YES])
{
self.level = NSNormalWindowLevel;

View file

@ -16,7 +16,7 @@
if (self.backgroundColor)
{
[self.backgroundColor setFill];
NSRectFillUsingOperation(dirtyRect, NSCompositeSourceOver);
NSRectFillUsingOperation(dirtyRect, NSCompositingOperationSourceOver);
}
[super drawRect:dirtyRect];

View file

@ -61,7 +61,7 @@
{
SourceLayout *myLayout = self.viewController.representedObject;
NSPoint mouseLoc = [self convertPoint:event.locationInWindow fromView:nil];
if (event.modifierFlags & NSShiftKeyMask && !(myLayout.in_live || myLayout.in_staging) )
if (event.modifierFlags & NSEventModifierFlagShift && !(myLayout.in_live || myLayout.in_staging) )
{
if (mouseLoc.x < NSMidX(self.frame))
{

View file

@ -112,12 +112,12 @@
{
SourceLayout *useLayout = self.captureController.activePreviewView.sourceLayout;
if ([NSEvent modifierFlags]& NSCommandKeyMask)
if ([NSEvent modifierFlags]& NSEventModifierFlagCommand)
{
useLayout = self.captureController.selectedLayout;
}
if ([NSEvent modifierFlags] & NSShiftKeyMask)
if ([NSEvent modifierFlags] & NSEventModifierFlagShift)
{
if (!self.upImage.hidden)
{

View file

@ -123,13 +123,13 @@
SourceLayout *useLayout = controller.activePreviewView.sourceLayout;
if (event.modifierFlags & NSCommandKeyMask)
if (event.modifierFlags & NSEventModifierFlagCommand)
{
useLayout = controller.selectedLayout;
}
if (event.modifierFlags & NSShiftKeyMask)
if (event.modifierFlags & NSEventModifierFlagShift)
{
[controller toggleLayout:self.sourceLayout usingLayout:useLayout];
} else {

View file

@ -87,7 +87,7 @@
-(void)createModal
{
NSWindow *newWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, self.window.frame.size.width, 300) styleMask:NSTexturedBackgroundWindowMask backing:NSBackingStoreBuffered defer:NO];
NSWindow *newWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, self.window.frame.size.width, 300) styleMask:NSWindowStyleMaskTexturedBackground backing:NSBackingStoreBuffered defer:NO];
NSTextField *text = [[NSTextField alloc] initWithFrame:newWindow.frame];
text.editable = NO;

View file

@ -23,7 +23,7 @@
{
useImage = [image tintedImageWithColor:NSColor.whiteColor];
}
[useImage drawInRect:frame fromRect:NSMakeRect(0, 0, image.size.width, image.size.height) operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
[useImage drawInRect:frame fromRect:NSMakeRect(0, 0, image.size.width, image.size.height) operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
}
@end

View file

@ -49,7 +49,7 @@
CSTransitionBase *myTransition = self.representedObject;
bool toggleClick = [NSEvent modifierFlags] & NSShiftKeyMask;
bool toggleClick = [NSEvent modifierFlags] & NSEventModifierFlagShift;
if (toggleClick && myTransition.canToggle)
{

View file

@ -41,7 +41,7 @@
[self.transitionFilterWindow setContentSize:filterView.bounds.size];
[self.transitionFilterWindow.contentView addSubview:filterView];
self.transitionFilterWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
self.transitionFilterWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
[self.transitionFilterWindow setReleasedWhenClosed:NO];
[self.transitionFilterWindow makeKeyAndOrderFront:self.transitionFilterWindow];

View file

@ -52,7 +52,7 @@
[self.transitionFilterWindow setContentSize:filterView.bounds.size];
[self.transitionFilterWindow.contentView addSubview:filterView];
self.transitionFilterWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
self.transitionFilterWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
[self.transitionFilterWindow setReleasedWhenClosed:NO];
[self.transitionFilterWindow makeKeyAndOrderFront:self.transitionFilterWindow];

View file

@ -130,7 +130,7 @@
self.userFilterWindow.delegate = self;
[self.userFilterWindow setContentSize:filterView.bounds.size];
[self.userFilterWindow.contentView addSubview:filterView];
self.userFilterWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
self.userFilterWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
[self.userFilterWindow setReleasedWhenClosed:NO];
[self.userFilterWindow makeKeyAndOrderFront:self.userFilterWindow];

View file

@ -374,9 +374,15 @@
NSMutableDictionary *attributes = [NSMutableDictionary dictionary];
[attributes setValue:[NSNumber numberWithInt:size.width] forKey:(NSString *)kCVPixelBufferWidthKey];
[attributes setValue:[NSNumber numberWithInt:size.height] forKey:(NSString *)kCVPixelBufferHeightKey];
[attributes setValue:@{(NSString *)kIOSurfaceIsGlobal: @NO} forKey:(NSString *)kCVPixelBufferIOSurfacePropertiesKey];
[attributes setValue:@{} forKey:(NSString *)kCVPixelBufferIOSurfacePropertiesKey];
[attributes setValue:[NSNumber numberWithUnsignedInt:kCVPixelFormatType_32BGRA] forKey:(NSString *)kCVPixelBufferPixelFormatTypeKey];
[attributes setValue:@YES forKey:(NSString *)kCVPixelBufferMetalCompatibilityKey];
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateWithName(kCGColorSpaceGenericRGB);
CFDataRef rgbProfileData = CGColorSpaceCopyICCProfile(rgbColorSpace);
NSDictionary *poolAttachments = @{(NSString *)kCVImageBufferICCProfileKey : (__bridge NSData *)rgbProfileData, (NSString *)kCVImageBufferTransferFunctionKey: (NSString *)kCVImageBufferTransferFunction_ITU_R_709_2};
[attributes setValue:poolAttachments forKey:(NSString *)kCVBufferPropagatedAttachmentsKey];
CFRelease(rgbColorSpace);
if (_cvpool)
@ -416,6 +422,8 @@
-(void)dealloc
{
NSLog(@"DEALLOC RENDER %@", self);
if (_cvpool)
{
CVPixelBufferPoolRelease(_cvpool);

View file

@ -16,7 +16,7 @@
[copy lockFocus];
[color set];
NSRectFillUsingOperation(NSMakeRect(0, 0, self.size.width, self.size.height), NSCompositeSourceAtop);
NSRectFillUsingOperation(NSMakeRect(0, 0, self.size.width, self.size.height), NSCompositingOperationSourceAtop);
[copy unlockFocus];
return copy;
}

View file

@ -169,7 +169,7 @@
-(void)keyDown:(NSEvent *)theEvent
{
if ([theEvent.charactersIgnoringModifiers isEqualToString:@"f"] && (theEvent.modifierFlags & NSCommandKeyMask))
if ([theEvent.charactersIgnoringModifiers isEqualToString:@"f"] && (theEvent.modifierFlags & NSEventModifierFlagCommand))
{
[self toggleFullscreen:self];
}
@ -259,12 +259,12 @@
tmp = [self.sourceSettingsMenu insertItemWithTitle:@"Clone Without Cache" action:@selector(cloneInputSourceNoCache:) keyEquivalent:@"" atIndex:idx++];
tmp.target = self;
tmp.alternate = YES;
tmp.keyEquivalentModifierMask = NSAlternateKeyMask;
tmp.keyEquivalentModifierMask = NSEventModifierFlagOption;
tmp = [self.sourceSettingsMenu insertItemWithTitle:@"Make Source Private" action:@selector(privatizeSource:) keyEquivalent:@"" atIndex:idx++];
tmp.target = self;
tmp.alternate = YES;
tmp.keyEquivalentModifierMask = NSControlKeyMask;
tmp.keyEquivalentModifierMask = NSEventModifierFlagControl;
NSString *freezeString = @"Freeze";
if (self.selectedSource.isFrozen)
@ -589,7 +589,7 @@
bool doDeep = YES;
if (event.modifierFlags & NSControlKeyMask)
if (event.modifierFlags & NSEventModifierFlagControl)
{
doDeep = NO;
}
@ -658,7 +658,7 @@
InputSource *deepSource = [self.sourceLayout findSource:worldPoint deepParent:YES];
;
if (theEvent.modifierFlags & NSControlKeyMask)
if (theEvent.modifierFlags & NSEventModifierFlagControl)
{
self.selectedSource = topSource;
} else {
@ -715,17 +715,17 @@
if (self.isResizing)
{
if (theEvent.modifierFlags & NSAlternateKeyMask)
if (theEvent.modifierFlags & NSEventModifierFlagOption)
{
self.resizeType |= kResizeCenter;
}
if (theEvent.modifierFlags & NSControlKeyMask)
if (theEvent.modifierFlags & NSEventModifierFlagControl)
{
self.resizeType |= kResizeFree;
}
if (theEvent.modifierFlags & NSShiftKeyMask)
if (theEvent.modifierFlags & NSEventModifierFlagShift)
{
self.resizeType |= kResizeCrop;
}
@ -793,7 +793,7 @@
if (self.isResizing)
{
if (theEvent.modifierFlags & NSAlternateKeyMask)
if (theEvent.modifierFlags & NSEventModifierFlagOption)
{
self.resizeType |= kResizeCenter;
} else {
@ -2071,7 +2071,7 @@
configWindow.title = [NSString stringWithFormat:@"CocoaSplit Input (%@)", configSrc.name];
configWindow.delegate = self;
configWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
configWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
NSWindow *cWindow = [self.activeConfigWindows objectForKey:uuid];
NSViewController *cController = [self.activeConfigControllers objectForKey:uuid];

View file

@ -78,12 +78,12 @@
menuEntry = [itemMenu insertItemWithTitle:@"Clone Without Cache" action:@selector(cloneInputSourceNoCache:) keyEquivalent:@"" atIndex:idx++];
menuEntry.representedObject = item;
menuEntry.alternate = YES;
menuEntry.keyEquivalentModifierMask = NSAlternateKeyMask;
menuEntry.keyEquivalentModifierMask = NSEventModifierFlagOption;
menuEntry = [itemMenu insertItemWithTitle:@"Make Source Private" action:@selector(privatizeSource:) keyEquivalent:@"" atIndex:idx++];
menuEntry.representedObject = item;
menuEntry.alternate = YES;
menuEntry.keyEquivalentModifierMask = NSControlKeyMask;
menuEntry.keyEquivalentModifierMask = NSEventModifierFlagControl;
NSString *freezeStr = nil;
if (vidSrc.isFrozen)
@ -1274,7 +1274,7 @@
configWindow.title = [NSString stringWithFormat:@"CocoaSplit Input (%@)", configSrc.name];
configWindow.delegate = self;
configWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
configWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
NSWindow *cWindow = [_activeConfigWindows objectForKey:uuid];
NSViewController *cController = [_activeConfigControllers objectForKey:uuid];

View file

@ -367,7 +367,7 @@
self.userFilterWindow.delegate = self;
[self.userFilterWindow setContentSize:filterView.bounds.size];
[self.userFilterWindow.contentView addSubview:filterView];
self.userFilterWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
self.userFilterWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
[self.userFilterWindow setReleasedWhenClosed:NO];
[self.userFilterWindow makeKeyAndOrderFront:self.userFilterWindow];
@ -440,7 +440,7 @@
[self.transitionFilterWindow setContentSize:filterView.bounds.size];
[self.transitionFilterWindow.contentView addSubview:filterView];
self.transitionFilterWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
self.transitionFilterWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
[self.transitionFilterWindow setReleasedWhenClosed:NO];
[self.transitionFilterWindow makeKeyAndOrderFront:self.transitionFilterWindow];
@ -510,7 +510,7 @@
configWindow.title = [NSString stringWithFormat:@"CocoaSplit Input (%@)", windowController.inputSource.name];
configWindow.delegate = windowController.inputSource;
configWindow.styleMask = NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask;
configWindow.styleMask = NSWindowStyleMaskTitled|NSWindowStyleMaskClosable|NSWindowStyleMaskMiniaturizable;
windowController.inputSource.editorWindow = configWindow;
windowController.inputSource.editorController = windowController;