more launch window tweaks.

This commit is contained in:
Kelvin Sherlock 2020-09-05 11:00:29 -04:00
parent be04b5a00b
commit 8906d7825f
2 changed files with 253 additions and 74 deletions

View File

@ -21,38 +21,16 @@
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Ample" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="Vze-YF-m6e">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<rect key="contentRect" x="335" y="390" width="718" height="763"/>
<rect key="contentRect" x="335" y="390" width="718" height="795"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<view key="contentView" id="Ssv-Jw-EE0">
<rect key="frame" x="0.0" y="0.0" width="718" height="763"/>
<rect key="frame" x="0.0" y="0.0" width="718" height="795"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="oVt-eD-aaj">
<rect key="frame" x="0.0" y="583" width="718" height="180"/>
<rect key="frame" x="0.0" y="615" width="718" height="180"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
</customView>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zVI-uU-muo">
<rect key="frame" x="18" y="102" width="71" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="Window" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="vx1-I7-8kN">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameWindow" id="uS7-cg-wqb"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZUp-ni-Rr6">
<rect key="frame" x="18" y="82" width="62" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="Debug" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="6is-QN-JEc">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameDebug" id="vkc-sR-KnB"/>
</connections>
</button>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pKK-yY-vnY">
<rect key="frame" x="0.0" y="0.0" width="718" height="52"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
@ -80,39 +58,6 @@ DQ
<action selector="launchAction:" target="-2" id="a4d-zv-1CU"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="rLP-n2-0eY">
<rect key="frame" x="18" y="62" width="91" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="No Throttle" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="NyE-jT-WqC">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameNoThrottle" id="tUN-EX-7PF"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="D5h-dm-fuZ">
<rect key="frame" x="131" y="102" width="104" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="Square Pixels" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="yWK-BP-7Z9">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameSquarePixels" id="BiP-wC-Hpn"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zoQ-mU-ARl">
<rect key="frame" x="261" y="102" width="67" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="No Blur" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="r3s-5h-Xv5">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameNoBlur" id="Pvn-zw-OsQ"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="nNO-3T-OAy">
<rect key="frame" x="470" y="58" width="109" height="23"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
@ -126,17 +71,206 @@ DQ
<action selector="resetSlots:" target="lyS-mc-3Tf" id="1qi-N0-Q8B"/>
</connections>
</button>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="J9O-xI-P5J" customClass="FlippedView">
<rect key="frame" x="392" y="212" width="306" height="363"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
</customView>
<customView id="P9d-sS-qEb" customClass="FlippedView">
<rect key="frame" x="20" y="212" width="306" height="363"/>
<rect key="frame" x="20" y="92" width="306" height="363"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
</customView>
<tabView initialItem="nr5-4o-DyG" id="l8R-bg-6Zm">
<rect key="frame" x="13" y="453" width="692" height="160"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<font key="font" metaFont="system"/>
<tabViewItems>
<tabViewItem label="Options" identifier="" id="nr5-4o-DyG">
<view key="view" id="ElY-YI-LLI">
<rect key="frame" x="10" y="33" width="672" height="114"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zVI-uU-muo">
<rect key="frame" x="15" y="60" width="71" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Window" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="vx1-I7-8kN">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameWindow" id="uS7-cg-wqb"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ZUp-ni-Rr6">
<rect key="frame" x="15" y="29" width="62" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Debug" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="6is-QN-JEc">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameDebug" id="vkc-sR-KnB"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="D5h-dm-fuZ">
<rect key="frame" x="165" y="60" width="104" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Square Pixels" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="yWK-BP-7Z9">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameSquarePixels" id="BiP-wC-Hpn"/>
</connections>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="zoQ-mU-ARl">
<rect key="frame" x="315" y="60" width="67" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="No Blur" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="r3s-5h-Xv5">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameNoBlur" id="Pvn-zw-OsQ"/>
</connections>
</button>
<popUpButton verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FE4-gG-fPb">
<rect key="frame" x="62" y="87" width="107" height="25"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="100%" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" tag="1" imageScaling="proportionallyDown" inset="2" selectedItem="yoI-Ra-evu" id="M40-f0-awc">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<menu key="menu" id="8Tv-0j-JhQ">
<items>
<menuItem title="100%" state="on" tag="1" id="yoI-Ra-evu"/>
<menuItem title="200%" tag="2" id="UqT-yd-8o3"/>
<menuItem title="300%" tag="3" id="awG-S1-uM4"/>
<menuItem title="400%" tag="4" id="qJ5-Ed-W5U"/>
<menuItem title="500%" tag="5" id="Phc-uW-Qog"/>
<menuItem title="No Throttle" tag="-1" id="gAc-ME-eim"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<binding destination="-2" name="selectedTag" keyPath="self.mameSpeed" id="nFG-yA-KC1"/>
</connections>
</popUpButton>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PGK-yK-2ZK">
<rect key="frame" x="15" y="93" width="43" height="16"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Speed" id="D9w-Mz-PXs">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</tabViewItem>
<tabViewItem label="A/V" identifier="" id="0T5-BN-lxE">
<view key="view" id="knw-WE-UU3">
<rect key="frame" x="10" y="33" width="672" height="114"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vWt-Dx-OGG">
<rect key="frame" x="15" y="91" width="102" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Generate AVI" bezelStyle="regularSquare" imagePosition="left" inset="2" id="hRp-Lh-Ebr">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
<connections>
<binding destination="-2" name="value" keyPath="self.mameAVI" id="G1O-YP-DXa"/>
</connections>
</buttonCell>
</button>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Ejn-wC-UXH">
<rect key="frame" x="15" y="60" width="110" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Generate WAV" bezelStyle="regularSquare" imagePosition="left" inset="2" id="7Aa-N2-MHn">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameWAV" id="4r0-ZQ-nNC"/>
</connections>
</button>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="5Yf-ZJ-8kx">
<rect key="frame" x="132" y="59" width="523" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="/path/to/file.wav" drawsBackground="YES" id="Xqc-zw-28b">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.mameWAV" id="lZM-6n-jAS"/>
<binding destination="-2" name="value" keyPath="self.mameWAVPath" id="475-s3-0e4">
<dictionary key="options">
<string key="NSNullPlaceholder">/path/to/file.wav</string>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="ne8-5I-D1H">
<rect key="frame" x="132" y="28" width="523" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="/path/to/file.vgm" drawsBackground="YES" id="xGs-Mi-wzj">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
<connections>
<binding destination="-2" name="enabled" keyPath="self.mameVGM" id="TJV-4j-uVi"/>
<binding destination="-2" name="value" keyPath="self.mameVGMPath" id="aK1-2A-QWB">
<dictionary key="options">
<string key="NSNoSelectionPlaceholder">/path/to/file.vgm</string>
</dictionary>
</binding>
</connections>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.mameVGM" id="JZX-dA-3Bn"/>
<binding destination="-2" name="value" keyPath="self.mameVGMPath" id="m7G-a0-QDZ">
<dictionary key="options">
<string key="NSNullPlaceholder">/path/to/file.vgm</string>
</dictionary>
</binding>
</connections>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Xht-PS-Hw8">
<rect key="frame" x="132" y="90" width="523" height="21"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" borderStyle="bezel" placeholderString="/path/to/file.avi" drawsBackground="YES" id="iY4-FF-x2e">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="enabled" keyPath="self.mameAVI" id="o4R-KR-zVV"/>
<binding destination="-2" name="value" keyPath="self.mameAVIPath" id="dSK-1u-lh6">
<dictionary key="options">
<string key="NSNullPlaceholder">/path/to/file.avi</string>
</dictionary>
</binding>
</connections>
</textField>
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="YVz-a3-9Pj">
<rect key="frame" x="15" y="29" width="111" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Generate VGM" bezelStyle="regularSquare" imagePosition="left" inset="2" id="F9b-kg-ZMV">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="-2" name="value" keyPath="self.mameVGM" id="Oyp-Pc-Uad"/>
</connections>
</button>
</subviews>
</view>
</tabViewItem>
</tabViewItems>
</tabView>
<customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="J9O-xI-P5J" customClass="FlippedView">
<rect key="frame" x="392" y="92" width="306" height="363"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMinY="YES"/>
</customView>
</subviews>
</view>
<point key="canvasLocation" x="769" y="104.5"/>
<point key="canvasLocation" x="769" y="120.5"/>
</window>
<viewController title="Media View" nibName="MediaView" id="t7c-zy-czN" customClass="MediaViewController"/>
<viewController title="Slot View" nibName="SlotView" id="lyS-mc-3Tf" customClass="SlotViewController"/>

View File

@ -37,7 +37,15 @@ static NSString *kContextMachine = @"kContextMachine";
@property BOOL mameSquarePixels;
@property BOOL mameNoBlur;
@property BOOL mameAVI;
@property BOOL mameWAV;
@property BOOL mameVGM;
@property NSString *mameAVIPath;
@property NSString *mameWAVPath;
@property NSString *mameVGMPath;
@property NSInteger mameSpeed;
@end
@ -48,6 +56,10 @@ static NSString *kContextMachine = @"kContextMachine";
return @"LaunchWindow";
}
-(void)windowWillLoad {
[self setMameSpeed: 1];
}
- (void)windowDidLoad {
[super windowDidLoad];
@ -58,23 +70,29 @@ static NSString *kContextMachine = @"kContextMachine";
[_mediaView addSubview: [_mediaController view]];
[_machineView addSubview: [_machineViewController view]];
[self addObserver: self forKeyPath: @"mameMachine" options:0 context: (__bridge void * _Nullable)(kMyContext)];
[self addObserver: self forKeyPath: @"mameWindow" options:0 context: (__bridge void * _Nullable)(kMyContext)];
[self addObserver: self forKeyPath: @"mameSquarePixels" options:0 context: (__bridge void * _Nullable)(kMyContext)];
[self addObserver: self forKeyPath: @"mameDebug" options:0 context: (__bridge void * _Nullable)(kMyContext)];
[self addObserver: self forKeyPath: @"mameNoThrottle" options:0 context: (__bridge void * _Nullable)(kMyContext)];
[self addObserver: self forKeyPath: @"mameNoBlur" options:0 context: (__bridge void * _Nullable)(kMyContext)];
NSArray *keys = @[
@"mameMachine", @"mameWindow", @"mameSquarePixels", @"mameNoBlur",
@"mameDebug",
@"mameSpeed", // @"mameNoThrottle",
@"mameAVI", @"mameAVIPath",
@"mameWAV", @"mameWAVPath",
@"mameVGM", @"mameVGMPath",
];
for (NSString *key in keys) {
[self addObserver: self forKeyPath: key options:0 context: (__bridge void * _Nullable)(kMyContext)];
}
[_slotController addObserver: self forKeyPath: @"args" options: 0 context: (__bridge void * _Nullable)(kMyContext)];
[_mediaController addObserver: self forKeyPath: @"args" options: 0 context: (__bridge void * _Nullable)(kMyContext)];
[_mediaController bind: @"media" toObject: _slotController withKeyPath: @"media" options: 0];
[self buildCommandLine];
[_machineViewController addObserver: self forKeyPath: @"machine" options: 0 context: (__bridge void * _Nullable)kContextMachine];
[self buildCommandLine];
}
@ -198,6 +216,8 @@ static NSString * JoinArguments(NSArray *argv) {
-(void)buildCommandLine {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
if (!_mameMachine) {
[self setCommandLine: @""];
return;
@ -249,8 +269,33 @@ static NSString * JoinArguments(NSArray *argv) {
[argv addObjectsFromArray: tmp];
}
if (_mameNoThrottle) [argv addObject: @"-nothrottle"];
//if (_mameNoThrottle) [argv addObject: @"-nothrottle"];
if (_mameSpeed < 0) {
[argv addObject: @"-nothrottle"];
} else if (_mameSpeed > 1) {
[argv addObject: @"-speed"];
[argv addObject: [NSString stringWithFormat: @"%d", (int)_mameSpeed]];
}
// audio video.
if (_mameAVI && [_mameAVIPath length]) {
[argv addObject: @"-aviwrite"];
[argv addObject: _mameAVIPath];
}
if (_mameWAV && [_mameWAVPath length]) {
[argv addObject: @"-wavwrite"];
[argv addObject: _mameWAVPath];
}
// vgm only valid for custom mame.
if (![defaults boolForKey: kUseCustomMame]) {
if (_mameVGM && [_mameVGMPath length]) {
[argv addObject: @"-vgmwrite"];
[argv addObject: _mameVGMPath];
}
}
[self setCommandLine: JoinArguments(argv)];
[self setArgs: argv];