Skip to content

Commit

Permalink
Merge branch 'develop'- build2
Browse files Browse the repository at this point in the history
  • Loading branch information
lhc70000 committed Jan 12, 2017
2 parents 5f36683 + b9673c9 commit dfca479
Show file tree
Hide file tree
Showing 44 changed files with 992 additions and 162 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Document http://editorconfig.org

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
indent_size = 2

[iina/scripts/*]
indent_size = 4

[libmpv/include/mpv/*]
indent_size = 4
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ target 'iina' do

# Pods for iina
pod 'MASPreferences'
pod 'Just'

# target 'iinaTests' do
# inherit! :search_paths
Expand Down
5 changes: 4 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
PODS:
- Just (0.5.7)
- MASPreferences (1.1.4)

DEPENDENCIES:
- Just
- MASPreferences

SPEC CHECKSUMS:
Just: d19e769d86b965e39ae58cb3c0cbad07706634a8
MASPreferences: 7bdcfe891d7840453cf48f95fa866c3e152ace7a

PODFILE CHECKSUM: 1c4e3202e88a4154f713ccae52801c835a85e231
PODFILE CHECKSUM: 1660afcf8e29f4d915d2c02e6adc97cd9068a0dd

COCOAPODS: 1.2.0.beta.3
34 changes: 34 additions & 0 deletions iina.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@
84A0BA9B1D2FAB4100BC8DA1 /* Parameter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A0BA9A1D2FAB4100BC8DA1 /* Parameter.swift */; };
84A0BA9E1D2FAD4000BC8DA1 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A0BA9C1D2FAD4000BC8DA1 /* MainWindowController.swift */; };
84A0BAA11D2FAE7600BC8DA1 /* VideoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A0BAA01D2FAE7600BC8DA1 /* VideoView.swift */; };
84A886E41E24F37D008755BB /* ShooterSubtitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A886E31E24F37D008755BB /* ShooterSubtitle.swift */; };
84A886E61E24F3BD008755BB /* OnlineSubtitle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A886E51E24F3BD008755BB /* OnlineSubtitle.swift */; };
84A886EC1E2573A5008755BB /* JustExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A886EB1E2573A5008755BB /* JustExtension.swift */; };
84A886EE1E269A2A008755BB /* iina-default-input.conf in Resources */ = {isa = PBXBuildFile; fileRef = 84A886ED1E269A2A008755BB /* iina-default-input.conf */; };
84A886EF1E269E67008755BB /* iina-default-input.conf in Copy Configs */ = {isa = PBXBuildFile; fileRef = 84A886ED1E269A2A008755BB /* iina-default-input.conf */; };
84A886F11E26A2CB008755BB /* UpdateChecker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A886F01E26A2CB008755BB /* UpdateChecker.swift */; };
84A886F31E26CA24008755BB /* Regex.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84A886F21E26CA24008755BB /* Regex.swift */; };
84AABE8B1DBF634600D138FD /* CharEncoding.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AABE8A1DBF634600D138FD /* CharEncoding.swift */; };
84AABE941DBFAF1A00D138FD /* FontPickerWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84AABE921DBFAF1A00D138FD /* FontPickerWindowController.swift */; };
84AABE981DBFB62F00D138FD /* FixedFontManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AABE971DBFB62F00D138FD /* FixedFontManager.m */; };
Expand Down Expand Up @@ -183,6 +190,7 @@
dstPath = config;
dstSubfolderSpec = 7;
files = (
84A886EF1E269E67008755BB /* iina-default-input.conf in Copy Configs */,
844D72EF1E056E1400522E5E /* input.conf in Copy Configs */,
);
name = "Copy Configs";
Expand Down Expand Up @@ -306,6 +314,12 @@
84A0BA9A1D2FAB4100BC8DA1 /* Parameter.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Parameter.swift; sourceTree = "<group>"; };
84A0BA9C1D2FAD4000BC8DA1 /* MainWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = "<group>"; };
84A0BAA01D2FAE7600BC8DA1 /* VideoView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VideoView.swift; sourceTree = "<group>"; };
84A886E31E24F37D008755BB /* ShooterSubtitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ShooterSubtitle.swift; sourceTree = "<group>"; };
84A886E51E24F3BD008755BB /* OnlineSubtitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OnlineSubtitle.swift; sourceTree = "<group>"; };
84A886EB1E2573A5008755BB /* JustExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = JustExtension.swift; sourceTree = "<group>"; };
84A886ED1E269A2A008755BB /* iina-default-input.conf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "iina-default-input.conf"; sourceTree = "<group>"; };
84A886F01E26A2CB008755BB /* UpdateChecker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UpdateChecker.swift; sourceTree = "<group>"; };
84A886F21E26CA24008755BB /* Regex.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Regex.swift; sourceTree = "<group>"; };
84AABE8A1DBF634600D138FD /* CharEncoding.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CharEncoding.swift; sourceTree = "<group>"; };
84AABE921DBFAF1A00D138FD /* FontPickerWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FontPickerWindowController.swift; sourceTree = "<group>"; };
84AABE961DBFB62F00D138FD /* FixedFontManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixedFontManager.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -484,6 +498,7 @@
84A0BAA61D2FAF8400BC8DA1 /* Utils */ = {
isa = PBXGroup;
children = (
84A886E21E24F2D3008755BB /* Sub */,
8497A4831D2FF573005F504F /* iina-Bridging-Header.h */,
84A0BA9A1D2FAB4100BC8DA1 /* Parameter.swift */,
84EB1F061D2F5E76004FA5A1 /* Utility.swift */,
Expand All @@ -499,6 +514,8 @@
84795C361E0825AD0059A648 /* GifGenerator.swift */,
8488D6DB1E1167EF00D5B952 /* FileSize.swift */,
841A599C1E1FF5800079E177 /* SleepPreventer.swift */,
84A886F01E26A2CB008755BB /* UpdateChecker.swift */,
84A886F21E26CA24008755BB /* Regex.swift */,
);
name = Utils;
sourceTree = "<group>";
Expand Down Expand Up @@ -530,6 +547,16 @@
name = Data;
sourceTree = "<group>";
};
84A886E21E24F2D3008755BB /* Sub */ = {
isa = PBXGroup;
children = (
84A886E31E24F37D008755BB /* ShooterSubtitle.swift */,
84A886E51E24F3BD008755BB /* OnlineSubtitle.swift */,
84A886EB1E2573A5008755BB /* JustExtension.swift */,
);
name = Sub;
sourceTree = "<group>";
};
84D377681D7413D8007F7396 /* Accessories */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -560,6 +587,7 @@
84E745D71DFDE8C100588DED /* config */ = {
isa = PBXGroup;
children = (
84A886ED1E269A2A008755BB /* iina-default-input.conf */,
84E745D81DFDE8C100588DED /* input.conf */,
);
name = config;
Expand Down Expand Up @@ -713,6 +741,7 @@
8400D5C91E1AB2F9006785F5 /* QuickSettingViewController.xib in Resources */,
84EB1EDC1D2F51D3004FA5A1 /* Assets.xcassets in Resources */,
8400D5E41E1AB333006785F5 /* PrefControlViewController.xib in Resources */,
84A886EE1E269A2A008755BB /* iina-default-input.conf in Resources */,
84A0BA951D2F9E9600BC8DA1 /* MainMenu.xib in Resources */,
8400D5D81E1AB31B006785F5 /* AboutWindowController.xib in Resources */,
8452DD8B1D3CB519008A543A /* fragmentShader.glsl in Resources */,
Expand Down Expand Up @@ -790,8 +819,10 @@
8488D6E31E1183D300D5B952 /* PrefSubViewController.swift in Sources */,
84E745D61DFDD4FD00588DED /* KeyCodeHelper.swift in Sources */,
840D479B1DFEF649000D9A64 /* KeyRecordViewController.swift in Sources */,
84A886EC1E2573A5008755BB /* JustExtension.swift in Sources */,
84D377631D6B66DE007F7396 /* MPVPlaylistItem.swift in Sources */,
8400D5C41E17C6D2006785F5 /* AboutWindowController.swift in Sources */,
84A886E41E24F37D008755BB /* ShooterSubtitle.swift in Sources */,
84BEEC421DFEE46200F945CA /* StreamReader.swift in Sources */,
84879A9B1E1032480004F894 /* ShortcutAvailableTextField.swift in Sources */,
84EB1F071D2F5E76004FA5A1 /* Utility.swift in Sources */,
Expand All @@ -818,9 +849,11 @@
84A0BA901D2F8D4100BC8DA1 /* IINAError.swift in Sources */,
847644081D48B413004F6DF5 /* MPVOption.swift in Sources */,
84817C961DBDCA5F00CC2279 /* SettingsListCellView.swift in Sources */,
84A886F31E26CA24008755BB /* Regex.swift in Sources */,
8487BEC31D76A1AF00FD17B0 /* MenuController.swift in Sources */,
8450403D1E0A9EE20079C194 /* InspectorWindowController.swift in Sources */,
841A599D1E1FF5800079E177 /* SleepPreventer.swift in Sources */,
84A886F11E26A2CB008755BB /* UpdateChecker.swift in Sources */,
8434BAA91D5E3C2B003BECF2 /* Formatters.swift in Sources */,
84ED99FF1E009C8100A5159B /* PrefAdvancedViewController.swift in Sources */,
84AABE8B1DBF634600D138FD /* CharEncoding.swift in Sources */,
Expand All @@ -843,6 +876,7 @@
84F7258F1D486185000DEF1B /* MPVProperty.swift in Sources */,
84A0BA971D2FA1CE00BC8DA1 /* PlayerCore.swift in Sources */,
84D377671D737F58007F7396 /* MPVChapter.swift in Sources */,
84A886E61E24F3BD008755BB /* OnlineSubtitle.swift in Sources */,
847C62CA1DC13CDA00E1EF16 /* PrefGeneralViewController.swift in Sources */,
845FB0C71D39462E00C011E0 /* ControlBarView.swift in Sources */,
84A0BA991D2FAAA700BC8DA1 /* MPVController.swift in Sources */,
Expand Down
3 changes: 1 addition & 2 deletions iina/AppData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ struct AppData {
/** generate aspect and crop options in menu */
static let aspects: [String] = ["4:3", "5:4", "16:9", "16:10", "1:1", "3:2", "2.21:1", "2.35:1", "2.39:1"]

static let aspectRegex = Utility.Regex("\\A\\d+(\\.\\d+)?:\\d+(\\.\\d+)?\\Z")

static let rotations: [Int] = [0, 90, 180, 270]

/** Seek amount */
Expand All @@ -45,6 +43,7 @@ struct AppData {
static let watchLaterFolder = "watch_later"

static let githubLink = "https://github.com/lhc70000/iina"
static let githubReleaseLink = "https://github.com/lhc70000/iina/releases"
static let websiteLink = "https://lhc70000.github.io/iina/"
static let emailLink = "lhc199652@gmail.com"

Expand Down
15 changes: 14 additions & 1 deletion iina/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ class AppDelegate: NSObject, NSApplicationDelegate {
playerCore.startMPV()
menuController.bindMenuItems()
isReady = true

if UserDefaults.standard.bool(forKey: Preference.Key.openStartPanel) {
// invoke after 0.5s
Timer.scheduledTimer(timeInterval: TimeInterval(0.5), target: self, selector: #selector(self.openFile(_:)), userInfo: nil, repeats: false)
}
}
// show alpha in color panels
NSColorPanel.shared().showsAlpha = true

// check update
UpdateChecker.checkUpdate(alertIfOfflineOrNoUpdate: false)
}

func applicationWillTerminate(_ aNotification: Notification) {
Expand Down Expand Up @@ -103,7 +111,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {

// MARK: - Menu actions

@IBAction func openFile(_ sender: NSMenuItem) {
@IBAction func openFile(_ sender: AnyObject) {
let panel = NSOpenPanel()
panel.title = "Choose media file"
panel.canCreateDirectories = false
Expand Down Expand Up @@ -162,4 +170,9 @@ class AppDelegate: NSObject, NSApplicationDelegate {
NSWorkspace.shared().open(URL(string: AppData.websiteLink)!)
}

@IBAction func checkUpdate(_ sender: AnyObject) {
UpdateChecker.checkUpdate()
}


}
2 changes: 1 addition & 1 deletion iina/Aspect.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Aspect: NSObject {
}

init?(string: String) {
if AppData.aspectRegex.matches(string) {
if Regex.aspect.matches(string) {
let wh = string.components(separatedBy: ":")
if let cropW = Float(wh[0]), let cropH = Float(wh[1]) {
self.size = NSMakeSize(CGFloat(cropW), CGFloat(cropH))
Expand Down
6 changes: 3 additions & 3 deletions iina/Base.lproj/AboutWindowController.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D17a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="box content view" minToolsVersion="7.0"/>
Expand All @@ -25,7 +25,7 @@
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="460" height="389"/>
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="777"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="460" height="389"/>
<autoresizingMask key="autoresizingMask"/>
Expand Down Expand Up @@ -65,7 +65,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" id="TI7-3V-nUn">
<font key="font" metaFont="smallSystem"/>
<string key="title">This is an alpha release. It will not update automatically, so please check out the website to get new versions. For bug reports, feature requests or help, please create an issue on Github or email me.</string>
<string key="title">This is an alpha release and not recommended for daily use. Please check for updates frequently. For bug reports, feature requests or help, please create an issue on Github or email me.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
Expand Down
18 changes: 18 additions & 0 deletions iina/Base.lproj/Localizable.strings
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,21 @@
"playlist_cap" = "PLAYLIST";

"chapter_cap" = "CHAPTERS";

"update.title_update_found" = "Update Found";

"update.title_no_update" = "No Update";

"update.title_error" = "Error";

"update.update_found" = "New version detected! IINA is still in alpha, so you are recommended to stay with the latest version. Please download from website or github:";

"update.no_update" = "You are running the latest version.";

"update.check_failed" = "Failed to check updates. You are probably running a too old version. Please check the website or github.";

"update.new_version" = "New version:";

"update.dl_from_website" = "Go To Website";

"update.dl_from_github" = "Go To Github";
18 changes: 16 additions & 2 deletions iina/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D17a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16C67" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
</dependencies>
Expand Down Expand Up @@ -237,7 +237,9 @@
<menuItem title="Volume - 1%" tag="1" alternate="YES" keyEquivalent="" id="Zhv-Bz-I5V">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
</menuItem>
<menuItem title="Mute" keyEquivalent="m" id="WOL-Us-ByA"/>
<menuItem title="Mute" id="WOL-Us-ByA">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="NlU-cH-tnU"/>
<menuItem title="Audio Delay:" enabled="NO" id="foC-r3-8mp">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down Expand Up @@ -293,6 +295,10 @@
<menuItem title="Load External Subtitle..." id="k6x-hf-ATi">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="yh3-Pu-MGm"/>
<menuItem title="Find Online Subtitles..." keyEquivalent="D" id="Mg3-WB-gjZ">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="58S-lP-UEY"/>
<menuItem title="Encoding" id="Pci-OQ-Vni">
<modifierMask key="keyEquivalentModifierMask"/>
Expand Down Expand Up @@ -375,6 +381,13 @@
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="J8m-Ix-VGl"/>
<menuItem title="Check Update..." id="gMo-qL-m08">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="checkUpdate:" target="Voe-Tx-rLC" id="CQ8-wR-EzN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="ZO8-wH-FBe"/>
<menuItem title="Github" id="A9w-iE-gVg">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
Expand Down Expand Up @@ -417,6 +430,7 @@
<outlet property="doubleSize" destination="Hal-18-Tnf" id="vnl-Rb-Y3o"/>
<outlet property="encodingMenu" destination="Pf6-5i-B1E" id="Gat-gG-pkT"/>
<outlet property="file" destination="dMs-cI-mzQ" id="upe-AE-Gf6"/>
<outlet property="findOnlineSub" destination="Mg3-WB-gjZ" id="Xft-hW-B9a"/>
<outlet property="fitToScreen" destination="SHd-63-Xoh" id="nzE-bA-wmk"/>
<outlet property="flip" destination="OIu-H0-Mht" id="fYJ-Fq-hak"/>
<outlet property="flipMenu" destination="n90-to-nRT" id="Zpp-Q8-NiJ"/>
Expand Down
2 changes: 1 addition & 1 deletion iina/Base.lproj/PrefCodecViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</connections>
</textField>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="o5P-yj-MvN">
<rect key="frame" x="113" y="85" width="195" height="18"/>
<rect key="frame" x="113" y="85" width="352" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use hardware decoding" bezelStyle="regularSquare" imagePosition="left" state="on" inset="2" id="WYE-SB-Ywe">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down
Loading

0 comments on commit dfca479

Please sign in to comment.