艦娘をちゅーちゅーします
修订版 | 3760c36d225f1e7c2ae36cc0b2b112b0f70c1f65 (tree) |
---|---|
时间 | 2017-08-08 00:01:19 |
作者 | masakih <masakih@user...> |
Commiter | masakih |
使用コア数を変更できるようにした
@@ -683,11 +683,11 @@ | ||
683 | 683 | <objects> |
684 | 684 | <viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="ExtractKanMusu" customModuleProvider="target" sceneMemberID="viewController"> |
685 | 685 | <view key="view" wantsLayer="YES" id="m2S-Jp-Qdl"> |
686 | - <rect key="frame" x="0.0" y="0.0" width="480" height="194"/> | |
686 | + <rect key="frame" x="0.0" y="0.0" width="480" height="224"/> | |
687 | 687 | <autoresizingMask key="autoresizingMask"/> |
688 | 688 | <subviews> |
689 | 689 | <pathControl verticalHuggingPriority="750" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="71Q-c3-4la"> |
690 | - <rect key="frame" x="63" y="132" width="399" height="22"/> | |
690 | + <rect key="frame" x="63" y="162" width="399" height="22"/> | |
691 | 691 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
692 | 692 | <pathCell key="cell" selectable="YES" alignment="left" id="k0s-i9-gmv"> |
693 | 693 | <font key="font" metaFont="system"/> |
@@ -695,7 +695,7 @@ | ||
695 | 695 | </pathCell> |
696 | 696 | </pathControl> |
697 | 697 | <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="4oW-wt-UOP"> |
698 | - <rect key="frame" x="20" y="160" width="125" height="17"/> | |
698 | + <rect key="frame" x="20" y="190" width="125" height="17"/> | |
699 | 699 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
700 | 700 | <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="キャッシュフォルダ:" id="940-lm-o1F"> |
701 | 701 | <font key="font" metaFont="system"/> |
@@ -704,7 +704,7 @@ | ||
704 | 704 | </textFieldCell> |
705 | 705 | </textField> |
706 | 706 | <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="B7G-JY-X3z"> |
707 | - <rect key="frame" x="20" y="97" width="89" height="17"/> | |
707 | + <rect key="frame" x="20" y="127" width="89" height="17"/> | |
708 | 708 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
709 | 709 | <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="出力フォルダ:" id="vkJ-JL-Cez"> |
710 | 710 | <font key="font" size="13" name=".HiraKakuInterface-W3"/> |
@@ -713,7 +713,7 @@ | ||
713 | 713 | </textFieldCell> |
714 | 714 | </textField> |
715 | 715 | <pathControl verticalHuggingPriority="750" fixedFrame="YES" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="gH1-Rc-sXz"> |
716 | - <rect key="frame" x="63" y="70" width="397" height="22"/> | |
716 | + <rect key="frame" x="63" y="100" width="397" height="22"/> | |
717 | 717 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
718 | 718 | <pathCell key="cell" selectable="YES" alignment="left" id="HrL-3G-mlv"> |
719 | 719 | <font key="font" metaFont="system"/> |
@@ -721,7 +721,7 @@ | ||
721 | 721 | </pathCell> |
722 | 722 | </pathControl> |
723 | 723 | <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="HKI-uw-FLe"> |
724 | - <rect key="frame" x="386" y="153" width="79" height="28"/> | |
724 | + <rect key="frame" x="386" y="183" width="79" height="28"/> | |
725 | 725 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
726 | 726 | <buttonCell key="cell" type="push" title="変更" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="acZ-cN-MBf"> |
727 | 727 | <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> |
@@ -732,7 +732,7 @@ | ||
732 | 732 | </connections> |
733 | 733 | </button> |
734 | 734 | <button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="uh6-t3-6Lo"> |
735 | - <rect key="frame" x="386" y="91" width="79" height="28"/> | |
735 | + <rect key="frame" x="386" y="121" width="79" height="28"/> | |
736 | 736 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
737 | 737 | <buttonCell key="cell" type="push" title="変更" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ie6-ZL-Re4"> |
738 | 738 | <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/> |
@@ -754,11 +754,11 @@ | ||
754 | 754 | </connections> |
755 | 755 | </button> |
756 | 756 | <box verticalHuggingPriority="750" fixedFrame="YES" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="wCq-gn-ahC"> |
757 | - <rect key="frame" x="13" y="121" width="449" height="5"/> | |
757 | + <rect key="frame" x="13" y="115" width="449" height="82"/> | |
758 | 758 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
759 | 759 | </box> |
760 | 760 | <box verticalHuggingPriority="750" fixedFrame="YES" boxType="separator" translatesAutoresizingMaskIntoConstraints="NO" id="WCG-o6-Xgb"> |
761 | - <rect key="frame" x="13" y="59" width="449" height="5"/> | |
761 | + <rect key="frame" x="13" y="88" width="449" height="10"/> | |
762 | 762 | <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> |
763 | 763 | </box> |
764 | 764 | <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mse-3Q-V9C"> |
@@ -770,6 +770,17 @@ | ||
770 | 770 | <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> |
771 | 771 | </textFieldCell> |
772 | 772 | </textField> |
773 | + <button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="16f-TP-PQe"> | |
774 | + <rect key="frame" x="20" y="61" width="89" height="18"/> | |
775 | + <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> | |
776 | + <buttonCell key="cell" type="check" title="Max Power" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="CqP-dF-MMv"> | |
777 | + <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> | |
778 | + <font key="font" metaFont="system"/> | |
779 | + </buttonCell> | |
780 | + <connections> | |
781 | + <binding destination="XfG-lQ-9wD" name="value" keyPath="maxPower" id="uIu-UN-2cm"/> | |
782 | + </connections> | |
783 | + </button> | |
773 | 784 | </subviews> |
774 | 785 | </view> |
775 | 786 | <connections> |
@@ -779,7 +790,7 @@ | ||
779 | 790 | </viewController> |
780 | 791 | <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/> |
781 | 792 | </objects> |
782 | - <point key="canvasLocation" x="75" y="617"/> | |
793 | + <point key="canvasLocation" x="75" y="632"/> | |
783 | 794 | </scene> |
784 | 795 | </scenes> |
785 | 796 | </document> |
@@ -34,6 +34,15 @@ class ViewController: NSViewController { | ||
34 | 34 | @IBOutlet var cachePathField: NSPathControl! |
35 | 35 | @IBOutlet var outputFolderField: NSPathControl! |
36 | 36 | |
37 | + dynamic var maxPower = false | |
38 | + | |
39 | + var useCoreCount: Int { | |
40 | + | |
41 | + let coreCount = ProcessInfo.processInfo.processorCount | |
42 | + | |
43 | + return maxPower ? coreCount : coreCount / 2 | |
44 | + } | |
45 | + | |
37 | 46 | let progress = ProgressPanelController() |
38 | 47 | |
39 | 48 | override func viewDidLoad() { |
@@ -46,7 +55,6 @@ class ViewController: NSViewController { | ||
46 | 55 | |
47 | 56 | outputFolderField.url = ApplicationDirecrories.desctop |
48 | 57 | |
49 | - | |
50 | 58 | } |
51 | 59 | |
52 | 60 | } |
@@ -174,7 +182,7 @@ extension ViewController { | ||
174 | 182 | |
175 | 183 | progress.message = "Extracting KanMusu Image from SWF file." |
176 | 184 | |
177 | - let semaphone = DispatchSemaphore(value: 4) | |
185 | + let semaphone = DispatchSemaphore(value: useCoreCount) | |
178 | 186 | let group = DispatchGroup() |
179 | 187 | let queue = DispatchQueue(label: "extract", attributes: .concurrent) |
180 | 188 |