Commit ffe31745 authored by David Fuhrmann's avatar David Fuhrmann

macosx: Split GoToTime panel into separate xib and window controller

This improves separation between main menu and the unrelated goto
time window.

Besides that, note that each time bindings are used with the file
owner, this owner needs to be an NSWindowController class. Only in
this case retain cycles are avoided (bindings have a strong
reference to the object used).

Thus, this commit helps to properly deinitialize the VLCMain object.
parent 39c71bd7
......@@ -158,6 +158,7 @@ EXTRA_DIST += \
extras/package/macosx/Resources/English.lproj/StreamOutput.xib \
extras/package/macosx/Resources/English.lproj/SyncTracks.xib \
extras/package/macosx/Resources/English.lproj/TextfieldPanel.xib \
extras/package/macosx/Resources/English.lproj/TimeSelectionPanel.xib \
extras/package/macosx/Resources/English.lproj/VideoEffects.xib \
extras/package/macosx/Resources/fspanel/fs_background.png \
extras/package/macosx/Resources/fspanel/fs_background@2x.png \
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="8152.3" systemVersion="14F6a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F25a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="8152.3"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCMainMenu">
......@@ -115,13 +115,6 @@
<outlet property="services" destination="1996" id="X3H-XI-xFK"/>
<outlet property="show_all" destination="150" id="XQ2-CW-0PI"/>
<outlet property="snapshot" destination="2249" id="6bO-HY-I3I"/>
<outlet property="specificTimeWindow" destination="Fqe-af-Tt9" id="wdd-qG-8FK"/>
<outlet property="specificTime_cancelButton" destination="C7h-06-Udn" id="X0U-Up-nHP"/>
<outlet property="specificTime_enterTextField" destination="ovY-qj-fWV" id="fir-sD-ubg"/>
<outlet property="specificTime_goToLabel" destination="bB6-Le-Ilg" id="WU8-SI-OLZ"/>
<outlet property="specificTime_okButton" destination="zrN-B3-Ede" id="CxC-B6-ZPs"/>
<outlet property="specificTime_secLabel" destination="oMI-0n-rej" id="wHN-JG-amG"/>
<outlet property="specificTime_stepper" destination="zsp-zD-QHr" id="xyb-Nm-5v4"/>
<outlet property="stop" destination="5156" id="irh-Cr-vBT"/>
<outlet property="subtitle_bgcolor" destination="5581" id="moz-G5-DBl"/>
<outlet property="subtitle_bgcolorMenu" destination="5582" id="gPd-5S-3xK"/>
......@@ -178,7 +171,7 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application">
<customObject id="-3" userLabel="Application" customClass="NSObject">
<connections>
<outlet property="dockMenu" destination="1617" id="hLP-Rj-RIm"/>
</connections>
......@@ -718,8 +711,8 @@
<action selector="performMiniaturize:" target="-1" id="5608"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="5603">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Zoom" keyEquivalent="z" id="5603">
<modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
<connections>
<action selector="performZoom:" target="-1" id="5605"/>
</connections>
......@@ -1037,78 +1030,6 @@
</textField>
</subviews>
</customView>
<window title="GoTo Specific Time" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="Fqe-af-Tt9" userLabel="GoToTime">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="429" y="553" width="249" height="103"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<view key="contentView" id="NrR-3A-NOR">
<rect key="frame" x="0.0" y="0.0" width="249" height="103"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" id="bB6-Le-Ilg">
<rect key="frame" x="-3" y="79" width="240" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Go to specific position" id="vXn-nw-Nrc">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="ovY-qj-fWV">
<rect key="frame" x="20" y="52" width="159" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="0" drawsBackground="YES" id="qZx-Li-5O2">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="value" keyPath="self.jumpTimeValue" id="inq-IT-YNl"/>
</connections>
</textField>
<button verticalHuggingPriority="750" id="zrN-B3-Ede">
<rect key="frame" x="150" y="13" width="84" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="icy-jS-WFH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
</button>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="zsp-zD-QHr">
<rect key="frame" x="185" y="50" width="15" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="10" maxValue="30000" valueWraps="YES" id="8Ok-J5-Vfx"/>
<connections>
<binding destination="-2" name="value" keyPath="self.jumpTimeValue" id="s1u-0J-RJh"/>
</connections>
</stepper>
<button verticalHuggingPriority="750" id="C7h-06-Udn">
<rect key="frame" x="68" y="13" width="84" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="fXt-nh-exA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
</button>
<textField verticalHuggingPriority="750" id="oMI-0n-rej">
<rect key="frame" x="203" y="54" width="34" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="sec." id="74c-xI-3AS">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</window>
<userDefaultsController representsSharedInstance="YES" id="uFO-sP-uo6"/>
</objects>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7706" systemVersion="14F25a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1070" identifier="macosx"/>
<development version="5100" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7706"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="VLCTimeSelectionPanelController">
<connections>
<outlet property="cancelButton" destination="C7h-06-Udn" id="vms-H9-Fs6"/>
<outlet property="goToLabel" destination="bB6-Le-Ilg" id="Psy-fF-eTf"/>
<outlet property="okButton" destination="zrN-B3-Ede" id="TzS-HN-YE3"/>
<outlet property="secsLabel" destination="oMI-0n-rej" id="Heh-nH-7Dv"/>
<outlet property="stepper" destination="zsp-zD-QHr" id="yab-Mp-27O"/>
<outlet property="textField" destination="ovY-qj-fWV" id="NtQ-WV-2da"/>
<outlet property="window" destination="Fqe-af-Tt9" id="u4H-rX-p0W"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="GoTo Specific Time" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="Fqe-af-Tt9" userLabel="GoToTime">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="429" y="553" width="249" height="103"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1417"/>
<view key="contentView" id="NrR-3A-NOR">
<rect key="frame" x="0.0" y="0.0" width="249" height="103"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField verticalHuggingPriority="750" id="bB6-Le-Ilg">
<rect key="frame" x="-3" y="79" width="240" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" alignment="center" title="Go to specific position" id="vXn-nw-Nrc">
<font key="font" metaFont="systemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" id="ovY-qj-fWV">
<rect key="frame" x="20" y="52" width="159" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="right" title="0" drawsBackground="YES" id="qZx-Li-5O2">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="-2" name="value" keyPath="self.jumpTimeValue" id="xWJ-vG-f9H"/>
</connections>
</textField>
<button verticalHuggingPriority="750" id="zrN-B3-Ede">
<rect key="frame" x="150" y="13" width="84" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="OK" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="icy-jS-WFH">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<string key="keyEquivalent" base64-UTF8="YES">
DQ
</string>
</buttonCell>
<connections>
<action selector="buttonPressed:" target="-2" id="0qF-5H-5Fz"/>
</connections>
</button>
<stepper horizontalHuggingPriority="750" verticalHuggingPriority="750" id="zsp-zD-QHr">
<rect key="frame" x="185" y="50" width="15" height="22"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<stepperCell key="cell" controlSize="small" continuous="YES" alignment="left" increment="10" maxValue="30000" valueWraps="YES" id="8Ok-J5-Vfx"/>
<connections>
<binding destination="-2" name="value" keyPath="self.jumpTimeValue" id="ade-2M-vOh"/>
</connections>
</stepper>
<button verticalHuggingPriority="750" id="C7h-06-Udn">
<rect key="frame" x="68" y="13" width="84" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="push" title="Cancel" bezelStyle="rounded" alignment="center" controlSize="small" borderStyle="border" inset="2" id="fXt-nh-exA">
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="smallSystem"/>
<string key="keyEquivalent" base64-UTF8="YES">
Gw
</string>
</buttonCell>
<connections>
<action selector="buttonPressed:" target="-2" id="Ad9-7v-03L"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="oMI-0n-rej">
<rect key="frame" x="203" y="54" width="34" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" sendsActionOnEndEditing="YES" title="sec." id="74c-xI-3AS">
<font key="font" metaFont="smallSystem"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
</window>
</objects>
</document>
......@@ -24,6 +24,7 @@
/* Begin PBXBuildFile section */
1C15C7DC1B5146DB003AB729 /* ResumeDialogController.h in Sources */ = {isa = PBXBuildFile; fileRef = 633121CA1B51122700E636DA /* ResumeDialogController.h */; };
1C15C7DD1B5146DB003AB729 /* ResumeDialogController.m in Sources */ = {isa = PBXBuildFile; fileRef = 633121CB1B51122700E636DA /* ResumeDialogController.m */; };
1C51BDE51B7A221B0056B9AA /* TimeSelectionPanel.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1C51BDE31B7A221B0056B9AA /* TimeSelectionPanel.xib */; };
1C57690E19DC93620099F5A6 /* topbar_background.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C57690D19DC93620099F5A6 /* topbar_background.png */; };
1C88BA5419DC7B2200645190 /* yosemite-window-close-graphite.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C88BA2419DC7B2200645190 /* yosemite-window-close-graphite.png */; };
1C88BA5519DC7B2200645190 /* yosemite-window-close-graphite@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1C88BA2519DC7B2200645190 /* yosemite-window-close-graphite@2x.png */; };
......@@ -451,6 +452,7 @@
1CCB5FAA1A62A724004C3E90 /* SPInvocationGrabbing.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF0777A13659A8000AF19FD /* SPInvocationGrabbing.m */; };
1CCB5FAB1A62A724004C3E90 /* SPMediaKeyTap.h in Sources */ = {isa = PBXBuildFile; fileRef = CCF0777B13659A8000AF19FD /* SPMediaKeyTap.h */; };
1CCB5FAC1A62A724004C3E90 /* SPMediaKeyTap.m in Sources */ = {isa = PBXBuildFile; fileRef = CCF0777C13659A8000AF19FD /* SPMediaKeyTap.m */; };
1CD3667B1B7A242E0054E39F /* VLCTimeSelectionPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1CD3667A1B7A242E0054E39F /* VLCTimeSelectionPanelController.m */; };
1CE5ED2119DD6AB700FCEFD3 /* lion-window-fullscreen-on.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED1B19DD6AB700FCEFD3 /* lion-window-fullscreen-on.png */; };
1CE5ED2219DD6AB700FCEFD3 /* lion-window-fullscreen-on@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED1C19DD6AB700FCEFD3 /* lion-window-fullscreen-on@2x.png */; };
1CE5ED2319DD6AB700FCEFD3 /* lion-window-fullscreen-over.png in Resources */ = {isa = PBXBuildFile; fileRef = 1CE5ED1D19DD6AB700FCEFD3 /* lion-window-fullscreen-over.png */; };
......@@ -879,6 +881,7 @@
1058C7ADFEA557BF11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
1C3AABAC1B1BAE7B00FDF001 /* VLC.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = VLC.app; path = ../VLC.app; sourceTree = BUILT_PRODUCTS_DIR; };
1C3AABB01B1BB00A00FDF001 /* VLC-dev.app */ = {isa = PBXFileReference; lastKnownFileType = wrapper.application; name = "VLC-dev.app"; path = "../VLC-dev.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1C51BDE41B7A221B0056B9AA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/TimeSelectionPanel.xib; sourceTree = "<group>"; };
1C57690D19DC93620099F5A6 /* topbar_background.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = topbar_background.png; path = Resources/mainwindow/topbar_background.png; sourceTree = "<group>"; };
1C88BA2419DC7B2200645190 /* yosemite-window-close-graphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yosemite-window-close-graphite.png"; sourceTree = "<group>"; };
1C88BA2519DC7B2200645190 /* yosemite-window-close-graphite@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "yosemite-window-close-graphite@2x.png"; sourceTree = "<group>"; };
......@@ -1219,6 +1222,8 @@
1CBB2CC71B06A6DE00110ADA /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = Resources/English.lproj/Help.xib; sourceTree = "<group>"; };
1CC25CA71B2C585D0003F994 /* darwinvlc.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = darwinvlc.m; path = ../../../bin/darwinvlc.m; sourceTree = "<group>"; };
1CCB5F2F1A62A6A5004C3E90 /* pseudo-vlc.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "pseudo-vlc.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1CD366791B7A242E0054E39F /* VLCTimeSelectionPanelController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCTimeSelectionPanelController.h; path = ../../../modules/gui/macosx/VLCTimeSelectionPanelController.h; sourceTree = "<group>"; };
1CD3667A1B7A242E0054E39F /* VLCTimeSelectionPanelController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCTimeSelectionPanelController.m; path = ../../../modules/gui/macosx/VLCTimeSelectionPanelController.m; sourceTree = "<group>"; };
1CE5ED1B19DD6AB700FCEFD3 /* lion-window-fullscreen-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen-on.png"; sourceTree = "<group>"; };
1CE5ED1C19DD6AB700FCEFD3 /* lion-window-fullscreen-on@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen-on@2x.png"; sourceTree = "<group>"; };
1CE5ED1D19DD6AB700FCEFD3 /* lion-window-fullscreen-over.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "lion-window-fullscreen-over.png"; sourceTree = "<group>"; };
......@@ -1890,6 +1895,8 @@
CCCE366E13817E4500694F2A /* VideoEffects.m */,
CCCCDCA01413E1C000FE3DE1 /* VideoView.h */,
CCCCDCA11413E1C000FE3DE1 /* VideoView.m */,
1CD366791B7A242E0054E39F /* VLCTimeSelectionPanelController.h */,
1CD3667A1B7A242E0054E39F /* VLCTimeSelectionPanelController.m */,
5CCED71414C0D4A90057F8D1 /* VLCUIWidgets.h */,
5CCED71514C0D4A90057F8D1 /* VLCUIWidgets.m */,
E0C2583E161B593D00185AAD /* VLCVoutWindowController.h */,
......@@ -2901,6 +2908,7 @@
633121CE1B5112C300E636DA /* ResumeDialog.xib */,
1C9465971B77B9FC007C965A /* PopupPanel.xib */,
1C9465991B77B9FC007C965A /* TextfieldPanel.xib */,
1C51BDE31B7A221B0056B9AA /* TimeSelectionPanel.xib */,
7D8BB0B51830311300FAE9B7 /* DebugMessageVisualizer.xib */,
7D8BB0B81830367200FAE9B7 /* PlaylistMenu.xib */,
7D8BB0BE1830393300FAE9B7 /* MainWindow.xib */,
......@@ -3172,6 +3180,7 @@
CC04332213B28B2900D7D52E /* fs_time_slider_knob.png in Resources */,
1C88BC0919DC7C8100645190 /* ys-fullscreen-one-button_dark.png in Resources */,
CC04332313B28B2900D7D52E /* fs_time_slider.png in Resources */,
1C51BDE51B7A221B0056B9AA /* TimeSelectionPanel.xib in Resources */,
1C88BA5F19DC7B2200645190 /* yosemite-window-close@2x.png in Resources */,
CC04332413B28B2900D7D52E /* fs_volume_max_highlight.png in Resources */,
1C88BBFA19DC7C8100645190 /* ys-effects-one-button_dark@2x.png in Resources */,
......@@ -3875,6 +3884,7 @@
1CCB5F701A62A724004C3E90 /* fspanel.h in Sources */,
1CCB5F711A62A724004C3E90 /* fspanel.m in Sources */,
1CCB5F721A62A724004C3E90 /* intf.h in Sources */,
1CD3667B1B7A242E0054E39F /* VLCTimeSelectionPanelController.m in Sources */,
1CCB5F731A62A724004C3E90 /* intf.m in Sources */,
1CCB5F741A62A724004C3E90 /* macosx.m in Sources */,
1CCB5F751A62A724004C3E90 /* MainMenu.h in Sources */,
......@@ -3946,6 +3956,14 @@
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
1C51BDE31B7A221B0056B9AA /* TimeSelectionPanel.xib */ = {
isa = PBXVariantGroup;
children = (
1C51BDE41B7A221B0056B9AA /* English */,
);
name = TimeSelectionPanel.xib;
sourceTree = "<group>";
};
1C9465971B77B9FC007C965A /* PopupPanel.xib */ = {
isa = PBXVariantGroup;
children = (
......
......@@ -202,15 +202,6 @@
@property (readwrite, weak) IBOutlet NSMenuItem *voutMenufullscreen;
@property (readwrite, weak) IBOutlet NSMenuItem *voutMenusnapshot;
@property (readwrite, weak) IBOutlet NSButton *specificTime_cancelButton;
@property (readwrite, weak) IBOutlet NSTextField *specificTime_enterTextField;
@property (readwrite, weak) IBOutlet NSTextField *specificTime_goToLabel;
@property (readwrite, weak) IBOutlet NSButton *specificTime_okButton;
@property (readwrite, weak) IBOutlet NSWindow *specificTimeWindow;
@property (readwrite, weak) IBOutlet NSTextField *specificTime_secLabel;
@property (readwrite, weak) IBOutlet NSStepper *specificTime_stepper;
@property (nonatomic) int jumpTimeValue;
@property (readwrite, weak) IBOutlet NSView *playlistSaveAccessoryView;
@property (readwrite, weak) IBOutlet NSPopUpButton *playlistSaveAccessoryPopup;
@property (readwrite, weak) IBOutlet NSTextField *playlistSaveAccessoryText;
......
......@@ -46,6 +46,7 @@
#import "ConvertAndSave.h"
#import "DebugMessageVisualizer.h"
#import "AddonsWindowController.h"
#import "VLCTimeSelectionPanelController.h"
#ifdef HAVE_SPARKLE
#import <Sparkle/Sparkle.h>
......@@ -66,6 +67,9 @@
NSArray *_menuOrderOfPlaylistTableColumns;
NSMenu *_playlistTableColumnsContextMenu;
__strong VLCTimeSelectionPanelController *_timeSelectionPanel;
}
@end
......@@ -82,6 +86,8 @@
- (void)awakeFromNib
{
_timeSelectionPanel = [[VLCTimeSelectionPanelController alloc] init];
/* check whether the user runs OSX with a RTL language */
NSArray* languages = [NSLocale preferredLanguages];
NSString* preferredLanguage = [languages firstObject];
......@@ -487,12 +493,6 @@
[_voutMenumute setTitle: _NS("Mute")];
[_voutMenufullscreen setTitle: _NS("Fullscreen")];
[_voutMenusnapshot setTitle: _NS("Snapshot")];
[_specificTime_cancelButton setTitle: _NS("Cancel")];
[_specificTime_okButton setTitle: _NS("OK")];
[_specificTime_secLabel setStringValue: _NS("sec.")];
[_specificTime_goToLabel setStringValue: _NS("Jump to Time")];
[_specificTime_enterTextField setFormatter:[[PositionFormatter alloc] init]];
}
- (NSMenu *)setupPlaylistTableColumnsMenu
......@@ -864,53 +864,27 @@
- (IBAction)goToSpecificTime:(id)sender
{
if (sender == _specificTime_cancelButton)
{
[NSApp endSheet: _specificTimeWindow];
[_specificTimeWindow close];
} else if (sender == _specificTime_okButton) {
input_thread_t *p_input = pl_CurrentInput(VLCIntf);
if (p_input) {
int64_t timeInSec = 0;
NSString *fieldContent = [_specificTime_enterTextField stringValue];
if ([[fieldContent componentsSeparatedByString: @":"] count] > 1 &&
[[fieldContent componentsSeparatedByString: @":"] count] <= 3) {
NSArray *ourTempArray = \
[fieldContent componentsSeparatedByString: @":"];
if ([[fieldContent componentsSeparatedByString: @":"] count] == 3) {
timeInSec += ([[ourTempArray firstObject] intValue] *3600); //h
timeInSec += ([[ourTempArray objectAtIndex:1] intValue] *60); //m
timeInSec += [[ourTempArray objectAtIndex:2] intValue]; //s
} else {
timeInSec += ([[ourTempArray firstObject] intValue] *60); //m
timeInSec += [[ourTempArray objectAtIndex:1] intValue]; //s
}
input_thread_t *p_input = pl_CurrentInput(VLCIntf);
if (p_input) {
/* we can obviously only do that if an input is available */
int64_t length = var_GetInteger(p_input, "length");
[_timeSelectionPanel setMaxValue:(length / CLOCK_FREQ)];
int64_t pos = var_GetInteger(p_input, "time");
[_timeSelectionPanel setJumpTimeValue: (pos / CLOCK_FREQ)];
[_timeSelectionPanel runModalForWindow:[NSApp mainWindow]
completionHandler:^(NSInteger returnCode, int64_t returnTime) {
if (returnCode != NSOKButton)
return;
input_thread_t *p_input = pl_CurrentInput(VLCIntf);
if (p_input) {
input_Control(p_input, INPUT_SET_TIME, (int64_t)(returnTime *1000000));
vlc_object_release(p_input);
}
else
timeInSec = [fieldContent intValue];
input_Control(p_input, INPUT_SET_TIME, (int64_t)(timeInSec *1000000));
vlc_object_release(p_input);
}
}];
[NSApp endSheet: _specificTimeWindow];
[_specificTimeWindow close];
} else {
input_thread_t *p_input = pl_CurrentInput(VLCIntf);
if (p_input) {
/* we can obviously only do that if an input is available */
int64_t pos, length;
length = var_GetInteger(p_input, "length");
[_specificTime_stepper setMaxValue: (length / CLOCK_FREQ)];
pos = var_GetInteger(p_input, "time");
[self setJumpTimeValue: (pos / CLOCK_FREQ)];
[NSApp beginSheet: _specificTimeWindow modalForWindow: \
[NSApp mainWindow] modalDelegate: self didEndSelector: nil \
contextInfo: nil];
[_specificTimeWindow makeKeyWindow];
vlc_object_release(p_input);
}
vlc_object_release(p_input);
}
}
......
......@@ -70,6 +70,7 @@ libmacosx_plugin_la_SOURCES = \
TrackSynchronization.h TrackSynchronization.m \
VideoEffects.h VideoEffects.m \
VideoView.h VideoView.m \
VLCTimeSelectionPanelController.h VLCTimeSelectionPanelController.m \
VLCUIWidgets.h VLCUIWidgets.m \
VLCVoutWindowController.h VLCVoutWindowController.m \
Windows.h Windows.m
/*****************************************************************************
* TimeSelectionPanelController.h: Controller for time selection panel
*****************************************************************************
* Copyright (C) 2015 VideoLAN and authors
* Author: David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCTimeSelectionPanelController : NSWindowController
@property (readwrite, weak) IBOutlet NSButton *cancelButton;
@property (readwrite, weak) IBOutlet NSTextField *textField;
@property (readwrite, weak) IBOutlet NSTextField *goToLabel;
@property (readwrite, weak) IBOutlet NSButton *okButton;
@property (readwrite, weak) IBOutlet NSTextField *secsLabel;
@property (readwrite, weak) IBOutlet NSStepper *stepper;
@property (nonatomic) int jumpTimeValue;
@property (nonatomic) int maxValue;
- (IBAction)buttonPressed:(id)sender;
/**
* Completion handler for textfield panel
* \param returnCode Result from panel. Can be NSOKButton or NSCancelButton.
* \param returnTime Resulting time in seconds entered in panel.
*/
typedef void(^TimeSelectionCompletionHandler)(NSInteger returnCode, int64_t returnTime);
/**
* Shows the panel as a modal dialog with window as its owner.
* \param window Parent window for the dialog.
* \param handler Completion block.
*/
- (void)runModalForWindow:(NSWindow *)window completionHandler:(TimeSelectionCompletionHandler)handler;
@end
\ No newline at end of file
/*****************************************************************************
* TimeSelectionPanelController.m: Controller for time selection panel
*****************************************************************************
* Copyright (C) 2015 VideoLAN and authors
* Author: David Fuhrmann <david dot fuhrmann at googlemail dot com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "VLCTimeSelectionPanelController.h"
#import "misc.h"
#import "StringUtility.h"
@interface VLCTimeSelectionPanelController()
{
TimeSelectionCompletionHandler _completionHandler;
}
@end
@implementation VLCTimeSelectionPanelController
#pragma mark - object handling
- (id)init
{
self = [super initWithWindowNibName:@"TimeSelectionPanel"];
return self;
}
#pragma mark - UI handling
- (void)windowDidLoad
{
[_cancelButton setTitle: _NS("Cancel")];
[_okButton setTitle: _NS("OK")];
[_secsLabel setStringValue: _NS("sec.")];
[_goToLabel setStringValue: _NS("Jump to Time")];
[_textField setFormatter:[[PositionFormatter alloc] init]];
}
- (IBAction)buttonPressed:(id)sender
{
[self.window orderOut:sender];
[NSApp endSheet: self.window];
// calculate resulting time in secs:
int64_t timeInSec = 0;
NSString *string = [_textField stringValue];
if ([[string componentsSeparatedByString: @":"] count] > 1 &&
[[string componentsSeparatedByString: @":"] count] <= 3) {
NSArray *ourTempArray = \
[string componentsSeparatedByString: @":"];
if ([[string componentsSeparatedByString: @":"] count] == 3) {
timeInSec += ([[ourTempArray firstObject] intValue] *3600); //h
timeInSec += ([[ourTempArray objectAtIndex:1] intValue] *60); //m
timeInSec += [[ourTempArray objectAtIndex:2] intValue]; //s
} else {
timeInSec += ([[ourTempArray firstObject] intValue] *60); //m
timeInSec += [[ourTempArray objectAtIndex:1] intValue]; //s
}
}
else
timeInSec = [string intValue];
if (_completionHandler)
_completionHandler(sender == _okButton ? NSOKButton : NSCancelButton, timeInSec);
}
- (void)runModalForWindow:(NSWindow *)window completionHandler:(TimeSelectionCompletionHandler)handler
{
[self window];
[_stepper setMaxValue:self.maxValue];
_completionHandler = [handler copy];
[NSApp beginSheet:self.window
modalForWindow:window modalDelegate:self
didEndSelector:nil
contextInfo:nil];
}
@end
......@@ -614,6 +614,8 @@ modules/gui/macosx/VideoEffects.h
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/VideoView.h
modules/gui/macosx/VideoView.m
modules/gui/macosx/VLCTimeSelectionPanelController.h
modules/gui/macosx/VLCTimeSelectionPanelController.m
modules/gui/macosx/VLCVoutWindowController.h
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment