• R/O
  • HTTP
  • SSH
  • HTTPS

提交

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

艦娘をちゅーちゅーします


Commit MetaInfo

修订版3760c36d225f1e7c2ae36cc0b2b112b0f70c1f65 (tree)
时间2017-08-08 00:01:19
作者masakih <masakih@user...>
Commitermasakih

Log Message

使用コア数を変更できるようにした

更改概述

差异

--- a/ExtractKanMusu/Base.lproj/Main.storyboard
+++ b/ExtractKanMusu/Base.lproj/Main.storyboard
@@ -683,11 +683,11 @@
683683 <objects>
684684 <viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="ExtractKanMusu" customModuleProvider="target" sceneMemberID="viewController">
685685 <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"/>
687687 <autoresizingMask key="autoresizingMask"/>
688688 <subviews>
689689 <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"/>
691691 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
692692 <pathCell key="cell" selectable="YES" alignment="left" id="k0s-i9-gmv">
693693 <font key="font" metaFont="system"/>
@@ -695,7 +695,7 @@
695695 </pathCell>
696696 </pathControl>
697697 <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"/>
699699 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
700700 <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="キャッシュフォルダ:" id="940-lm-o1F">
701701 <font key="font" metaFont="system"/>
@@ -704,7 +704,7 @@
704704 </textFieldCell>
705705 </textField>
706706 <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"/>
708708 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
709709 <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="出力フォルダ:" id="vkJ-JL-Cez">
710710 <font key="font" size="13" name=".HiraKakuInterface-W3"/>
@@ -713,7 +713,7 @@
713713 </textFieldCell>
714714 </textField>
715715 <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"/>
717717 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
718718 <pathCell key="cell" selectable="YES" alignment="left" id="HrL-3G-mlv">
719719 <font key="font" metaFont="system"/>
@@ -721,7 +721,7 @@
721721 </pathCell>
722722 </pathControl>
723723 <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"/>
725725 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
726726 <buttonCell key="cell" type="push" title="変更" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="acZ-cN-MBf">
727727 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -732,7 +732,7 @@
732732 </connections>
733733 </button>
734734 <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"/>
736736 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
737737 <buttonCell key="cell" type="push" title="変更" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="ie6-ZL-Re4">
738738 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
@@ -754,11 +754,11 @@
754754 </connections>
755755 </button>
756756 <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"/>
758758 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
759759 </box>
760760 <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"/>
762762 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
763763 </box>
764764 <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mse-3Q-V9C">
@@ -770,6 +770,17 @@
770770 <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
771771 </textFieldCell>
772772 </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>
773784 </subviews>
774785 </view>
775786 <connections>
@@ -779,7 +790,7 @@
779790 </viewController>
780791 <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
781792 </objects>
782- <point key="canvasLocation" x="75" y="617"/>
793+ <point key="canvasLocation" x="75" y="632"/>
783794 </scene>
784795 </scenes>
785796 </document>
--- a/ExtractKanMusu/ViewController.swift
+++ b/ExtractKanMusu/ViewController.swift
@@ -34,6 +34,15 @@ class ViewController: NSViewController {
3434 @IBOutlet var cachePathField: NSPathControl!
3535 @IBOutlet var outputFolderField: NSPathControl!
3636
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+
3746 let progress = ProgressPanelController()
3847
3948 override func viewDidLoad() {
@@ -46,7 +55,6 @@ class ViewController: NSViewController {
4655
4756 outputFolderField.url = ApplicationDirecrories.desctop
4857
49-
5058 }
5159
5260 }
@@ -174,7 +182,7 @@ extension ViewController {
174182
175183 progress.message = "Extracting KanMusu Image from SWF file."
176184
177- let semaphone = DispatchSemaphore(value: 4)
185+ let semaphone = DispatchSemaphore(value: useCoreCount)
178186 let group = DispatchGroup()
179187 let queue = DispatchQueue(label: "extract", attributes: .concurrent)
180188