Movie sources now default to playing when live, including when drag+dropped into a layout

This commit is contained in:
Zakk 2019-02-04 10:28:57 -05:00
parent 01bfad1ca2
commit ddd87b07b7
7 changed files with 29 additions and 27 deletions

View file

@ -20,7 +20,7 @@
_lastSize = NSZeroSize;
self.needsSourceSelection = NO;
self.playWhenLive = YES;
self.updateMovieTime = YES;
self.activeVideoDevice = [[CSAbstractCaptureDevice alloc] init];
_firstFrame = YES;
@ -381,6 +381,7 @@
[super setIsVisible:isVisible];
if (isVisible && self.playWhenLive && !self.player.playing)
{
[self.player play];
if (self.useCurrentPosition)
{
@ -482,6 +483,7 @@
if (!self.pcmPlayer)
{
self.pcmPlayer = [self createAttachedAudioInputForUUID:self.uuid withName:withName withFormat:&_asbd];
if (self.pcmPlayer && self.player)
{
self.player.asbd = &_asbd;

View file

@ -865,7 +865,7 @@ OSStatus encoderRenderCallback( void *inRefCon, AudioUnitRenderActionFlags *ioAc
newConverter.sourceNode = input;
input.converterNode = newConverter;
input.enabled = NO;
input.enabled = YES;
[self attachInput:input];

View file

@ -88,7 +88,7 @@
-(void)restoreDataFromDict:(NSDictionary *)restoreDict
{
self.enabled = [restoreDict[@"enabled"] boolValue];
self.volume = [restoreDict[@"volume"] floatValue];

View file

@ -28,7 +28,7 @@
_inputFormat = NULL;
self.latestScheduledTime = 0;
_pauseBuffer = [[NSMutableArray alloc] init];
self.enabled = NO;
self.enabled = YES;
_exitPending = NO;
}

View file

@ -24,6 +24,8 @@
{
[self createUUID];
self.active = YES;
self.audioEnabled = YES;
self.audioVolume = 1.0;
}
return self;
@ -36,9 +38,9 @@
if (self = [self init])
{
self.audioUUID = path;
self.audioVolume = 0;
self.audioVolume = 1.0;
self.name = [path lastPathComponent];
self.audioEnabled = NO;
self.audioEnabled = YES;
self.audioFilePath = path;
self.fileDuration = [CAMultiAudioFile durationForPath:path];
self.fileEndTime = self.fileDuration;
@ -136,7 +138,10 @@
{
self.audioUUID = [aDecoder decodeObjectForKey:@"audioUUID"];
self.audioVolume = [aDecoder decodeFloatForKey:@"audioVolume"];
self.audioEnabled = [aDecoder decodeBoolForKey:@"audioEnabled"];
if ([aDecoder containsValueForKey:@"audioEnabled"])
{
self.audioEnabled = [aDecoder decodeBoolForKey:@"audioEnabled"];
}
self.audioFilePath = [aDecoder decodeObjectForKey:@"audioFilePath"];

View file

@ -362,7 +362,6 @@ static NSArray *_sourceTypes = nil;
NSRect tmpRect = NSIntegralRect(NSMakeRect(x_pos, y_pos, width, height));
NSLog(@"RESTORED RECT %@", NSStringFromRect(tmpRect));
self.layer.position = CGPointMake(tmpRect.origin.x, tmpRect.origin.y);
self.layer.bounds = CGRectMake(0, 0, tmpRect.size.width, tmpRect.size.height);

View file

@ -9,7 +9,6 @@
<customObject id="-2" userLabel="File's Owner" customClass="InputPopupControllerViewController">
<connections>
<outlet property="backgroundFilterViewController" destination="arq-y0-MNl" id="S27-aF-eKH"/>
<outlet property="height_field" destination="oeD-Hg-xTl" id="U7Y-R5-WCM"/>
<outlet property="inputFilterViewController" destination="b31-q9-7JS" id="cvO-Pu-J16"/>
<outlet property="inputobjctrl" destination="Gdf-y2-DdF" id="FT4-F8-KVU"/>
<outlet property="multiSourceController" destination="4mF-fx-iLB" id="U30-Tg-7IY"/>
@ -18,9 +17,6 @@
<outlet property="sourceConfigView" destination="qdF-gh-veZ" id="EeZ-cn-GeU"/>
<outlet property="sourceFilterViewController" destination="Ipm-Cn-5NK" id="Ge5-yf-IDd"/>
<outlet property="view" destination="E8C-YL-16h" id="aVS-B5-cxz"/>
<outlet property="width_field" destination="A7H-lh-SHi" id="ODg-5z-UHd"/>
<outlet property="x_pos_field" destination="4YP-40-KAW" id="9ON-jY-qpM"/>
<outlet property="y_pos_field" destination="eFs-Ve-sRh" id="njM-SP-BKj"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
@ -31,11 +27,11 @@
<tabViewItems>
<tabViewItem label="Settings" identifier="2" id="iXD-as-NHa">
<view key="view" id="byO-4p-D9j">
<rect key="frame" x="10" y="25" width="642" height="428"/>
<rect key="frame" x="10" y="29" width="642" height="424"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="EBg-Vi-cL7">
<rect key="frame" x="15" y="355" width="53" height="14"/>
<rect key="frame" x="15" y="351" width="53" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Source" id="YYN-k4-jke">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -51,7 +47,7 @@
</connections>
</textField>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Icu-pd-WRg">
<rect key="frame" x="64" y="376" width="243" height="22"/>
<rect key="frame" x="64" y="372" width="243" height="22"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="eyR-QZ-n8r">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@ -69,7 +65,7 @@
</connections>
</popUpButton>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gJP-2X-7HB">
<rect key="frame" x="15" y="377" width="35" height="18"/>
<rect key="frame" x="15" y="373" width="35" height="18"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Type" id="kpE-OE-l7z">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -77,7 +73,7 @@
</textFieldCell>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="GaR-E0-cDn">
<rect key="frame" x="307" y="397" width="80" height="27"/>
<rect key="frame" x="307" y="393" width="80" height="27"/>
<buttonCell key="cell" type="push" title="Auto Fit" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Dv6-1D-ZwG">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@ -91,7 +87,7 @@
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="bWQ-Fl-ROJ">
<rect key="frame" x="15" y="406" width="35" height="13"/>
<rect key="frame" x="15" y="402" width="35" height="13"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Name" id="hR6-Ol-IPm">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
@ -99,7 +95,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="X91-Lt-pl4">
<rect key="frame" x="67" y="402" width="237" height="19"/>
<rect key="frame" x="67" y="398" width="237" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="237" id="2vb-nA-dVb"/>
</constraints>
@ -117,10 +113,10 @@
</connections>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="qdF-gh-veZ">
<rect key="frame" x="17" y="1" width="608" height="330"/>
<rect key="frame" x="17" y="1" width="608" height="326"/>
</customView>
<button translatesAutoresizingMaskIntoConstraints="NO" id="Eoh-8E-U5F">
<rect key="frame" x="312" y="379" width="72" height="18"/>
<rect key="frame" x="312" y="375" width="72" height="18"/>
<constraints>
<constraint firstAttribute="width" constant="67" id="nAZ-T1-2BD"/>
</constraints>
@ -137,10 +133,10 @@
</connections>
</button>
<box verticalHuggingPriority="750" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="gFW-Ox-2QM">
<rect key="frame" x="17" y="337" width="608" height="5"/>
<rect key="frame" x="17" y="333" width="608" height="5"/>
</box>
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ESc-uJ-Gih">
<rect key="frame" x="64" y="349" width="243" height="23"/>
<rect key="frame" x="64" y="345" width="243" height="23"/>
<popUpButtonCell key="cell" type="push" bezelStyle="rounded" alignment="left" controlSize="small" lineBreakMode="truncatingTail" borderStyle="borderAndBezel" imageScaling="proportionallyDown" inset="2" id="Uwd-iE-r9j">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
@ -168,7 +164,7 @@
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="uB7-QF-9Sy">
<rect key="frame" x="388" y="405" width="67" height="14"/>
<rect key="frame" x="388" y="401" width="67" height="14"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Video Delay" id="aua-f6-BhG">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@ -176,7 +172,7 @@
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7CX-iq-haH">
<rect key="frame" x="461" y="402" width="37" height="19"/>
<rect key="frame" x="461" y="398" width="37" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="37" id="TC5-3u-8Ll"/>
</constraints>
@ -190,7 +186,7 @@
</connections>
</textField>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="afT-Ro-9fT">
<rect key="frame" x="312" y="352" width="62" height="20"/>
<rect key="frame" x="312" y="348" width="62" height="20"/>
<constraints>
<constraint firstAttribute="width" constant="57" id="WQ3-Rr-jPg"/>
</constraints>
@ -203,7 +199,7 @@
</connections>
</button>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2ga-xZ-eXu">
<rect key="frame" x="389" y="352" width="92" height="20"/>
<rect key="frame" x="389" y="348" width="92" height="20"/>
<buttonCell key="cell" type="check" title="Keep Cached" bezelStyle="regularSquare" imagePosition="left" controlSize="small" state="on" inset="2" id="l5S-cD-7cc">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="smallSystem"/>