diff options
author | dynaflash <[email protected]> | 2010-08-04 17:11:02 +0000 |
---|---|---|
committer | dynaflash <[email protected]> | 2010-08-04 17:11:02 +0000 |
commit | 021d0f58a6bf5904964202c67cd9adbe6b60fc9f (patch) | |
tree | 5d7d825dee9429ce6ef3edba6fc8b9d16bc157bf /macosx | |
parent | c041c30ca962d7d13bde5e37e5c8e0b3983d33aa (diff) |
MacGui: Add separate method for cancelling a Live Preview encode.
- Also replace deprecated removeFileAtPath:handler: with removeItemAtPath:error: in HBPreviewController
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3469 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/English.lproj/PicturePreview.xib | 385 | ||||
-rw-r--r-- | macosx/HBPreviewController.h | 1 | ||||
-rw-r--r-- | macosx/HBPreviewController.m | 37 |
3 files changed, 403 insertions, 20 deletions
diff --git a/macosx/English.lproj/PicturePreview.xib b/macosx/English.lproj/PicturePreview.xib index a068db4a5..030fa9e7e 100644 --- a/macosx/English.lproj/PicturePreview.xib +++ b/macosx/English.lproj/PicturePreview.xib @@ -2,10 +2,10 @@ <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <data> <int key="IBDocument.SystemTarget">1050</int> - <string key="IBDocument.SystemVersion">10D573</string> - <string key="IBDocument.InterfaceBuilderVersion">740</string> + <string key="IBDocument.SystemVersion">10F569</string> + <string key="IBDocument.InterfaceBuilderVersion">788</string> <string key="IBDocument.AppKitVersion">1038.29</string> - <string key="IBDocument.HIToolboxVersion">460.00</string> + <string key="IBDocument.HIToolboxVersion">461.00</string> <object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> @@ -15,13 +15,13 @@ </object> <object class="NSMutableArray" key="dict.values"> <bool key="EncodedWithXMLCoder">YES</bool> - <string>740</string> - <string>1729</string> + <string>788</string> + <string>1742</string> </object> </object> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <bool key="EncodedWithXMLCoder">YES</bool> - <integer value="251"/> + <integer value="252"/> </object> <object class="NSArray" key="IBDocument.PluginDependencies"> <bool key="EncodedWithXMLCoder">YES</bool> @@ -969,14 +969,6 @@ <int key="connectionID">263</int> </object> <object class="IBConnectionRecord"> - <object class="IBActionConnection" key="connection"> - <string key="label">createMoviePreview:</string> - <reference key="source" ref="355312334"/> - <reference key="destination" ref="569473100"/> - </object> - <int key="connectionID">264</int> - </object> - <object class="IBConnectionRecord"> <object class="IBOutletConnection" key="connection"> <string key="label">fPictureSettingsToggleButton</string> <reference key="source" ref="355312334"/> @@ -1112,6 +1104,14 @@ </object> <int key="connectionID">384</int> </object> + <object class="IBConnectionRecord"> + <object class="IBActionConnection" key="connection"> + <string key="label">cancelCreateMoviePreview:</string> + <reference key="source" ref="355312334"/> + <reference key="destination" ref="569473100"/> + </object> + <int key="connectionID">395</int> + </object> </object> <object class="IBMutableOrderedSet" key="objectRecords"> <object class="NSArray" key="orderedObjects"> @@ -1792,7 +1792,7 @@ </object> </object> <nil key="sourceID"/> - <int key="maxID">394</int> + <int key="maxID">395</int> </object> <object class="IBClassDescriber" key="IBDocument.Classes"> <object class="NSMutableArray" key="referencedPartialClassDescriptions"> @@ -1828,6 +1828,7 @@ <object class="NSArray" key="dict.sortedKeys"> <bool key="EncodedWithXMLCoder">YES</bool> <string>SettingsChanged:</string> + <string>cancelCreateMoviePreview:</string> <string>createMoviePreview:</string> <string>goWindowedScreen:</string> <string>moviePlaybackGoBackwardOneFrame:</string> @@ -1855,6 +1856,7 @@ <string>id</string> <string>id</string> <string>id</string> + <string>id</string> <string>NSString</string> <string>id</string> <string>id</string> @@ -1862,6 +1864,95 @@ <string>id</string> </object> </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>SettingsChanged:</string> + <string>cancelCreateMoviePreview:</string> + <string>createMoviePreview:</string> + <string>goWindowedScreen:</string> + <string>moviePlaybackGoBackwardOneFrame:</string> + <string>moviePlaybackGoForwardOneFrame:</string> + <string>moviePlaybackGoToBeginning:</string> + <string>moviePlaybackGoToEnd:</string> + <string>pictureSliderChanged:</string> + <string>previewDurationPopUpChanged:</string> + <string>previewScrubberChanged:</string> + <string>showMoviePreview:</string> + <string>showPictureSettings:</string> + <string>showPreviewWindow:</string> + <string>toggleMoviePreviewPlayPause:</string> + <string>toggleScaleToScreen:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">SettingsChanged:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">cancelCreateMoviePreview:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">createMoviePreview:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">goWindowedScreen:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">moviePlaybackGoBackwardOneFrame:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">moviePlaybackGoForwardOneFrame:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">moviePlaybackGoToBeginning:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">moviePlaybackGoToEnd:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">pictureSliderChanged:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">previewDurationPopUpChanged:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">previewScrubberChanged:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">showMoviePreview:</string> + <string key="candidateClassName">NSString</string> + </object> + <object class="IBActionInfo"> + <string key="name">showPictureSettings:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">showPreviewWindow:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">toggleMoviePreviewPlayPause:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">toggleScaleToScreen:</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> <object class="NSMutableDictionary" key="outlets"> <bool key="EncodedWithXMLCoder">YES</bool> <object class="NSArray" key="dict.sortedKeys"> @@ -1923,6 +2014,145 @@ <string>NSTextField</string> </object> </object> + <object class="NSMutableDictionary" key="toOneOutletInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>fCancelPreviewMovieButton</string> + <string>fCreatePreviewMovieButton</string> + <string>fEncodingControlBox</string> + <string>fGoBackwardOneFrameButton</string> + <string>fGoForwardOneFrameButton</string> + <string>fGoToBeginningButton</string> + <string>fGoToEndButton</string> + <string>fGoToStillPreviewButton</string> + <string>fInfoField</string> + <string>fMovieCreationProgressIndicator</string> + <string>fMovieInfoField</string> + <string>fMoviePlaybackControlBox</string> + <string>fMovieScrubberSlider</string> + <string>fMovieView</string> + <string>fPictureControlBox</string> + <string>fPictureSettingsToggleButton</string> + <string>fPictureSlider</string> + <string>fPictureView</string> + <string>fPictureViewArea</string> + <string>fPlayPauseButton</string> + <string>fPreviewMovieLengthPopUp</string> + <string>fPreviewMovieStatusField</string> + <string>fPreviewWindow</string> + <string>fScaleToScreenToggleButton</string> + <string>fShowPreviewMovieButton</string> + <string>fscaleInfoField</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBToOneOutletInfo"> + <string key="name">fCancelPreviewMovieButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fCreatePreviewMovieButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fEncodingControlBox</string> + <string key="candidateClassName">NSBox</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fGoBackwardOneFrameButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fGoForwardOneFrameButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fGoToBeginningButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fGoToEndButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fGoToStillPreviewButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fInfoField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fMovieCreationProgressIndicator</string> + <string key="candidateClassName">NSProgressIndicator</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fMovieInfoField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fMoviePlaybackControlBox</string> + <string key="candidateClassName">NSBox</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fMovieScrubberSlider</string> + <string key="candidateClassName">NSSlider</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fMovieView</string> + <string key="candidateClassName">QTMovieView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPictureControlBox</string> + <string key="candidateClassName">NSBox</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPictureSettingsToggleButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPictureSlider</string> + <string key="candidateClassName">NSSlider</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPictureView</string> + <string key="candidateClassName">NSImageView</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPictureViewArea</string> + <string key="candidateClassName">NSBox</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPlayPauseButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPreviewMovieLengthPopUp</string> + <string key="candidateClassName">NSPopUpButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPreviewMovieStatusField</string> + <string key="candidateClassName">NSTextField</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fPreviewWindow</string> + <string key="candidateClassName">NSWindow</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fScaleToScreenToggleButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fShowPreviewMovieButton</string> + <string key="candidateClassName">NSButton</string> + </object> + <object class="IBToOneOutletInfo"> + <string key="name">fscaleInfoField</string> + <string key="candidateClassName">NSTextField</string> + </object> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBProjectSource</string> <string key="minorKey">HBPreviewController.h</string> @@ -2608,6 +2838,13 @@ <string key="NS.key.0">showWindow:</string> <string key="NS.object.0">id</string> </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <string key="NS.key.0">showWindow:</string> + <object class="IBActionInfo" key="NS.object.0"> + <string key="name">showWindow:</string> + <string key="candidateClassName">id</string> + </object> + </object> <object class="IBClassDescriptionSource" key="sourceIdentifier"> <string key="majorKey">IBFrameworkSource</string> <string key="minorKey">AppKit.framework/Headers/NSWindowController.h</string> @@ -2663,11 +2900,116 @@ <string>id</string> </object> </object> + <object class="NSMutableDictionary" key="actionInfosByName"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>add:</string> + <string>addScaled:</string> + <string>copy:</string> + <string>cut:</string> + <string>delete:</string> + <string>gotoBeginning:</string> + <string>gotoEnd:</string> + <string>gotoNextSelectionPoint:</string> + <string>gotoPosterFrame:</string> + <string>gotoPreviousSelectionPoint:</string> + <string>paste:</string> + <string>pause:</string> + <string>play:</string> + <string>replace:</string> + <string>selectAll:</string> + <string>selectNone:</string> + <string>stepBackward:</string> + <string>stepForward:</string> + <string>trim:</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="IBActionInfo"> + <string key="name">add:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">addScaled:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">copy:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">cut:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">delete:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">gotoBeginning:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">gotoEnd:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">gotoNextSelectionPoint:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">gotoPosterFrame:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">gotoPreviousSelectionPoint:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">paste:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">pause:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">play:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">replace:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">selectAll:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">selectNone:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">stepBackward:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">stepForward:</string> + <string key="candidateClassName">id</string> + </object> + <object class="IBActionInfo"> + <string key="name">trim:</string> + <string key="candidateClassName">id</string> + </object> + </object> + </object> <reference key="sourceIdentifier" ref="68262679"/> </object> </object> </object> <int key="IBDocument.localizationMode">0</int> + <string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string> <object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies"> <string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string> <integer value="1050" key="NS.object.0"/> @@ -2679,5 +3021,18 @@ <bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool> <string key="IBDocument.LastKnownRelativeProjectPath">../HandBrake.xcodeproj</string> <int key="IBDocument.defaultPropertyAccessControl">3</int> + <object class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes"> + <bool key="EncodedWithXMLCoder">YES</bool> + <object class="NSArray" key="dict.sortedKeys"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>NSMenuCheckmark</string> + <string>NSMenuMixedState</string> + </object> + <object class="NSMutableArray" key="dict.values"> + <bool key="EncodedWithXMLCoder">YES</bool> + <string>{9, 8}</string> + <string>{7, 2}</string> + </object> + </object> </data> </archive> diff --git a/macosx/HBPreviewController.h b/macosx/HBPreviewController.h index c8dc6d023..3d26e6927 100644 --- a/macosx/HBPreviewController.h +++ b/macosx/HBPreviewController.h @@ -107,6 +107,7 @@ - (void) installMovieCallbacks; - (void)removeMovieCallbacks; +- (IBAction) cancelCreateMoviePreview: (id) sender; - (IBAction) createMoviePreview: (id) sender; - (void) libhbStateChanged: (hb_state_t ) state; - (IBAction) showMoviePreview: (NSString *) path; diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m index 4b60d7e4a..2f6e98191 100644 --- a/macosx/HBPreviewController.m +++ b/macosx/HBPreviewController.m @@ -137,6 +137,7 @@ [fMovieTimer release]; [fMovieView setHidden:YES]; [fMovieView setMovie:nil]; + [self pictureSliderChanged:nil]; hudTimerSeconds = 0; [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PreviewWindowIsOpen"]; @@ -152,7 +153,7 @@ hb_stop(fPreviewLibhb); if (fPreviewMoviePath) { - [[NSFileManager defaultManager] removeFileAtPath:fPreviewMoviePath handler:nil]; + [[NSFileManager defaultManager] removeItemAtPath:fPreviewMoviePath error:nil]; [fPreviewMoviePath release]; } @@ -243,7 +244,10 @@ [fMovieCreationProgressIndicator stopAnimation: nil]; [fMovieCreationProgressIndicator setHidden: YES]; [fMoviePlaybackControlBox setHidden: YES]; - [self stopMovieTimer]; + if( fMovieTimer ) + { + [self stopMovieTimer]; + } [fPictureControlBox setHidden: NO]; [fPictureView setHidden:NO]; @@ -745,6 +749,30 @@ #pragma mark Movie Preview + +- (IBAction) cancelCreateMoviePreview: (id) sender +{ + + hb_state_t s; + hb_get_state2( fPreviewLibhb, &s ); + + if(isEncoding && (s.state == HB_STATE_WORKING || s.state == HB_STATE_PAUSED)) + { + hb_stop( fPreviewLibhb ); + [fPictureView setHidden:NO]; + [fMovieView pause:nil]; + [fMovieView setHidden:YES]; + [fMovieView setMovie:nil]; + [fPictureSlider setHidden:NO]; + isEncoding = NO; + + [self pictureSliderChanged:nil]; + + return; + } + +} + - (IBAction) createMoviePreview: (id) sender { @@ -758,7 +786,7 @@ hb_get_state2( fPreviewLibhb, &s ); if(sender == fCancelPreviewMovieButton && (s.state == HB_STATE_WORKING || s.state == HB_STATE_PAUSED)) - { + { hb_stop( fPreviewLibhb ); [fPictureView setHidden:NO]; [fMovieView pause:nil]; @@ -808,8 +836,7 @@ /* See if there is an existing preview file, if so, delete it */ if( ![[NSFileManager defaultManager] fileExistsAtPath:fPreviewMoviePath] ) { - [[NSFileManager defaultManager] removeFileAtPath:fPreviewMoviePath - handler:nil]; + [[NSFileManager defaultManager] removeItemAtPath:fPreviewMoviePath error:nil]; } /* We now direct our preview encode to fPreviewMoviePath */ |